MySQL error: Warning: Invalid argument supplied for foreach

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
randybnl
Posts: 11
Joined: Fri Feb 04, 2011 2:00 am

MySQL error: Warning: Invalid argument supplied for foreach

Post by randybnl »

Hi guys,

Yesterday I installed the whole Cacti package. Also apache, PHP and stuff. Cacti is working but the tabs Monitor and Weathermap are acting strange. When I open there's a error its showed in the attachment. And also if I click another link the link is changing from http://localhost/cacti/plugins/weatherm ... plugin.php to http://localhost/cacti/plugins/weatherm ... plugin.php.

Does anybody know what this could be?
Attachments
error1.JPG
error1.JPG (142.59 KiB) Viewed 8512 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by Howie »

Install 0.97a instead - there are plenty of bugfixes in that 'a'.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
randybnl
Posts: 11
Joined: Fri Feb 04, 2011 2:00 am

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by randybnl »

Howie wrote:Install 0.97a instead - there are plenty of bugfixes in that 'a'.
Did tried it, but it won't work. Could it be something with Linked-Tables Infrastructure?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by Howie »

Did you set url_path in global.php? Does it end with a / ?
I noticed that all your tabs are borken - that's usually a sign that url_path is wrong. The links growing makes me think that, too.

There might be something else, to cause the foreach() error, but I think that might be part of it.
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
randybnl
Posts: 11
Joined: Fri Feb 04, 2011 2:00 am

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by randybnl »

Solved the broken links but still MySQL errors.
Attachments
errror2.JPG
errror2.JPG (152.83 KiB) Viewed 8498 times
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by Howie »

I don't see any MySQL error - please could you post that error message?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
randybnl
Posts: 11
Joined: Fri Feb 04, 2011 2:00 am

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by randybnl »

Howie wrote:I don't see any MySQL error - please could you post that error message?
Sure..


( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\cacti\plugins\weathermap\weathermap-cacti-plugin.php on line 824
Call Stack
# Time Memory Function Location
1 0.0031 621080 {main}( ) ..\weathermap-cacti-plugin.php:0
2 0.1132 7323824 weathermap_get_valid_tabs( ) ..\weathermap-cacti-plugin.php:260

Network Weathermaps automatically cycle between full-size maps)

Click on thumbnails for a full view (or you can automatically cycle between full-size maps)

( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\cacti\plugins\weathermap\weathermap-cacti-plugin.php on line 824
Call Stack
# Time Memory Function Location
1 0.0031 621080 {main}( ) ..\weathermap-cacti-plugin.php:0
2 0.1141 7323480 weathermap_thumbview( ) ..\weathermap-cacti-plugin.php:269
3 0.1158 7324560 weathermap_tabs( ) ..\weathermap-cacti-plugin.php:419
4 0.1158 7324560 weathermap_get_valid_tabs( ) ..\weathermap-cacti-plugin.php:838
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by Howie »

(that's not a SQL error)

Does the weathermap_maps table exist in the database? Do any weathermap_* tables exist in the database?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
randybnl
Posts: 11
Joined: Fri Feb 04, 2011 2:00 am

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by randybnl »

Uhm... no but i thought i added them. :)

It's this, right?

CREATE TABLE weathermap_maps (
id int(11) NOT NULL auto_increment,
sortorder int(11) NOT NULL default 0,
group_id int(11) NOT NULL default 1,
active set('on','off') NOT NULL default 'on',
configfile text NOT NULL,
imagefile text NOT NULL,
htmlfile text NOT NULL,
titlecache text NOT NULL,
filehash varchar (40) NOT NULL default '',
warncount int(11) NOT NULL default 0,
config text NOT NULL,
thumb_width int(11) NOT NULL default 0,
thumb_height int(11) NOT NULL default 0,
schedule varchar(32) NOT NULL default '*',
archiving set('on','off') NOT NULL default 'off',
PRIMARY KEY (id)
);

Could you please give me the right code?
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by Howie »

You shouldn't need to add anything - the plugin is supposed to create it's own tables.

So... did you import the pa.sql when you installed the plugin architecture?
Weathermap 0.98a is out! & QuickTree 1.0. Superlinks is over there now (and built-in to Cacti 1.x).
Some Other Cacti tweaks, including strip-graphs, icons and snmp/netflow stuff.
(Let me know if you have UK DevOps or Network Ops opportunities, too!)
randybnl
Posts: 11
Joined: Fri Feb 04, 2011 2:00 am

Re: MySQL error: Warning: Invalid argument supplied for fore

Post by randybnl »

Howie wrote:You shouldn't need to add anything - the plugin is supposed to create it's own tables.

So... did you import the pa.sql when you installed the plugin architecture?
Yes, I did. But know I'm adding the tables manually and know its working, I think :wink:

I added auth, data, groups, maps, setting. With titles ofc :P
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests