librenms-plugins / Weathermap

MIT License
65 stars 52 forks source link

Failure with PHP 8.1 #84

Closed ciroiriarte closed 2 years ago

ciroiriarte commented 2 years ago

After updating to PHP 8.1 & Weathermap 697ac3c, Weathermap seems to still be incompatible.

From the logs:

[2022-09-06T23:37:04.865562-05:00] production.ERROR: call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method LibreNMS\Plugins\Weathermapper::menu() cannot be called statically (View: /opt/librenms/resources/views/layouts/librenmsv1.blade.php) (View: /opt/librenms/resources/views/layouts/librenmsv1.blade.php) {"userId":2,"exception":"[object] (Illuminate\\View\\ViewException(code: 0): call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method LibreNMS\\Plugins\\Weathermapper::menu() cannot be called statically (View: /opt/librenms/resources/views/layouts/librenmsv1.blade.php) (View: /opt/librenms/resources/views/layouts/librenmsv1.blade.php) at /opt/librenms/LibreNMS/Plugins.php:189) [previous exception] [object] (Illuminate\\View\\ViewException(code: 0): call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method LibreNMS\\Plugins\\Weathermapper::menu() cannot be called statically (View: /opt/librenms/resources/views/layouts/librenmsv1.blade.php) at /opt/librenms/LibreNMS/Plugins.php:189) [previous exception] [object] (TypeError(code: 0): call_user_func(): Argument #1 ($callback) must be a valid callback, non-static method LibreNMS\\Plugins\\Weathermapper::menu() cannot be called statically at /opt/librenms/LibreNMS/Plugins.php:189)"}

Current setup

`librenms@nms01:~> ./validate.php

Component Version
LibreNMS 22.8.0
DB Schema 2022_07_03_1947_add_app_data (244)
PHP 8.1.10
Python 3.6.15
Database MariaDB 10.6.8-MariaDB
RRDTool 1.7.0
SNMP 5.7.3

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

[OK] Composer Version: 2.4.1 [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 [WARN] Using database for locking, you should set CACHE_DRIVER=redis [OK] rrd_dir is writable [OK] rrdtool version ok`

ciroiriarte commented 2 years ago

Oh, god. Didn't see it was indeed Weathermapper