Suddenly a problem with editor - Javascript / DOM (solved)

Support questions about the Network Weather Map plugin

Moderators: Developers, Moderators

Post Reply
Bazou
Posts: 28
Joined: Tue Apr 10, 2007 7:45 am
Location: Brussels/Belgium

Suddenly a problem with editor - Javascript / DOM (solved)

Post by Bazou »

Hi all,

I'm running weathermap 0.91 and all was working perfectly until Yesterday.

Yesterday I logged off my workstation and go back at home. This morning I came at work and get the joined message when I tried to use the editor.

I made absolutely no changes to my computer, and I tried to access the editor with 4 others workstations and I get the same error as well.

when I try iy with the cli I got:

Code: Select all

# php editor.php
PHP Warning:  Function registration failed - duplicate name - gd_info in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - imagearc in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - imageellipse in Unknown on line 0

[...same kind of error...]

PHP Warning:  Function registration failed - duplicate name - imagepsencodefont in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - imagepsextendfont in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - imagepsslantfont in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - imagepstext in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - imagepsbbox in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - imagetypes in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - jpeg2wbmp in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - png2wbmp in Unknown on line 0
PHP Warning:  Function registration failed - duplicate name - image2wbmp in Unknown on line 0
PHP Warning:  gd:  Unable to register functions, unable to load in Unknown on line 0
<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" media="screen" href="editor.css" />  <script src="editor.js" type="text/javascript"></script><title>PHP Weathermap Editor 0.91</title></head><body><div id="nojs" class="alert"><b>WARNING</b> - Sorry, it's partly laziness on my part, but you really need JavaScript enabled and DOM support in your browser to use this editor. It's a visual tool, so accessibility is already an issue, if it is, and from a security viewpoint, you're already running my code on your <i>server</i> so either you trust it all having read it, or you're already screwed.<P>If it's a major issue for you, please feel free to complain. It's mainly laziness as I said, and there could be a fallback (not so smooth) mode for non-javascript browsers if it was seen to be worthwhile (I would take a bit of convincing, because I don't see a benefit, personally).</div><div id="withjs"><div id="dlgStart" class="dlgProperties" ><div class="dlgTitlebar">Welcome</div><div class="dlgBody">Welcome to the PHP Weathermap 0.91 editor.<p><div style="border: 3px dashed red; background: #055; padding: 5px; font-size: 97%;"><b>NOTE:</b> This editor is not finished! There are many features of Weathermap that you will be missing out on if you choose to use the editor only.These include: curves, node offsets, font definitions, colour changing, per-node/per-link settings and image uploading. You CAN use the editor without damaging these features if you added them by hand, however.</div><p>Do you want to:<p>Create A New Map:<br><form method="GET">Named: <input type="text" name="mapname" size="20"><input name="action" type="hidden" value="newmap"><input type="submit" value="Create"></form>OR<br />Open An Existing Map (looking in /var/www/cacti/plugins/weathermap/configs):<ul class="filelist"><li><a href="?mapname=example.conf">example.conf</a> - <span class="comment">Network Overview</span></li>
<li><a href="?mapname=simple.conf">simple.conf</a> - <span class="comment"></span></li>
<li><a href="?mapname=simple.conf.save">simple.conf.save</a> - <span class="comment">(no title)</span></li>
<li><a href="?mapname=test">test</a> - <span class="comment">(no title)</span></li>
<li><a href="?mapname=test.conf">test.conf</a> - <span class="comment">(no title)</span></li>
</UL></div><div class="dlgHelp" id="start_help">PHP Weathermap 0.91 Copyright &copy; 2005-2007 Howard Jones - howie@thingy.com<br />The current version should always be <a href="http://www.network-weathermap.com/">available here</a>, along with other related software. PHP Weathermap is licensed under the GNU Public License, version 2. See COPYING for details. This distribution also includes the Overlib library by Erik Bosrup.</div></div></div></body></html>
Note: I already get this duplicate error when it worked.

Any idea what could be the cause?

Thanks,

Gilles
Attachments
warning.JPG
warning.JPG (42.48 KiB) Viewed 9716 times
Last edited by Bazou on Wed May 16, 2007 5:39 am, edited 1 time in total.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Re: Suddenly a problem with editor - Javascript / DOM

Post by Howie »

Bazou wrote:

Code: Select all

# php editor.php
PHP Warning:  Function registration failed - duplicate name - gd_info in Unknown on line 0
Note: I already get this duplicate error when it worked.

Any idea what could be the cause?
You remember when we agreed that if it worked then it was OK? Well it doesn't, so it isn't :-) It seems like PHP is trying to load the same extension twice.
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!)
Bazou
Posts: 28
Joined: Tue Apr 10, 2007 7:45 am
Location: Brussels/Belgium

Post by Bazou »

Yeah i remember :wink:

But It worked with this. Anyway, I commented the gd extension in php.ini.
There is no more these warnings but I can't still access the editor :(
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Bazou wrote:Yeah i remember :wink:

But It worked with this. Anyway, I commented the gd extension in php.ini.
There is no more these warnings but I can't still access the editor :(
If you look at check.php in the web browser, does it show that your web PHP is loading any additional config files? (this would appear just under where it tells you what PHP version you have). If it does, make sure that none of those also have the extension=gd.so in it. You need it once, and only once.
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!)
Bazou
Posts: 28
Joined: Tue Apr 10, 2007 7:45 am
Location: Brussels/Belgium

Post by Bazou »

I forget to mention that check.php return YES for all tests.

The additional files are:

Code: Select all

The php.ini file was /etc/php4/cli/php.ini
The following additional ini files were read: /etc/php4/cli/conf.d/gd.ini,
/etc/php4/cli/conf.d/mysql.ini,
/etc/php4/cli/conf.d/snmp.ini
The gd extension was in gd.ini.
So, now it's OK but it seems that it wasn't linked with the editor error.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Bazou wrote:I forget to mention that check.php return YES for all tests.
It would do. The functions do exist. The problem is that the error messages will get in the way of outputting the actual image data.
Bazou wrote: The additional files are:

Code: Select all

The php.ini file was /etc/php4/cli/php.ini
The following additional ini files were read: /etc/php4/cli/conf.d/gd.ini,
/etc/php4/cli/conf.d/mysql.ini,
/etc/php4/cli/conf.d/snmp.ini
The gd extension was in gd.ini.
So, now it's OK but it seems that it wasn't linked with the editor error.
Your web php is reading /etc/php4/cli files? That sounds strange, but OK.

What was the actual editor error then? Don't forget that if you are running 'php editor.php' from the command line, then that isn't the same PHP that would normally run the editor.
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!)
Bazou
Posts: 28
Joined: Tue Apr 10, 2007 7:45 am
Location: Brussels/Belgium

Post by Bazou »

Check.php running in apache is also alright.

The error is, when i go to the editor's URL in my browser, I can't no more access to it as it said that I need to have javascript and DOM enabled.

The fact is that they are. I didn't change any settings on my workstation since yesterday and I 'm using javascript right now (for Gmail for example :p).
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Bazou wrote:Check.php running in apache is also alright.

The error is, when i go to the editor's URL in my browser, I can't no more access to it as it said that I need to have javascript and DOM enabled.

The fact is that they are. I didn't change any settings on my workstation since yesterday and I 'm using javascript right now (for Gmail for example :p).
If you view source on the editor page, is there anything unusual (non-HTML-looking) at the top? The editor hasn't really changed in over a year... My guess would be that this is still related to the same problem. It sounds like maybe the same issue, but for the web php (which is why I said check for duplicates in the web check.php list of ini files).
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!)
Bazou
Posts: 28
Joined: Tue Apr 10, 2007 7:45 am
Location: Brussels/Belgium

Post by Bazou »

Ok, I just understanded what you mean. Apache read gd.ini too, which was created and linked during the installation of the debian gd package. So on debian there is no need to edit php.ini for both cli and apache.

Now that's OK. But it doesn't solved the problem.

On the page's source, I got LOTS of these errors lines:

Code: Select all

<b>Warning</b>:  feof(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>52</b><br />
<br />
<b>Warning</b>:  fgets(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>54</b><br />
<br />
These 2 lines are repeated infinitly.

Hope it helps.
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

Bazou wrote:Ok, I just understanded what you mean.
Sorry - that was a little complex. :)
Bazou wrote: On the page's source, I got LOTS of these errors lines:

Code: Select all

<b>Warning</b>:  feof(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>52</b><br />
<br />
<b>Warning</b>:  fgets(): supplied argument is not a valid stream resource in <b>/usr/share/cacti/site/plugins/weathermap/editor.inc.php</b> on line <b>54</b><br />
<br />
These 2 lines are repeated infinitly.
OK - that is where the editor is reading the config files in the configs/ directory to see if they have titles. Are any files in there unreadable by the webserver?
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!)
Bazou
Posts: 28
Joined: Tue Apr 10, 2007 7:45 am
Location: Brussels/Belgium

Post by Bazou »

Yes! you got it :D

There was a "simple.conf.save" created by root yesterday. I don't know how it appears here but the problem is now solved :)

thank you Howie!
User avatar
Howie
Cacti Guru User
Posts: 5508
Joined: Thu Sep 16, 2004 5:53 am
Location: United Kingdom
Contact:

Post by Howie »

I'll try and fix this in the next release. It shouldn't really bring the whole thing crashing down like that.
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!)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests