Pfsync Migration Error: [OPNsense\Core\Hasync:pfsyncinterface] Option not in...

Started by ericdiao, August 29, 2024, 10:05:53 PM

Previous topic - Next topic
I was updating from 24.7.2 to 24.7.3 and subsequent to 3_1. Both upgrade process seems to be smooth but the upgrade log shows the following message:

*** OPNsense\Core\Hasync Migration failed, check log for details

I checked the log. The log has the following relevant entries:

2024-08-29T19:52:39   Error   config   #2 {main} )   
2024-08-29T19:52:39   Error   config   #1 /usr/local/opnsense/mvc/script/run_migrations.php(54): OPNsense\Base\BaseModel->runMigrations()   
2024-08-29T19:52:39   Error   config   #0 /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php(791): OPNsense\Base\BaseModel->serializeToConfig()   
2024-08-29T19:52:39   Error   config   Stack trace:   
2024-08-29T19:52:39   Error   config   in /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php:666   
2024-08-29T19:52:39   Error   config   Model OPNsense\Core\Hasync can't be saved, skip ( OPNsense\Base\ValidationException: [OPNsense\Core\Hasync:pfsyncinterface] Option not in list.{lan}   
2024-08-29T19:52:39   Error   config   [OPNsense\Core\Hasync:pfsyncinterface] Option not in list.{lan}

I am not using pfsync or any HA setup but the error seems to be relating to HA?

The machine is a bare metal ThinkCentre M720q with an Intel I350 NIC
Bare Metal Lenovo ThinkCentre M720q i3-8100T 8GB
Intel I350-F4 Quad-Port Gigabit
Cable 600Mbps Down / 25 Mbps Up

It seems to be related to the Migration at:
* https://github.com/opnsense/core/blob/9f4331424699cce931418d7cb97e4e60f9afc51d/src/opnsense/mvc/app/models/OPNsense/Core/Migrations/MHA1_0_0.php#L36
* https://github.com/opnsense/core/blob/9f4331424699cce931418d7cb97e4e60f9afc51d/src/opnsense/mvc/app/models/OPNsense/Core/Hasync.xml#L21

The default value here is lan but there is no lan interface exists in my setup because I deleted it when setting up VLANs over a LAGG interface.

I suspect this is the issue and a force re-saving via UI (/ui/core/hasync) will solve this?

Bare Metal Lenovo ThinkCentre M720q i3-8100T 8GB
Intel I350-F4 Quad-Port Gigabit
Cable 600Mbps Down / 25 Mbps Up

Thanks for the report. Expect a fix later today. It's clear what is to do but the way it is now requiring there to be at least one interface doesn't make this very elegant, because we simply don't know which interface is to be selected by the user.


Cheers,
Franco


Thanks Franco!

On my side I tried to assign pfsyncinterface to an existing not-in-use Interface on UI and do a save without enabling HA. It seems to work since I can see the entry being written to config.xml (the previous version tracked by git has no such entry). I think this would be a workaround.
Bare Metal Lenovo ThinkCentre M720q i3-8100T 8GB
Intel I350-F4 Quad-Port Gigabit
Cable 600Mbps Down / 25 Mbps Up

Yes. In practice it doesn't matter at all because you don't have it enabled.


Cheers,
Franco

After a bit of back and forth on the backend situation this is the full fix:

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

I expect it to be merged tomorrow. Still needs a slight documentation update but it's been fully tested.


Cheers,
Franco

How do I use it ? Just apply the patch and it will solve the issue or the migration has to be forced somehow ?

Forget about it. I installed it, rebooted and it did work for me

Thanks, nice to hear. It's going to be in 24.7.4 next week, too.


Cheers,
Franco