• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

flock() error after upgrading

Scheduled Pinned Locked Moved Plus 23.01 Development Snapshots (Retired)
49 Posts 8 Posters 7.0k Views
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.
  • S
    stephenw10 Netgate Administrator
    last edited by Feb 6, 2023, 2:46 PM

    I note that code saw updates as recently as today. Are you running the current version?

    B 1 Reply Last reply Feb 6, 2023, 5:51 PM Reply Quote 0
    • J
      jimp Rebel Alliance Developer Netgate
      last edited by Feb 6, 2023, 4:19 PM

      Anyone hitting this, try installing the System Patches package and then create an entry for 053f60e56d09ba711af245c7f0ce6a06673ccc89 to apply the fix.

      Or apply this diff/change by hand:

      diff --git a/src/etc/inc/util.inc b/src/etc/inc/util.inc
      index f838f6b540..2636fb4aec 100644
      --- a/src/etc/inc/util.inc
      +++ b/src/etc/inc/util.inc
      @@ -169,12 +169,13 @@ function try_lock($lock, $timeout = 5) {
       }
       
       /* unlock configuration file */
      -function unlock($cfglckkey = 0) {
      -	if (!is_null($cfglckkey)) {
      -		@flock($cfglckkey, LOCK_UN);
      -		@fclose($cfglckkey);
      -	}
      -	return;
      +function unlock($cfglckkey = 0)
      +{
      +	if (!is_resource($cfglckkey))
      +		return;
      +
      +	flock($cfglckkey, LOCK_UN);
      +	fclose($cfglckkey);
       }
       
       /* unlock forcefully configuration file */
      

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      M 1 Reply Last reply Feb 6, 2023, 5:28 PM Reply Quote 2
      • M
        Maff @jimp
        last edited by Feb 6, 2023, 5:28 PM

        @jimp

        Thanks for looking further into this, needed a break from messing around, will test this later and I completely forgot about the home assistant project I was looking into, will test this soon as I can

        1 Reply Last reply Reply Quote 0
        • B
          blathierry @stephenw10
          last edited by Feb 6, 2023, 5:51 PM

          @stephenw10 Yeah, newest version still does it sadly. I updated both of them. I disabled the home assistant integration for now.. I hope the maintainer will fix it soon, it's very unexpected.

          1 Reply Last reply Reply Quote 0
          • S
            stephenw10 Netgate Administrator
            last edited by Feb 6, 2023, 6:06 PM

            Try the diff above. What the HA integration is doing should work with that. They are just hitting a code path that pfSense never normally does. It isn't necessarily wrong, something that needs updating.

            1 Reply Last reply Reply Quote 1
            • J
              jimp Rebel Alliance Developer Netgate
              last edited by Feb 7, 2023, 12:47 AM

              I spun up a Home Assistant VM, setup HACS and added the pfSense integration. Pointed it at a 23.01 install and immediately saw the errors in question. Applied the lock patch above and haven't seen a single error since.

              Looks good to me. It should be in the next build.

              Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

              Need help fast? Netgate Global Support!

              Do not Chat/PM for help!

              B 1 Reply Last reply Feb 8, 2023, 1:57 AM Reply Quote 2
              • S
                stephenw10 Netgate Administrator
                last edited by Feb 7, 2023, 12:54 AM

                Nice. 😁

                1 Reply Last reply Reply Quote 0
                • M
                  Maff
                  last edited by Feb 7, 2023, 10:54 PM

                  Posting this message on the RC build and no error spam, thank you again for looking into this

                  Home assistant integration currently disabled but not super important so will check out the fix soon

                  1 Reply Last reply Reply Quote 0
                  • B
                    blathierry @jimp
                    last edited by Feb 8, 2023, 1:57 AM

                    @jimp I upgraded pfSense to 23.01.r.20230207.0600 and enabled the integration in Home Assistant and it completely works, no errors at all anymore. Thanks a lot for looking into this and fixing it! I guess we can close this issue now :).

                    1 Reply Last reply Reply Quote 3
                    • J jimp referenced this topic on Feb 10, 2023, 2:19 PM
                    • S stephenw10 referenced this topic on Feb 18, 2023, 2:27 AM
                    • S stephenw10 referenced this topic on Feb 18, 2023, 2:27 AM
                    49 out of 49
                    • First post
                      49/49
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                      This community forum collects and processes your personal information.
                      consent.not_received