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

2.7.0.a.20221206.0600: PHP ERROR File: /etc/inc/util.inc, Line: 220, Message: Uncaught TypeError: flock()

CE 2.7.0 Development Snapshots (Retired)
1
4
626
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.
  • W
    woodsb02
    last edited by Dec 6, 2022, 10:22 PM

    I've just updated from PfSense 2.6.0 to devel snapshot 2.7.0.a.20221206.0600.

    I have email notifications enabled, and I am now getting an email every 30 seconds with the following message.

    Notifications in this message: 1
    ================================
    
    6:17:14 PHP ERROR: Type: 1, File: /etc/inc/util.inc, Line: 220, Message: Uncaught TypeError: flock(): supplied resource is not a valid stream resource in /etc/inc/util.inc:220
    Stack trace:
    #0 /etc/inc/util.inc(220): flock(Resource id #11, 3)
    #1 /usr/local/www/xmlrpc.php(990): unlock(Resource id #11)
    #2 {main}
      thrown
    

    Most things seem to be working despite this error. Any tips on how to resolve it? I might disable email notifications in the mean time, which isn't ideal.

    W 1 Reply Last reply Dec 7, 2022, 1:39 PM Reply Quote 0
    • W
      woodsb02 @woodsb02
      last edited by Dec 7, 2022, 1:39 PM

      To try and assist debugging this, please see below extracts from the files in the stack trace (with a few lines of context preceding the trouble lines):

      /etc/inc/util.inc (lines 217-220):

      /* unlock configuration file */
      function unlock($cfglckkey = 0) {
      	if (!is_null($cfglckkey)) {
      		@flock($cfglckkey, LOCK_UN);
      

      /usr/local/www/xmlrpc.php (Lines 976-990):

      
      $xmlrpclockkey = lock('xmlrpc', LOCK_EX);
      
      XML_RPC2_Backend::setBackend('php');
      $HTTP_RAW_POST_DATA = file_get_contents('php://input');
      
      $options = array(
      	'prefix' => 'pfsense.',
      	'encoding' => 'utf-8',
      	'autoDocument' => false,
      );
      
      $server = XML_RPC2_Server::create(new pfsense_xmlrpc_server(), $options);
      $server->handleCall();
      
      unlock($xmlrpclockkey);
      
      W 1 Reply Last reply Dec 8, 2022, 11:05 AM Reply Quote 0
      • W
        woodsb02 @woodsb02
        last edited by Dec 8, 2022, 11:05 AM

        I’ve worked out that this is being caused by the Pfsense community addon for Home Assistant here:
        https://github.com/travisghansen/hass-pfsense

        Once I disabled that integration in home assistant, the errors stopped in home assistant.

        I’ll raise an issue over on their GitHub project.

        W 1 Reply Last reply Dec 8, 2022, 11:15 AM Reply Quote 1
        • W
          woodsb02 @woodsb02
          last edited by woodsb02 Dec 8, 2022, 11:16 AM Dec 8, 2022, 11:15 AM

          I have raised the following issue:
          https://github.com/travisghansen/hass-pfsense/issues/123

          1 Reply Last reply Reply Quote 1
          4 out of 4
          • First post
            4/4
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.