Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.65k stars 406 forks source link

Plugin Management - multiple issues (i know it's being actively developed right now) #5901

Closed dallenk closed 2 weeks ago

dallenk commented 2 weeks ago

FIRST - Apologies for putting these all into one report. If you want I will split them into separate ones but I believe they are all related.
Syslog will no longer install, I'll create a one for that in the syslog issues

Describe the bug

Multiple issues with plugin management.

To Reproduce

ISSUE 1:

choosing plugins / All Loaded on Disk / Default / "Go"

2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: include_once(): Failed opening './lib/poller.php' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/cacti/plugins.php on line: 26
2024-11-07 08:51:01 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 08:51:01 - ERROR PHP WARNING: include_once(./lib/poller.php): Failed to open stream: No such file or directory in file: /var/www/html/cacti/plugins.php on line: 26

ISSUE 2:

Trying to view plugins not installed image First attempt

2024-11-07 08:49:26 - SQL Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1330]:db_fetch_assoc(), /lib/database.php[885]:db_fetch_assoc_prepared(), /lib/database.php[909]:db_execute_prepared())
2024-11-07 08:49:26 - CMDPHP ERROR: A DB Row Failed!, Error: Unknown column 'pi.last_updated' in 'field list'
2024-11-07 08:49:26 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 08:49:26 - ERROR PHP WARNING: include_once(): Failed opening './lib/poller.php' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/cacti/plugins.php on line: 26
2024-11-07 08:49:26 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 08:49:26 - ERROR PHP WARNING: include_once(./lib/poller.php): Failed to open stream: No such file or directory in file: /var/www/html/cacti/plugins.php on line: 26
2024-11-07 08:49:25 - PLUGIN UPDATED: Plugin:'maint', Tag/Release:'v1.1' Updated in 2.32 seconds.
2024-11-07 08:49:23 - PLUGIN UPDATED: Plugin:'mactrack', Tag/Release:'develop' Updated in 3.53 seconds.
2024-11-07 08:49:19 - PLUGIN UPDATED: Plugin:'mactrack', Tag/Release:'v4.8' Updated in 3.84 seconds.
2024-11-07 08:49:14 - PLUGIN UPDATED: Plugin:'intropage', Tag/Release:'develop' Updated in 3.07 seconds.
2024-11-07 08:49:11 - PLUGIN UPDATED: Plugin:'intropage', Tag/Release:'v4.0.4' Updated in 3.48 seconds.
2024-11-07 08:49:07 - PLUGIN UPDATED: Plugin:'hmib', Tag/Release:'develop' Updated in 2.46 seconds.
2024-11-07 08:49:04 - PLUGIN UPDATED: Plugin:'hmib', Tag/Release:'v3.5' Updated in 2.74 seconds.
2024-11-07 08:49:01 - PLUGIN UPDATED: Plugin:'gpsmap', Tag/Release:'develop' Updated in 2.59 seconds.
2024-11-07 08:48:58 - PLUGIN UPDATED: Plugin:'gpsmap', Tag/Release:'v2.1' Updated in 2.74 seconds.

Second Attempt

2024-11-07 08:56:59 - SQL Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1330]:db_fetch_assoc(), /lib/database.php[885]:db_fetch_assoc_prepared(), /lib/database.php[909]:db_execute_prepared())
2024-11-07 08:56:59 - CMDPHP ERROR: A DB Row Failed!, Error: Unknown column 'pi.last_updated' in 'field list'
2024-11-07 08:56:59 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 08:56:59 - ERROR PHP WARNING: include_once(): Failed opening './lib/poller.php' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/cacti/plugins.php on line: 26
2024-11-07 08:56:59 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 08:56:59 - ERROR PHP WARNING: include_once(./lib/poller.php): Failed to open stream: No such file or directory in file: /var/www/html/cacti/plugins.php on line: 26

ISSUE 3:

Clicking "Check Latest" (./lib/poller.php can't be included) <--assuming this is the issue? It does exist

2024-11-07 09:01:41 - PLUGIN UPDATED: Plugin:'npc', Tag/Release:'develop' Updated in 3.28 seconds.
2024-11-07 09:01:37 - PLUGIN UPDATED: Plugin:'monitor', Tag/Release:'develop' Updated in 25.32 seconds.
2024-11-07 09:01:11 - PLUGIN UPDATED: Plugin:'monitor', Tag/Release:'v2.8.1' Updated in 7.26 seconds.
2024-11-07 09:01:03 - PLUGIN UPDATED: Plugin:'mikrotik', Tag/Release:'develop' Updated in 3.00 seconds.
2024-11-07 09:01:00 - PLUGIN UPDATED: Plugin:'mikrotik', Tag/Release:'v3.1' Updated in 5.07 seconds.
2024-11-07 09:00:54 - PLUGIN UPDATED: Plugin:'maint', Tag/Release:'develop' Updated in 2.38 seconds.
2024-11-07 09:00:52 - PLUGIN SKIPPED: Plugin:'maint', Tag/Release:'v1.1' Skipped as it has not changed
2024-11-07 09:00:51 - PLUGIN SKIPPED: Plugin:'mactrack', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:51 - PLUGIN SKIPPED: Plugin:'mactrack', Tag/Release:'v4.8' Skipped as it has not changed
2024-11-07 09:00:50 - PLUGIN SKIPPED: Plugin:'intropage', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:50 - PLUGIN SKIPPED: Plugin:'intropage', Tag/Release:'v4.0.4' Skipped as it has not changed
2024-11-07 09:00:49 - PLUGIN SKIPPED: Plugin:'hmib', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:49 - PLUGIN SKIPPED: Plugin:'hmib', Tag/Release:'v3.5' Skipped as it has not changed
2024-11-07 09:00:48 - PLUGIN SKIPPED: Plugin:'gpsmap', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:48 - PLUGIN SKIPPED: Plugin:'gpsmap', Tag/Release:'v2.1' Skipped as it has not changed
2024-11-07 09:00:47 - PLUGIN SKIPPED: Plugin:'gexport', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:47 - PLUGIN SKIPPED: Plugin:'gexport', Tag/Release:'v2.1' Skipped as it has not changed
2024-11-07 09:00:46 - PLUGIN SKIPPED: Plugin:'flowview', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:46 - PLUGIN SKIPPED: Plugin:'flowview', Tag/Release:'v4.8' Skipped as it has not changed
2024-11-07 09:00:45 - PLUGIN SKIPPED: Plugin:'evidence', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:45 - PLUGIN SKIPPED: Plugin:'evidence', Tag/Release:'v0.2' Skipped as it has not changed
2024-11-07 09:00:45 - PLUGIN SKIPPED: Plugin:'cycle', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:44 - PLUGIN SKIPPED: Plugin:'cycle', Tag/Release:'v4.1' Skipped as it has not changed
2024-11-07 09:00:43 - PLUGIN SKIPPED: Plugin:'audit', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:42 - PLUGIN SKIPPED: Plugin:'audit', Tag/Release:'v1.2' Skipped as it has not changed
2024-11-07 09:00:42 - PLUGIN SKIPPED: Plugin:'apcupsd', Tag/Release:'develop' Skipped as it has not changed
2024-11-07 09:00:42 - PLUGIN SKIPPED: Plugin:'apcupsd', Tag/Release:'v1.1' Skipped as it has not changed
2024-11-07 09:00:40 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())

**2024-11-07 09:00:40 - ERROR PHP WARNING: include_once(): Failed opening './lib/poller.php' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/cacti/plugins.php on line: 26**

2024-11-07 09:00:40 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 09:00:40 - ERROR PHP WARNING: include_once(./lib/poller.php): Failed to open stream: No such file or directory in file: /var/www/html/cacti/plugins.php on line: 26
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[179]:update_show_current(), /plugins.php[1578]:format_plugin_row(), /plugins.php[1660]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: Undefined array key "last_updated" in file: /var/www/html/cacti/plugins.php on line: 1660
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: include_once(): Failed opening './lib/poller.php' for inclusion (include_path='.:/usr/share/php') in file: /var/www/html/cacti/plugins.php on line: 26
2024-11-07 09:00:32 - PHP ERROR WARNING Backtrace: (/plugins.php[26]:include_once(), /plugins.php[26]:CactiErrorHandler())
2024-11-07 09:00:32 - ERROR PHP WARNING: include_once(./lib/poller.php): Failed to open stream: No such file or directory in file: /var/www/html/cacti/plugins.php on line: 26

Also received this one: <-- probably due to me sending too many requests to github API rate limit exceeded for xxx.xxx.64.171. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)

PHP 8.1.30 (cli) (built: Sep 27 2024 04:07:29) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.30, Copyright (c) Zend Technologies with Zend OPcache v8.1.30, Copyright (c), by Zend Technologies

[ 1.3.0 - Dev ba49b776 @ 2024-11-07 08:15 ]

TheWitness commented 2 weeks ago
ALTER TABLE plugin_config ADD COLUMN last_updated TIMESTAMP DEFAULT NULL;

Sorry, that should have been in the upgrade script. I'll check it.

TheWitness commented 2 weeks ago

Closing. Just add the column or force the upgrade_script.php script from 1.2.28 as the --forcever