1.3.5 RC5 + Ubuntu 16.04 : FOGPingHosts.service : PHP Fatal error
-
Server
- FOG Version: 1.3.5 RC5
- OS: Ubuntu 16.04
Client
- Service Version:
- OS:
Description
FOGPingHosts.service : PHP Fatal error: Uncaught Error: Cannot unset string offsets in /var/www/fog/lib/service/pinghosts.class.php:184
● FOGPingHosts.service - FOGPingHosts Loaded: loaded (/lib/systemd/system/FOGPingHosts.service; enabled; vendor preset: enabled) Active: active (running) since mar. 2017-02-14 09:16:15 CET; 4min 45s ago Main PID: 1586 (FOGPingHosts) Tasks: 2 Memory: 9.0M CPU: 230ms CGroup: /system.slice/FOGPingHosts.service └─1586 /usr/bin/php -q /opt/fog/service/FOGPingHosts/FOGPingHosts & févr. 14 09:16:15 fog-test systemd[1]: Started FOGPingHosts. févr. 14 09:16:18 fog-test FOGPingHosts[1586]: PHP Warning: array_key_exists() expects parameter 2 to be array, string given in /var/www/fog/lib/service/pinghosts.class.php on line 172 févr. 14 09:16:18 fog-test FOGPingHosts[1586]: PHP Fatal error: Uncaught Error: Cannot unset string offsets in /var/www/fog/lib/service/pinghosts.class.php:184 févr. 14 09:16:18 fog-test FOGPingHosts[1586]: Stack trace: févr. 14 09:16:18 fog-test FOGPingHosts[1586]: #0 /var/www/fog/lib/service/pinghosts.class.php(207): PingHosts->_commonOutput() févr. 14 09:16:18 fog-test FOGPingHosts[1586]: #1 /opt/fog/service/FOGPingHosts/FOGPingHosts(34): PingHosts->serviceRun() févr. 14 09:16:18 fog-test FOGPingHosts[1586]: #2 {main} févr. 14 09:16:18 fog-test FOGPingHosts[1586]: thrown in /var/www/fog/lib/service/pinghosts.class.php on line 184```
-
Can you add your pinghosts.class.php file?
I ask this, because the methods being called to produce the variable that the array_key_exists will always return an array, and this error should not even be possible.
-
-
@FredG I’ve added more implicit checking to the working branch to prevent this type of error.