WeatherMap editor and php 8.1 : incompatibility?

ive upgraded php to 8.2.0 and now the editor works good and the buttons are responsive, but the maps still dont update

bash-4.2$ ./validate.php

Component Version
LibreNMS 22.9.0-1-gb993f38
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP 8.2.0RC2
Python 3.6.8
Database MariaDB 10.5.17-MariaDB
RRDTool 1.4.8
SNMP 5.7.2

====================================

[OK] Composer Version: 2.4.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service not detected
[OK] Locks are functional
[OK] Python poller wrapper is polling
[OK] Redis is unavailable
[OK] rrdtool version ok
[OK] Connected to rrdcached
bash-4.2$

could it be a permission problem? i tried all the known methods here
im running centos7

[root@librenms-prod networking]# cd /opt/librenms/html/plugins/Weathermap/
[root@librenms-prod Weathermap]# ls -l
total 376
-rwxr-xr-x. 1 librenms librenms 38807 Sep 23 07:53 CHANGES
-rw-r–r–. 1 librenms librenms 1631 Sep 23 07:53 check-gdbug.php
-rwxr-xr-x. 1 librenms librenms 12829 Sep 23 07:53 check.php
-rw-r–r–. 1 librenms librenms 821 Sep 23 15:14 config.inc.php
drwxrwxr-x. 2 librenms librenms 4096 Sep 23 07:53 configs
-rw-r–r–. 1 librenms librenms 18011 Oct 2 2018 COPYING
-rwxr-xr-x. 1 librenms librenms 14883 Sep 23 07:53 data-pick.php
-rw-r–r–. 1 librenms librenms 940 Oct 2 2018 defaults.inc.php
drwxr-xr-x. 10 librenms librenms 182 Sep 23 07:53 docs
drwxr-xr-x. 2 librenms librenms 23 Sep 23 07:53 editcache
-rwxr-xr-x. 1 librenms librenms 51131 Sep 23 07:53 editor.php
drwxr-xr-x. 2 librenms librenms 4096 Sep 23 07:53 editor-resources
drwxrwxrwx. 2 librenms librenms 8192 Sep 23 07:53 images
-rw-r–r–. 1 librenms librenms 59 Sep 23 07:53 index.php
-rw-r–r–. 1 librenms librenms 2038 Sep 23 07:53 INSTALL.md
drwxr-xr-x. 5 librenms librenms 4096 Sep 23 07:53 lib
drwxr-xr-x. 12 librenms librenms 4096 Sep 23 15:12 LibreNMS-Weathermap
-rw-r–r–. 1 librenms librenms 1091 Sep 23 07:53 LICENSE
-rwxr-xr-x. 1 librenms librenms 4991 Sep 23 15:14 map-poller.php
drwxr-xr-x. 2 librenms librenms 4096 Sep 23 07:53 output
-rw-r–r–. 1 librenms librenms 49243 Sep 23 07:53 overlib.js
-rw-r–r–. 1 librenms librenms 50734 Oct 5 2018 overlib.js.back
drwxr-xr-x. 2 librenms librenms 4096 Sep 23 07:53 random-bits
-rw-r–r–. 1 librenms librenms 1975 Sep 23 07:53 README.md
-rw-r–r–. 1 librenms librenms 18811 Sep 23 07:53 TODO
-rw-r–r–. 1 librenms librenms 1882 Sep 23 07:53 TODO-for-0.98.md
drwxr-xr-x. 4 librenms librenms 90 Sep 23 07:53 vendor
drwxr-xr-x. 12 librenms librenms 4096 Sep 23 13:57 Weathermap
-rw-r–r–. 1 librenms librenms 1309 Oct 2 2018 Weathermap.inc.php
-rwxr-xr-x. 1 librenms librenms 10080 Sep 23 07:53 weathermap.php
-rw-r–r–. 1 librenms librenms 1143 May 30 2019 Weathermap.php
-rw-rw-r–. 1 librenms librenms 3184 Jan 5 2022 weathermap.png
[root@librenms-prod Weathermap]#

I’m in the same position as axsis_leet but on php8.1 - basically I can open the editor but nothing happens when click the buttons, also the maps don’t update

./validate.php

Component Version
LibreNMS 22.9.0-14-gf60b6788d
DB Schema 2022_09_03_091314_update_ports_adsl_table_with_defaults (246)
PHP 8.1.10
Python 3.8.10
Database MariaDB 10.3.34-MariaDB-0ubuntu0.20.04.1
RRDTool 1.7.2
SNMP 5.8

====================================

[OK] Composer Version: 2.4.2
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database Schema is current
[OK] SQL Server meets minimum requirements
[OK] lower_case_table_names is enabled
[OK] MySQL engine is optimal
[OK]
[OK] Database schema correct
[OK] MySQl and PHP time match
[OK] Active pollers found
[OK] Dispatcher Service is enabled
[OK] Locks are functional
[OK] Python wrapper cron entry is not present
[OK] Redis is unavailable
[OK] rrd_dir is writable
[OK] rrdtool version ok

There’s my validate.php. Am running Ubuntu 20.04 LTS all was fine up until the upgrade to php8.1. Any help on this would be greatly appreciated. Also first time poster so apologies if formatting is incorrect etc. and let me know if you need more information.

Also I’m running nginx with this install.

Hi,

I had the same problem and then I discovered that the error is associated with the type of data (BWLABEL ) presented in the links, if you selected BWLABEL bits; it does not present the editor, but if you go to the code and comment or remove it change the default (percentage) you will already have the editor back, after editing back to bit, I’ve been doing this since updating php.

/opt/librenms/html/plugins/Weathermap/configs/<mapname.config>

TEMPLATE-only LINKs:

LINK DEFAULT
WIDTH 5
BWFONT 1
COMMENTFONT 100
BWLABEL bits

1 Like

Hi I am also having issue.

I pulled from master. Chown all files to librenms. Fixed directories executable bit. Added php to cron job for map-poller.php script.

Editor works ok. But maps are without link usage values. I guess the issue is in

ERROR: realpath(XXXX.oob.XXX.local/port-id1106.rrd): No such file or directory

Hate to admit this but it turns out my initial issue where none of the button working in the editor is a browser issue - it doesn’t work in Microsoft Edge (surprise surprise!)

I then had another issue where it wasn’t updating I had to modify the cron job for the map-poller.php execution to the following:

*/5 * * * * librenms php /opt/librenms/html/plugins/Weathermap/map-poller.php >> /dev/null 2>&1

Hopefully some of you other guys get your issues fixed!

1 Like

HI,

I did the exact same.

But my maps have no data.

Do your maps show link utilization?

If I run the map-poller from CLI I see among other ERROR: realpath(172.16.56.1/port-id14480.rrd): No such file or directory.

Hey,

Yeah all my maps are showing utilization fine I just had the issue with them not uodating also I dont get that error when I run the map-poller.php manually.

Sorry I cant help further.

I’m also experiencing the same issue and have not been able to solve it yet.

So I was poking around some more this morning in relation to the maps not showing any link data. If I comment out the $rrdcached in the /opt/librenms/config.php after about 15 minutes my map will return to normal.

I suspect there is a path issue between the $rrdcached or possibly a permissions issue? but there is nothing related in the installation/configuration notes for Weathermap that pertains to rrdcached.

1 Like

Same effect on my site. Thank you.

Mine is throwing the following error when I try to access the editor:

{
“message”: “Attempt to assign property “configline” on null”,
“exception”: “Error”,
“file”: “/opt/librenms/html/plugins/Weathermap/lib/Weathermap.class.php”,
“line”: 1840,
“trace”: [
{
“file”: “/opt/librenms/html/plugins/Weathermap/editor.php”,
“line”: 848,
“function”: “ReadConfig”,
“class”: “WeatherMap”,
“type”: “->”
}
]
}

I have the same issue with the path not working, the relative path ./devicename/port.rrd gives a not found error. I have not tried commenting out the $config[‘rrdcached’] but i am running in a distributed rrd cache so i wouldnt want to comment that out unless this was no longer controlled by the config file.

I seemed to have repaired my maps by adding the Global setting to all the map config files:
SET rrd_default_path "/opt/librenms/rrd/"

you can do something like

for i in `ls *.conf`
do
sed -i '/^# End of global section/i SET rrd_default_path "/opt/librenms/rrd/"' $i
done

or if you want to check it over rather than in place edit

for i in `ls *.conf`
do
sed '/^# End of global section/i SET rrd_default_path "/opt/librenms/rrd/"' > $i.new
done
3 Likes

That fixed it for me! (At least apparently, as I’m getting numbers now!)

Thanks

Unfortunately, this did not fix my Weathermap editor. I’m still getting the same error I posted above.

This (git pull in the Weathermap directory) did it for me; had to su to the librenms account first but then that fixed the error from the editor… but now my graphs are spitting out 0s.

I’m getting a bunch of errors from the map-poller.php like:

ERROR: realpath(foo-rtr01.mgmt.example.net/port-id107.rrd): No such file or directory
WARNING: configs//default.conf: RRD ReadData: At least one of your DS names (INOCTETS and OUTOCTETS) were not found, even though there was a valid data line. Maybe they ar
e wrong? Valid DS names in this file are:  [WMRRD06]
WARNING: configs//default.conf: ReadData: LINK foo-rtr01_to_dc01-core01, target: ./foo-rtr01.mgmt.example.net/port-id107.rrd:INOCTETS:OUTOCTETS on config line 176 of co
nfigs//default.conf had no valid data, according to WeatherMapDataSource_rrd
ERROR: realpath(quux-rtr01.mgmt.example.net/port-id121.rrd): No such file or directory
WARNING: configs//default.conf: RRD ReadData: At least one of your DS names (INOCTETS and OUTOCTETS) were not found, even though there was a valid data line. Maybe they ar
e wrong? Valid DS names in this file are:  [WMRRD06]
WARNING: configs//default.conf: ReadData: LINK quux-rtr01_to_dc01-core01, target: ./quux-rtr01.mgmt.example.net/port-id121.rrd:INOCTETS:OUTOCTETS on config line 1
84 of configs//default.conf had no valid data, according to WeatherMapDataSource_rrd
ERROR: realpath(baz-rtr01.mgmt.example.net/port-id207.rrd): No such file or directory
WARNING: configs//default.conf: RRD ReadData: At least one of your DS names (INOCTETS and OUTOCTETS) were not found, even though there was a valid data line. Maybe they ar
e wrong? Valid DS names in this file are:  [WMRRD06]
WARNING: configs//default.conf: ReadData: LINK baz-rtr01_to_dc01-core01, target: ./baz-rtr01.mgmt.example.net/port-id207.rrd:INOCTETS:OUTOCTETS on confi
g line 192 of configs//default.conf had no valid data, according to WeatherMapDataSource_rrd
ERROR: realpath(rivendell-rtr01.mgmt.example.net/port-id238.rrd): No such file or directory
WARNING: configs//default.conf: RRD ReadData: At least one of your DS names (INOCTETS and OUTOCTETS) were not found, even though there was a valid data line. Maybe they ar
e wrong? Valid DS names in this file are:  [WMRRD06]
WARNING: configs//default.conf: ReadData: LINK rivendell-rtr01_to_dc01-core01, target: ./rivendell-rtr01.mgmt.example.net/port-id238.rrd:INOCTETS:OUTOCTETS on config li
ne 200 of configs//default.conf had no valid data, according to WeatherMapDataSource_rrd
ERROR: realpath(quark-twr-rtr01.mgmt.example.net/port-id167.rrd): No such file or directory
WARNING: configs//default.conf: RRD ReadData: At least one of your DS names (INOCTETS and OUTOCTETS) were not found, even though there was a valid data line. Maybe they ar
e wrong? Valid DS names in this file are:  [WMRRD06]
WARNING: configs//default.conf: ReadData: LINK quark-twr-rtr01_to_dc01-core01, target: ./quark-twr-rtr01.mgmt.example.net/port-id167.rrd:INOCTETS:OUTOCTETS on config
line 208 of configs//default.conf had no valid data, according to WeatherMapDataSource_rrd
ERROR: realpath(ward-twr-rtr01.mgmt.example.net/port-id285.rrd): No such file or directory
WARNING: configs//default.conf: RRD ReadData: At least one of your DS names (INOCTETS and OUTOCTETS) were not found, even though there was a valid data line. Maybe they ar
e wrong? Valid DS names in this file are:  [WMRRD06]
WARNING: configs//default.conf: ReadData: LINK ward-twr-rtr01_to_dc01-core01, target: ./ward-twr-rtr01.mgmt.example.net/port-id285.rrd:INOCTETS:OUTOCTETS on config line
 216 of configs//default.conf had no valid data, according to WeatherMapDataSource_rrd
ERROR: realpath(pine-rtr01.mgmt.example.net/port-id2305.rrd): No such file or directory
WARNING: configs//default.conf: RRD ReadData: At least one of your DS names (INOCTETS and OUTOCTETS) were not found, even though there was a valid data line. Maybe they ar
e wrong? Valid DS names in this file are:  [WMRRD06]
WARNING: configs//default.conf: ReadData: LINK pine-rtr01_to_rivendell-rtr01, target: ./pine-rtr01.mgmt.example.net/port-id2305.rrd:INOCTETS:OUTOCTETS on config line
225 of configs//default.conf had no valid data, according to WeatherMapDataSource_rrd
ERROR: realpath(pine-rtr01.mgmt.example.net/port-id2393.rrd): No such file or directory

All of the RRD files are untouched from where they were before though… I was on Ubuntu 20.04 LTS and upgraded to 22.04 LTS and that’s what started the problems here (so mainly, the PHP version change).

This little hack (editing the individual weathermap’s .conf file to set rrd_default_path) also worked to get my (single file) working again. For those concerned, it seems like you can still used the PHP/web-based editor on the file afterwards and it does not clobber that stanza.

But I’d like to figure out how to fix it elsewhere instead of requiring that line to be manually added to the file…?

This PR does seem to take care of everything as best I can tell (using a local / unix socket rrdcached and a single poller, so the RRD files are all local too).

I honestly don’t know what (if anything) rrdcached is doing here or if weathermap.php is actually talking to it in any meaningful way, though…

This fixed my Weathermap editor, all credit goes to the author of the changes:

I’ve gotten to the point where I can open the editor now. I can make changes but they never actually save. I also can’t create new config files. Seems like a permissions issue, but validate.php checks out so I’m not sure what the problem is.