Issue Removing Gateway Group - PHP Fatal Error

Started by namphy, February 14, 2026, 05:26:43 PM

Previous topic - Next topic
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

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.