2.7.0.a.20221206.0600: PHP ERROR File: /etc/inc/util.inc, Line: 220, Message: Uncaught TypeError: flock()
-
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.
-
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);
-
I’ve worked out that this is being caused by the Pfsense community addon for Home Assistant here:
https://github.com/travisghansen/hass-pfsenseOnce I disabled that integration in home assistant, the errors stopped in home assistant.
I’ll raise an issue over on their GitHub project.
-
I have raised the following issue:
https://github.com/travisghansen/hass-pfsense/issues/123