Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    Unbound fails to restart after unbound package update

    Scheduled Pinned Locked Moved DHCP and DNS
    3 Posts 3 Posters 264 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DBMandrake
      last edited by DBMandrake

      PFSense 2.8.1 CE.

      Due to the urgent PHP security update I followed the advice from jim-p on reddit to update the php package from the command line.

      As part of that update process a few others packages including unbound were updated:

      Oct 21 19:45:50 pfSense-Home pkg[1034]: unbound upgraded: 1.23.0 -> 1.26.1

      The system was rebooted and working after the update. This morning I woke up to no internet and found unbound was not running... checking the system log I see the following has occurred after my WAN interface has changed (dynamic) IP and unbound was attempted to be restarted:

      Oct 22 03:29:58 pfSense-Home php-fpm[41145]: /rc.newwanip: The command '/usr/local/sbin/unbound -c /var/unbound/unbound.conf' returned exit code '1', the output was '[1792636198] unbound[34725:0] warning: setsockopt(..., SO_SNDBUF, ...) was not granted: No buffer space available [1792636198] unbound[34725:0] warning: so-sndbuf 4194304 was not granted. Got 57344. To fix: start with root permissions(linux) or sysctl bigger net.core.wmem_max(linux) or kern.ipc.maxsockbuf(bsd) values. or set so-sndbuf: 0 (use system value). [1792636198] unbound[34725:0] error: bind: address already in use [1792636198] unbound[34725:0] fatal error: could not open ports
      

      There is a later occurrence of the same problem in the log when the OpenVPN client had a dynamic IP change as well.

      Needless to say, this has never occurred in multiple years of operation so I'm concerned there is a regression in the behaviour of unbound in version 1.26.1.

      None of my other systems have exhibited the same issue.... yet.... but they all have static WAN IP's. However there are other scenarios that can cause check_reload_status to run and rebound to potentially be restarted.

      Due to the setup where all DNS access to the internet is funnelled through unbound (to enforce PfblockerNG etc) unbound going down effectively means the internet is down for the entire network.

      As a precaution I've added unbound to the Service Watchdog on all my systems until I can see whether this was a one off or will be a recurring problem, as all of them have had the PHP and unbound package updates applied.

      GertjanG 1 Reply Last reply
      Reply Quote 0
      • GertjanG
        Gertjan @DBMandrake
        last edited by

        @DBMandrake said in Unbound fails to restart after unbound package update:

        unbound[....] error: bind: address already in use

        This "unbound restart" error line has been shown on the forum before.
        The system (pfSense) decided, probably because of a system NIC event, to restart unbound.
        First, the unbound process is stopped.
        Then, the 'configure' procedure is called, so a new unbound config 'test' file is created, and unbound is started with this temporary test config.
        If all was well, it's stopped again, and this time, the tested config is use to start the final unbound process.
        This needed two starts.
        unbound can be somewhat slow to start if packages as pfBlockerng with many DNSBL is used. There was a great speedup when the 'python' mode was introduced.
        This issue is (imho) : the time frame in which all this happens can be hundreds of milliseconds, or even seconds.
        If, for some reason, another system event happens during this time, and unbound gets restarted while it's restarting, the second instance can find the situation where the initial start already allocated the ports (interface) used, and fail with this message.
        The final result : none of the unbound instances actually started, leaving your system with 'DNS'.

        Now entering the fun part :

        @DBMandrake said in Unbound fails to restart after unbound package update:

        added unbound to the Service Watchdog

        You've now add a third possible event where unbound can be started.
        Be aware that "Service Watchdog" is pretty dumb.
        It's gets the PID of a process, and checks if it is in the running state.
        If it isn't, it starts to process.
        It doesn't check if it is 'about to be started' by some other means, or that another restart is already in progress.
        That's why it's stated : use "Service Watchdog" only if you are a developer. Developers are 'on the system' and are following the system real time. They can see real time if a fail happens, so they can interact with it, find the reasons, and do something about it.

        I can't say I never saw this error message before on my own pfSense, I'm not sure.
        I see two solution : dig into it, and find the real core issue. It's something as a race condition, one of the most difficult bugs to find. It depends a lot how the system is set up : what functions, packages are used, how many interfaces etc.
        I concluded : I keep my pfSense as 'simple' as possible, as less software use means less changes an awkward situation is found.
        I've no proof, but keeping NIC up all the time (no matter what) by using UPS powered front end switches (same UPS as being used by pfSense itself) will have a very positive effect on your network and pfSense as no NIC events means : less process restarts.

        Btw : the unbound update (1.26.1) dated from weeks ago.
        I'm using this Auto update check, checks for updates to base system + packages and sends email alerts and tells me if something is available.

        No "help me" PM's please. Use the forum, the community will thank you.

        1 Reply Last reply
        Reply Quote 0
        • W
          wout
          last edited by wout

          Same issue here on pfSense Plus 26.07-RELEASE.

          I followed the instructions on https://www.netgate.com/blog/critical-php-security-update for the recent PHP vulnerabiltiy and noticed the unbound pkg got an upgrade next to php pkgs.

          Last Friday, I noticed a IPv4 + IPv6 WAN update:

          Oct 30 16:28:59 pfsense php-fpm[664]: NOTICE Netgate pfSense Plus package system has detected an IP change or dynamic WAN reconnection -  -> XXX - Restarting packages.
          Oct 30 16:28:59 pfsense check_reload_status[712]: Starting packages
          Oct 30 16:29:01 pfsense php-fpm[663]: NOTICE Netgate pfSense Plus package system has detected an IP change or dynamic WAN reconnection - 0.0.0.0 -> XXX - Restarting packages.
          Oct 30 16:29:01 pfsense check_reload_status[712]: Starting packages
          Oct 30 16:29:01 pfsense check_reload_status[712]: Reloading filter
          Oct 30 16:29:01 pfsense check_reload_status[712]: Reloading filter
          Oct 30 16:29:02 pfsense php-fpm[33487]: NOTICE Skipping STARTing packages process because previous/another instance is already running
          Oct 30 16:29:06 pfsense check_reload_status[712]: Reloading filter
          Oct 30 16:29:06 pfsense php-fpm[70486]: NOTICE The command '/sbin/ifconfig ix3 inet6 XXX delete' returned exit code '1', the output was 'ifconfig: ioctl (SIOCDIFADDR): Can't assign requested address' 
          Oct 30 16:54:49 pfsense kernel: sonewconn: pcb 0xfffff8002f724000 (0.0.0.0:53 (proto 6)): Listen queue overflow: 193 already in queue awaiting acceptance (1 occurrences), euid 0, rgid 0, jail 0
          Oct 30 16:56:13 pfsense kernel: sonewconn: pcb 0xfffff8002f724000 (0.0.0.0:53 (proto 6)): Listen queue overflow: 193 already in queue awaiting acceptance (1 occurrences), euid 0, rgid 0, jail 0
          Oct 30 16:58:10 pfsense kernel: sonewconn: pcb 0xfffff8002f724000 (0.0.0.0:53 (proto 6)): Listen queue overflow: 193 already in queue awaiting acceptance (1 occurrences), euid 0, rgid 0, jail 0
          Oct 30 17:00:19 pfsense kernel: sonewconn: pcb 0xfffff8002f724000 (0.0.0.0:53 (proto 6)): Listen queue overflow: 193 already in queue awaiting acceptance (2 occurrences), euid 0, rgid 0, jail 0
          Oct 30 17:01:25 pfsense kernel: sonewconn: pcb 0xfffff8002f724000 (0.0.0.0:53 (proto 6)): Listen queue overflow: 193 already in queue awaiting acceptance (25 occurrences), euid 0, rgid 0, jail 0
          

          After that, Unbound DNS stopped working.

          I see the same log message as original post, but this log message happended before as well and did not seem to cause any issue:

          Oct 30 16:28:54 pfsense php-fpm[664]: NOTICE The command '/usr/local/sbin/unbound -c /var/unbound/unbound.conf' returned exit code '1', the output was '[1793374134] unbound[35056:0] warning: setsockopt(..., SO_SNDBUF, ...) was not granted: No buffer space available [1793374134] unbound[35056:0] warning: so-sndbuf 4194304 was not granted. Got 57344. To fix: start with root permissions(linux) or sysctl bigger net.core.wmem_max(linux) or kern.ipc.maxsockbuf(bsd) values. or set so-sndbuf: 0 (use system value). [1793374134] unbound[35056:0] error: bind: address already in use [1793374134] unbound[35056:0] fatal error: could not open ports'
          

          I needed to restart to fix the issue. I am not using pfBlockerng. Never had the issue before.

          1 Reply Last reply
          Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
          Privacy Policy · Cookie Policy