Menu

#394 Invalid argument supplied for foreach()

1.2
open
nobody
php (3)
9
2016-07-29
2016-02-24
Anonymous
No

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.

4 Attachments

Discussion

  • Anonymous

    Anonymous - 2016-02-24

    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.

     
  • Anonymous

    Anonymous - 2016-03-09

    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

     
  • Anonymous

    Anonymous - 2016-03-10

    case closed: the tags where missing -.-

     
  • Anonymous

    Anonymous - 2016-04-13

    Hello,

    We have the same behavior with Nginx and 1.2 version.

     
  • vasco M

    vasco M - 2016-04-28

    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&section=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&section=1&subnetId=12
    "

    Can you please help me on this ?

     
  • Anonymous

    Anonymous - 2016-07-29

    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.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.