OPNsense Forum

English Forums => 26.1 Series => Topic started by: ltcptgeneral on February 28, 2026, 09:23:23 AM

Title: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: ltcptgeneral on February 28, 2026, 09:23:23 AM
I've managed to successfully migrate the FW rules to the new interface, but Opnsense throws the following error if I try to do step 5 (deleting the legacy rules):

[28-Feb-2026 00:05:49 America/Los_Angeles] ReflectionException: Class "OPNsense\" does not exist in /usr/local/opnsense/mvc/app/library/OPNsense/Core/ConfigMaintenance.php:62
Stack trace:
#0 /usr/local/opnsense/mvc/app/library/OPNsense/Core/ConfigMaintenance.php(62): ReflectionClass->__construct('OPNsense\\')
#1 /usr/local/opnsense/mvc/app/library/OPNsense/Core/ConfigMaintenance.php(42): OPNsense\Core\ConfigMaintenance->loadModels()
#2 /usr/local/opnsense/mvc/app/controllers/OPNsense/Firewall/Api/MigrationController.php(48): OPNsense\Core\ConfigMaintenance->__construct()
#3 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Dispatcher.php(166): OPNsense\Firewall\Api\MigrationController->flushAction()
#4 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(156): OPNsense\Mvc\Dispatcher->dispatch(Object(OPNsense\Mvc\Request), Object(OPNsense\Mvc\Response), Object(OPNsense\Mvc\Session))
#5 /usr/local/opnsense/mvc/app/library/OPNsense/Mvc/Router.php(139): OPNsense\Mvc\Router->performRequest(Object(OPNsense\Mvc\Dispatcher))
#6 /usr/local/opnsense/www/api.php(36): OPNsense\Mvc\Router->routeRequest('/api/firewall/m...', Array)
#7 {main}

This happens with or without legacy rules. There also seems to be ghost floating rules (which don't actually exist in the legacy floating rules list). As far as I can tell, this is just an API issue, and the migrated FW rules are working fine.
Title: Re: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: nero355 on March 04, 2026, 10:03:24 PM
Is this fixed now in 26.1.3 ?!
Title: Re: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: franco on March 05, 2026, 06:46:06 AM
I'm not sure what would case "ReflectionException: Class "OPNsense\" does not exist" but I'm taking a look.


Cheers,
Franco
Title: Re: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: franco on March 05, 2026, 08:25:24 AM
@ltcptgeneral can you try this patch?

# opnsense-patch https://github.com/opnsense/core/commit/df6d9ea77


Cheers,
Franco
Title: Re: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: ltcptgeneral on March 06, 2026, 08:41:02 AM
@franco Any steps to trying this patch? Should I just copy the changes to the file locally and then restart the web interface?
Title: Re: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: franco on March 06, 2026, 09:20:05 AM
Run the command in a root shell to apply it. It's easy as that :)


Cheers,
Franco
Title: Re: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: ltcptgeneral on March 06, 2026, 09:35:32 AM
Yep, its not throwing the error anymore. Thanks!
Title: Re: ReflectionException trying to delete legacy FW rules using migration assistant
Post by: franco on March 06, 2026, 11:05:15 AM
Thanks, I've queued this up for 26.1.4.


Cheers,
Franco