Unbound failed to start after upgrading to 23.7, Domain Overrides Issue

Started by anicoletti, August 01, 2023, 05:50:34 AM

Previous topic - Next topic
For me, running the migration showed no output, and stopping and starting unbound with my custom conf file in place failed, with only this in the general log:

2023-08-01T11:32:08-04:00 Error opnsense /usr/local/sbin/pluginctl: The command '/bin/kill -'TERM' '65031'' returned exit code '1', the output was 'kill: 65031: No such process'
2023-08-01T11:32:08-04:00 Notice opnsense /usr/local/sbin/pluginctl: plugins_configure unbound_start (execute task : unbound_configure_do(1))
2023-08-01T11:32:08-04:00 Notice opnsense /usr/local/sbin/pluginctl: plugins_configure unbound_start (1)


EDIT: note that I removed the <active_interface/> line as well before running the migration.

Here's something else that I didn't notice before in the error reporter:

[01-Aug-2023 11:28:57 America/New_York] PHP Fatal error:  Uncaught TypeError: flock(): Argument #1 ($stream) must be of type resource, bool given in /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/JsonKeyValueStoreField.php:132
Stack trace:
#0 /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/JsonKeyValueStoreField.php(132): flock(false, 2)
#1 /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php(193): OPNsense\Base\FieldTypes\JsonKeyValueStoreField->actionPostLoadingEvent()
#2 /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php(191): OPNsense\Base\FieldTypes\BaseField->eventPostLoading()
#3 /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php(191): OPNsense\Base\FieldTypes\BaseField->eventPostLoading()
#4 /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php(191): OPNsense\Base\FieldTypes\BaseField->eventPostLoading()
#5 /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/BaseField.php(191): OPNsense\Base\FieldTypes\BaseField->eventPostLoading()
#6 /usr/local/opnsense/mvc/app/models/OPNsense/Base/BaseModel.php(367): OPNsense\Base\FieldTypes\BaseField->eventPostLoading()
#7 [internal function]: OPNsense\Base\BaseModel->__construct()
#8 /usr/local/opnsense/mvc/script/run_migrations.php(52): ReflectionClass->newInstance()
#9 {main}
  thrown in /usr/local/opnsense/mvc/app/models/OPNsense/Base/FieldTypes/JsonKeyValueStoreField.php on line 132

I have noted that the outgoing_interface setting disappears during migration. This causes domain override /query forwarding to stop working in my setup.

outgoing_interface has the same problem. I think the fix is this but only if the old data is still in place.

https://github.com/opnsense/core/commit/f5efffcf94a

# opnsense-patch f5efffcf94a


Cheers,
Franco

I can upgrade one more of my routers from 23.1.11 to 23.7 to verify the patch. But what sequence of actions/commands do you recommend?

Upgrade, apply patch, run migration script. Reboot if migration went ok.


Cheers,
Franco

Worked like a charm!
Thank you

root@reserv2:~ # /usr/local/opnsense/mvc/script/run_migrations.php
Migrated OPNsense\Unbound\Unbound from 1.0.4 to 1.0.6

Ok great, we will have to update the upgrade path to 23.7.1 once it is out but that's not a big deal.

Thanks for the details and testing.


Cheers,
Franco

I had a similar issue where Unbound failed to start after upgrade to 23.7.

I logged in using the IP address and found that Enable Unbound was unchecked. I checked that but it still failed to start. I found this thread and checked the active_interface in /conf/config.xml and noticed that there was an entry for ovpns1 but I had already deleted that interface as I switched from OpenVPN to Wireguard.

I was still logged into the UI via the IP address so I went to Unbound --> General and manually selected all the interfaces except Loopback under Network Interfaces. I no longer see an "All (recommended) option in that list for some reason. Saved the settings and then restarted Unbound and now I have DNS resolution again.

However, when I run_migrations via SSH, I still get the failure for Unbound Migration*** OPNsense\Unbound\Unbound Migration failed, check log for details
Not sure how I can upgrade again, because running upgrade indicates that there are no updates available. I also ran an update from console which also indicated that all packages are up to date.

I will reboot once more and see if Unbound restarts automatically on boot without any issues.

EDIT : Subsequent reboots have kept everything working, however the run_migrations.php script still indicates that Unbound Migration failed, but updates don't bring in any new packages.


Just posting in this thread because I had an issue when I upgraded from 22.11 to 23.7

Unbound would start and be running, but it wasn't able to talk to my upstream dns server and get/poll results. Not until:

-> Services: Unbound DNS: General

Network Interface: LAN <-- removed

-> Network Interface: All (Recommended)

Prior to this, the service would run and had no issues until I upgraded to 23.7