Cacti / plugin_weathermap

Weathermap for Cacti 1.x
MIT License
80 stars 25 forks source link

Weathermap crash when Boost enabled #129

Closed sgvfr closed 5 months ago

sgvfr commented 10 months ago

this is new on my long-term develop installation, but does not appear to happen on my fresh installation (i'll move some devices and weathermaps over to that one and test also)

2023-11-24 13:26:11 - PHP ERROR Backtrace: (CactiShutdownHandler())
2023-11-24 13:26:11 - ERROR PHP ERROR in Plugin 'weathermap': Uncaught Error: Found unconstructed IntlDateFormatter in /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php:1911 Stack trace: 
#0 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(1911): IntlDateFormatter->format() 
#1 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(2007): WeatherMap->{closure}() 
#2 [internal function]: WeatherMap->{closure}() 
#3 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(2009): preg_replace_callback() 
#4 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(2017): WeatherMap->strftime() 
#5 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(3609): WeatherMap->DrawTimestamp() 
#6 /var/www/html/cacti/plugins/weathermap/lib/poller-common.php(442): WeatherMap->DrawMap() 
#7 /var/www/html/cacti/plugins/weathermap/setup.php(1169): weathermap_run_maps() 
#8 /var/www/html/cacti/lib/plugins.php(236): weathermap_poller_bottom() 
#9 /var/www/html/cacti/lib/plugins.php(90): api_plugin_run_plugin_hook() 
#10 /var/www/html/cacti/poller.php(936): api_plugin_hook() 
#11 {main} thrown in file: /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php on line: 1911

all develop code, up-to-date with lastest pulls.

Disabing "Enable On-demand RRD Updating" eliminates the crash

TheWitness commented 10 months ago

It's a map problem. Disable the maps one at a time until the error goes away, and then upload the map config or send it along in an email.

sgvfr commented 10 months ago

super strange.. every map, including the simple.conf causes the crash with boost enabled. no errors on any map with it disabled tho.

# Automatically generated by php-weathermap v0.98dev

FONTDEFINE 100 docs/example/Vera.ttf 10

BACKGROUND images/background1_950x625_197.jpg
WIDTH 1024
HEIGHT 768
HTMLSTYLE overlib
KEYFONT 100
TITLE Simple Map
TIMEPOS 746 17 Created: %b %d %Y %H:%M:%S

KEYPOS DEFAULT 67 35 Traffic Load
KEYTEXTCOLOR 0 0 0
KEYOUTLINECOLOR 0 0 0
KEYBGCOLOR 255 255 255
BGCOLOR 255 255 255
TITLECOLOR 0 0 0
TIMECOLOR 0 0 0
SCALE DEFAULT 0    0    192 192 192  
SCALE DEFAULT 0    1    255 255 255  
SCALE DEFAULT 1    10   140   0 255  
SCALE DEFAULT 10   25    32  32 255  
SCALE DEFAULT 25   40     0 192 255  
SCALE DEFAULT 40   55     0 240   0  
SCALE DEFAULT 55   70   240 240   0  
SCALE DEFAULT 70   85   255 192   0  
SCALE DEFAULT 85   100  255   0   0  

SET nowarn_clipping 1

# End of global section

# TEMPLATE-only NODEs:
NODE DEFAULT
    LABELFONT 100
    MAXVALUE 100

# TEMPLATE-only LINKs:
LINK DEFAULT
    WIDTH 5
    BWFONT 100
    COMMENTFONT 100
    BWLABEL bits
    BANDWIDTH 1M

# regular NODEs:
NODE node1
    LABEL Node 1
    POSITION 649 242

NODE node2
    LABEL Node 2
    POSITION 258 265

NODE node3
    LABEL Node 3
    POSITION 502 69

# regular LINKs:
LINK node1-node2
    TARGET static:10M:20M
    NODES node1 node2

LINK node2-node3
    NODES node2 node3
    BANDWIDTH 2M

# That's All Folks!
TheWitness commented 10 months ago

It's the TIMEPOS tag. What's your php version. PHP group deprecated and removed this to my disagreement. We've taken a wrapper, but maybe it has some bugs.

https://www.php.net/manual/en/function.strftime

TheWitness commented 10 months ago

Oh wait, crashes with boost enabled. I'll have to check that.

sgvfr commented 10 months ago

PHP 8.1, I actually removed the TIMEPOS tag completely and it still crashed, but only with boost enabled.

TheWitness commented 10 months ago

I made an update here. This might require PHP8.2+. If you are not on 8.2, upgrade.

3f015b24560e793c803edf0c9c8aaa5ae8862c8f

sgvfr commented 10 months ago

Soon as I'm back from Mexico I'll try :)

TheWitness commented 6 months ago

@sgvfr I've made a change in hopes that this fixes it. Please retest.

sgvfr commented 6 months ago

sorry.. no luck here.

2024-03-25 08:30:32 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'weathermap' 2024-03-25 08:30:32 - PHP ERROR Backtrace: (CactiShutdownHandler()) 2024-03-25 08:30:32 - ERROR PHP ERROR in Plugin 'weathermap': Uncaught Error: Call to undefined function plugin_weathermap_numeric_version() in /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php:713 Stack trace: #0 /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php(350): weathermap_versionbox() #1 {main} thrown in file: /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php on line: 713

sgvfr commented 6 months ago

update.. can't re-enable weathermap plugin any longer. every attempt results in a crash and disable.

2024-03-25 08:32:16 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'weathermap'
2024-03-25 08:32:16 - PHP ERROR Backtrace: (CactiShutdownHandler())
2024-03-25 08:32:16 - ERROR PHP ERROR in Plugin 'weathermap': Uncaught Error: Call to undefined function plugin_weathermap_numeric_version() in /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php:713 Stack trace: #0 /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php(350): weathermap_versionbox() #1 {main} thrown in file: /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php on line: 713
2024-03-25 08:32:16 - SYSTEM DSSTATS STATS: Time:0.39 Type:HOURLY
2024-03-25 08:32:16 - SYSTEM SYSLOG STATS: Time:0.47 Deletes:0 Incoming:6 Removes:0 XFers:0 Alerts:3 Alarms:0 Reports:0
2024-03-25 08:32:16 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'weathermap'
2024-03-25 08:32:16 - SYSTEM MAINT STATS: Time:0.03
2024-03-25 08:32:16 - PHP ERROR Backtrace: (CactiShutdownHandler())
2024-03-25 08:32:16 - ERROR PHP ERROR in Plugin 'weathermap': Uncaught Error: Found unconstructed IntlDateFormatter in /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php:1911 Stack trace: #0 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(1911): IntlDateFormatter->format() #1 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(2007): WeatherMap->{closure}() #2 [internal function]: WeatherMap->{closure}() #3 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(2009): preg_replace_callback() #4 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(2017): WeatherMap->strftime() #5 /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php(3609): WeatherMap->DrawTimestamp() #6 /var/www/html/cacti/plugins/weathermap/lib/poller-common.php(442): WeatherMap->DrawMap() #7 /var/www/html/cacti/plugins/weathermap/setup.php(1169): weathermap_run_maps() #8 /var/www/html/cacti/lib/plugins.php(236): weathermap_poller_bottom() #9 /var/www/html/cacti/lib/plugins.php(90): api_plugin_run_plugin_hook() #10 /var/www/html/cacti/poller.php(936): api_plugin_hook() #11 {main} thrown in file: /var/www/html/cacti/plugins/weathermap/lib/WeatherMap.class.php on line: 1911
2024-03-25 08:32:15 - SYSTEM STATS: Time:15.4605 Method:spine Processes:2 Threads:2 Hosts:144 HostsPerProcess:72 DataSources:1507 RRDsProcessed:0
2024-03-25 08:32:03 - MAILER INFO: Mail successfully sent via PHP Mail() Function from 'cacti <nms@here.com>', to 'Administrator <me@there.com>', cc '', bcc '', and took 0.86 seconds, Subject 'Cacti System Warning'
2024-03-25 08:32:02 - CMDPHP ERRORS DETECTED - DISABLING PLUGIN 'weathermap'
2024-03-25 08:32:02 - PHP ERROR Backtrace: (CactiShutdownHandler())
2024-03-25 08:32:02 - ERROR PHP ERROR in Plugin 'weathermap': Uncaught Error: Call to undefined function plugin_weathermap_numeric_version() in /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php:713 Stack trace: #0 /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php(350): weathermap_versionbox() #1 {main} thrown in file: /var/www/html/cacti/plugins/weathermap/weathermap-cacti-plugin.php on line: 713

update: removed with rm -rf.. git clone and reinstall. only enabled the simple conf and still crashes with boot enabled. all plugins updated to the latest devel pulls

TheWitness commented 6 months ago

You need to install php-intl and restart apache and php-fpm.