Cacti / cacti

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

[1.3] Upgrade from 1.2.x poller_maintenance.php Unknown DB field #5616

Closed bmfmancini closed 9 months ago

bmfmancini commented 11 months ago

Upgrading from 1.2.26

2023-12-18 10:49:47 - SQL Backtrace: (/poller_maintenance.php[127]:update_graphs_data_source_templates_totals(), /poller_maintenance.php[168]:object_cache_update_aggregate_totals(), /lib/utility.php[3113]:db_execute_prepared())
2023-12-18 10:49:47 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'graphs' in 'field list'
2023-12-18 10:49:47 - SQL Backtrace: (/poller_maintenance.php[127]:update_graphs_data_source_templates_totals(), /poller_maintenance.php[168]:object_cache_update_aggregate_totals(), /lib/utility.php[3113]:db_execute_prepared())
2023-12-18 10:49:47 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'graphs' in 'field list'
2023-12-18 10:49:47 - SQL Backtrace: (/poller_maintenance.php[127]:update_graphs_data_source_templates_totals(), /poller_maintenance.php[168]:object_cache_update_aggregate_totals(), /lib/utility.php[3113]:db_execute_prepared())
2023-12-18 10:49:47 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'graphs' in 'field list'
2023-12-18 10:49:47 - SQL Backtrace: (/poller_maintenance.php[127]:update_graphs_data_source_templates_totals(), /poller_maintenance.php[168]:object_cache_update_aggregate_totals(), /lib/utility.php[3113]:db_execute_prepared())
2023-12-18 10:49:47 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'graphs' in 'field list'
2023-12-18 10:49:47 - SQL Backtrace: (/poller_maintenance.php[127]:update_graphs_data_source_templates_totals(), /poller_maintenance.php[167]:object_cache_update_graph_totals(), /lib/utility.php[3008]:db_execute_prepared())
2023-12-18 10:49:47 - CMDPHP ERROR: A DB Exec Failed!, Error: Unknown column 'graphs' in 'field list'
bmfmancini commented 11 months ago

OK looks like the vdef table is not being replicated to the remotes fully

Main

MariaDB [cacti]> describe vdef;
+-----------+-----------------------+------+-----+---------+----------------+
| Field     | Type                  | Null | Key | Default | Extra          |
+-----------+-----------------------+------+-----+---------+----------------+
| id        | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |
| hash      | varchar(32)           | NO   | MUL |         |                |
| name      | varchar(255)          | NO   | MUL |         |                |
| graphs    | int(10) unsigned      | NO   |     | 0       |                |
| templates | int(10) unsigned      | NO   |     | 0       |                |
+-----------+-----------------------+------+-----+---------+----------------+
5 rows in set (0.004 sec)

Remote

MariaDB [cacti]> describe vdef;
+-------+-----------------------+------+-----+---------+----------------+
| Field | Type                  | Null | Key | Default | Extra          |
+-------+-----------------------+------+-----+---------+----------------+
| id    | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |
| hash  | varchar(32)           | NO   | MUL |         |                |
| name  | varchar(255)          | NO   | MUL |         |                |
+-------+-----------------------+------+-----+---------+----------------+
3 rows in set (0.005 sec)

Did a manual poller sync same result

bmfmancini commented 11 months ago

Ah Interesting

2023-12-18 11:14:25 - PHP ERROR WARNING Backtrace: (/pollers.php[261]:form_actions(), /pollers.php[528]:replicate_out(), /lib/poller.php[1524]:poller_connect_to_remote(), /lib/poller.php[1489]:CactiErrorHandler())
2023-12-18 11:14:25 - ERROR PHP WARNING: Undefined array key "dbsslverifyservercert" in file: /var/www/html/cacti/lib/poller.php on line: 1489
2023-12-18 11:14:25 - PHP ERROR WARNING Backtrace: (/pollers.php[261]:form_actions(), /pollers.php[528]:replicate_out(), /lib/poller.php[1524]:poller_connect_to_remote(), /lib/poller.php[1488]:CactiErrorHandler())
2023-12-18 11:14:25 - ERROR PHP WARNING: Undefined array key "dbsslcapath" in file: /var/www/html/cacti/lib/poller.php on line: 1488
bmfmancini commented 11 months ago

Ok so for some reason by default the remote poller now shows SSL enabled which it never was and the column is missing

Screenshot from 2023-12-18 11-32-07

bmfmancini commented 11 months ago
| dbssl         | char(3)               | YES  |     |                     |                |
| dbsslkey      | varchar(255)          | YES  |     | NULL                |                |
| dbsslcert     | varchar(255)          | YES  |     | NULL                |                |
| dbsslca       | varchar(255)          | YES  |     | NULL                |                |
| total_time    | double                | YES  |     | 0                   |                |
github-actions[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

TheWitness commented 9 months ago

Better run a forced DB upgrade. That column was added in 1.2.0.

image

TheWitness commented 9 months ago

Looks like you are mixing 1.2.x with develop too.

TheWitness commented 9 months ago

Kind of makes sense since you were upgrading.