Invalid argument supplied for foreach()
phpipam open-source IP address management
Brought to you by:
myha
Hi,
i, on some occasions, get a strange error in phpipam which i sometimes can fix by restarting apache. in all subnets the ip address is displayed with an additional number attached at the last octet. additionaly i cant see the subnet overview pie-chart as well as the status in the visual subnet display.
i've updated from the latest 1.1 to 1.2 and also installed the latest bugfix.
i've already installed all package updates on linux (php, apache), checked permissions,
in apache error log i can see some php errors:
[Wed Feb 24 08:11:44.336677 2016] [:error] [pid 20238] [client :58180] PHP Warning: Invalid argument supplied for foreach() in /opt/phpipam/v1.2.1/functions/classes/class.Subnets.php on line 923, referer: http://ipam.example.com/phpipam/subnets/4/ [Wed Feb 24 08:11:44.764003 2016] [:error] [pid 20238] [client :58180] PHP Warning: Invalid argument supplied for foreach() in /opt/phpipam/v1.2.1/functions/classes/class.Subnets.php on line 899, referer: http://ipam.example.com/phpipam/subnets/4/ [Wed Feb 24 08:11:44.764094 2016] [:error] [pid 20238] [client :58180] PHP Warning: Invalid argument supplied for foreach() in /opt/phpipam/v1.2.1/app/subnets/subnet-graph.php on line 76, referer: http://ipam.example.com/phpipam/subnets/4/ [Wed Feb 24 08:11:44.775434 2016] [:error] [pid 20238] [client :58180] PHP Warning: Invalid argument supplied for foreach() in /opt/phpipam/v1.2.1/app/subnets/addresses/print-address-table.php on line 100, referer: http://ipam.example.com/phpipam/
additionaly i can see the known base-error
[Wed Feb 24 08:24:02.562256 2016] [:error] [pid 6329] [client :58331] PHP Notice: Constant BASE already defined in /opt/phpipam/v1.2.1/config.php on line 31, referer: http://ipam.example.com/phpipam/subnets/4/33/ [Wed Feb 24 08:24:06.695976 2016] [:error] [pid 6332] [client :58335] PHP Notice: Constant BASE already defined in /opt/phpipam/v1.2.1/config.php on line 31, referer: http://ipam.example.com/phpipam/ [Wed Feb 24 08:24:08.313709 2016] [:error] [pid 6332] [client :58335] PHP Notice: Constant BASE already defined in /opt/phpipam/v1.2.1/config.php on line 31, referer: http://ipam.example.com/phpipam/subnets/4/ [Wed Feb 24 08:24:15.976202 2016] [:error] [pid 6347] [client :58339] PHP Notice: Constant BASE already defined in /opt/phpipam/v1.2.1/config.php on line 31, referer: http://ipam.example.com/phpipam/subnets/4/32/ [Wed Feb 24 08:24:17.565879 2016] [:error] [pid 6347] [client :58339] PHP Notice: Constant BASE already defined in /opt/phpipam/v1.2.1/config.php on line 31, referer: http://ipam.example.com/phpipam/subnets/7/
screenshots are attached.
Anonymous
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
After some further testing, i think that the root of this problem originates somewhere from the custom ip-address fields we added. every time we change values in one of the fields we get a different behaviour.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
So after some further testing i can now say that this actually is two problems. The number behind all that ip-addresses is coming from the state column in the database. i've changed that value to NULL now and the number isnt shown. That PHP Error still exists
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
case closed: the tags where missing -.-
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
Hello,
We have the same behavior with Nginx and 1.2 version.
Hi,
After upgrading from 1.1 to 1.2 I'm getting a similar error for Status Update check.
"
[Thu Apr 28 11:48:53 2016] [error] [client 172.31.50.11] PHP Warning: ksort() expects parameter 1 to be array, null given in /var/www/html/app/subnets/scan/subnet-update-icmp.php on line 113, referer: https://ptcx-am-p01/?page=subnets§ion=1&subnetId=12
[Thu Apr 28 11:48:53 2016] [error] [client 172.31.50.11] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/app/subnets/scan/subnet-update-icmp.php on line 127, referer: https://ptcx-am-p01/?page=subnets§ion=1&subnetId=12
"
Can you please help me on this ?
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
I can confirm that I am also seeing similar behavior after upgrading from 1.1 to 1.2
Warning: Invalid argument supplied for foreach() in /var/www/html/phpipam/app/subnets/addresses/print-address-table.php on line 100
IP addresses are showing the addition of the state as well as graphs for the subnet not displaying.