OPNsense Forum

English Forums => 26.1 Series => Topic started by: namphy on February 14, 2026, 05:26:43 PM

Title: Issue Removing Gateway Group - PHP Fatal Error
Post by: namphy on February 14, 2026, 05:26:43 PM
Hello,
I'm currently running OPNsense version 26.1.2. When I attempt to remove a gateway group, I receive the following error:

PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/system_gateway_groups.php:41
This error prevents the gateway group from being removed. The gateway group was created by mistake, as I only have one gateway. I can reproduce this issue by creating a second gateway group, adding my gateway to it, and then attempting to remove the group. The same error occurs, and the gateway is not removed.

I have two OPNsense routers, and I was able to replicate this issue on both of them.

Let me know if you need any additional information.

Error Details:

[REDACTED-TIMESTAMP] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/system_gateway_groups.php:41
Stack trace:
#0 {main}
  thrown in /usr/local/www/system_gateway_groups.php on line 41
[REDACTED-TIMESTAMP] PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/system_gateway_groups.php:41
Stack trace:
#0 {main}
  thrown in /usr/local/www/system_gateway_groups.php on line 41
Title: Re: Issue Removing Gateway Group - PHP Fatal Error
Post by: Ben S on February 14, 2026, 10:12:31 PM
This looks like it's due to not having any old style rules.  I'm guessing you've migrated to new style rules, and deleted all of your old rules?  I can reproduce this by ensuring at least one old style rule exists, running step 5 of the rules migration, and then trying to delete a gateway group.  Deleting the last rule by hand doesn't cause the problem.

As a workaround until this is fixed, if you add any old style rule (even if it is disabled) then you should be able to delete the gateway group.
Title: Re: Issue Removing Gateway Group - PHP Fatal Error
Post by: namphy on February 15, 2026, 10:45:00 AM
Thank you for the clarification. I can confirm that this was indeed the issue (we removed old rules after migration by running the removal script). I applied your suggested workaround by adding an old style rule, and after that I was able to successfully delete the gateway group.

Thanks again for the guidance!
Title: Re: Issue Removing Gateway Group - PHP Fatal Error
Post by: Ben S on February 15, 2026, 11:32:10 AM
Glad you got it sorted.  I've created a bug report for this now https://github.com/opnsense/core/issues/9792
Title: Re: Issue Removing Gateway Group - PHP Fatal Error
Post by: franco on February 16, 2026, 12:29:18 PM
Thanks. Patch here https://github.com/opnsense/core/issues/9792#issuecomment-3907589714


Cheers,
Franco