OPNsense Forum

English Forums => 26.1, 26,4 Series => Topic started by: ews on May 15, 2026, 10:28:18 PM

Title: [Solved] OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection)
Post by: ews on May 15, 2026, 10:28:18 PM
Hello,

after upgrading OPNsense Business to 26.4 we are seeing OPNcentral sync failures on some firewalls during NAT synchronization.

Error:

TypeError: Cannot access offset of type string on string in /usr/local/opnsense/mvc/app/controllers/Deciso/OPNcentral/Api/Sync/BaseSection.php:162

Stack trace:

Deciso\OPNcentral\Api\Sync\BaseSection->array_iterator()
Deciso\OPNcentral\Api\Sync\Nat->extend()
Deciso\OPNcentral\Api\SyncController->reconfigureAction()

Observations:

only happens after upgrade to 26.4
issue seems related to NAT / Destination NAT migration
affected systems use multiple Destination NAT redirect rules
disabling NAT sync avoids the issue
not all firewalls are affected

It looks like one NAT-related config structure is returned as string instead of array and crashes array_iterator().

Has anybody seen similar behavior after migrating to 26.4?

Regards
Christian
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: franco on May 18, 2026, 09:50:46 AM
Hi Christian,

Haven't heard about this from someone else so far.

Would you mind sharing with me the legacy NAT rules configuratio so I can try to reproduce?  At least I'm assuming it's the legacy configuration, because quirks there are more common.

# pluginctl -g nat

You can also share this via PM or mail to franco AT opnsense DOT org


Thanks,
Franco
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: ews on May 18, 2026, 11:11:09 AM
Hello Franco,

pluginctl -n nat returns no output on my system.

At first I thought I may have missed a migration step because the firewall rules in 26.4 had to be manually converted to the new MVC system. However, from what I have been able to verify so far, NAT still appears to be largely legacy-based at the moment.

Therefore I assume my system is still using the classic NAT configuration from config.xml.

Would you prefer only the NAT section or a full config.xml for reproduction?

And on which firewall does the problem occur — source or destination?

Thanks,
Christian
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: franco on May 18, 2026, 11:21:46 AM
Sorry I meant to write -g:

# pluginctl -g nat


Cheers,
Franco
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: ews on May 18, 2026, 11:43:26 AM
I sent the two PMs.
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: franco on May 18, 2026, 02:36:33 PM
Thank you, still working on it.


Cheers,
Franco
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: franco on May 19, 2026, 09:55:29 AM
Can you try this test package? Best to install on all systems:

# opnsense-revert -z os-OPNBEcore


Cheers,
Franco
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: ews on May 19, 2026, 01:30:36 PM
Hi Franco,

thanks for the update.

The issue is resolved with this fix and nat synchronization is working again.

I have now deployed it to the affected firewalls and it works on all of them.

Since I first installed it only on one of the target firewalls and then tested the synchronization immediately afterwards, I can confirm that updating only the target firewall was already sufficient.


Christian
Title: Re: OPNcentral NAT sync crash after upgrade to 26.4 (TypeError in BaseSection.php)
Post by: franco on May 19, 2026, 02:40:40 PM
Great, this will be hotfixed later this afternoon.


Cheers,
Franco