You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ x ] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
[ x ] The title contains the plugin to which this issue belongs
Describe the bug
When editing an existing "SNI Upstream Mapping" entry (adding, removing, or
modifying rows), the map's child sni_hostname_upstream_map_item nodes are
never actually deleted — a brand new set of items is created on every save,
and the previous items are left behind as orphans in config.xml. If you keep
editing the same map, orphans accumulate on every save. If the whole map is
then deleted, only the last-linked set of items is cleaned up; earlier
orphans remain.
Since each orphaned item still holds an <upstream> reference to its
upstream server, SettingsController::$internalModelUseSafeDelete later
blocks deletion of that upstream server, reporting it as "in use", even
though it's no longer actually referenced from any live map.
The exact same code pattern exists for ip_acl_item (regenerate_ipacl()),
so IP ACL edits are affected identically.
To Reproduce
Steps to reproduce the behavior:
Services: Nginx: SNI Upstream Mapping → create a map with one hostname
entry linked to an upstream.
Save. Note the item's uuid in Diagnostics: Config.xml
(sni_hostname_upstream_map_item).
Edit the map (e.g. add a second hostname), save again.
Check Diagnostics: Config.xml — the original item from step 2 is still
present, unreferenced by the map's data field.
Repeat a few times — orphans accumulate.
Try to delete the upstream server referenced by an orphaned item: it is
reported as "in use" and cannot be deleted.
Expected behavior
There should be no orphans on the configuration after SNI maps o ACLs deletion
Screenshots
If applicable, add screenshots to help explain your problem.
Relevant log files
If applicable, information from log files supporting your claim.
Additional context
I found this bug while developing this feature request #5596
Environment
OPNsense 26.7.2_2 (amd64).
VMWare ESXi 7 VM
Activity
muchachagrande commentedon Aug 20, 2026
I have a fix for this issue working locally. I'll generate a PR as soon as possible.
www/nginx: address review feedback