Cacti / cacti

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

Error after import from a 1.2.x dev to a 1.2.27 #5822

Closed arno-st closed 1 month ago

arno-st commented 1 month ago

I start to create a production Cacti, for that I use the 1.2.x repo, the install was fine, and the basic works. So I try to export the device template I have on my test bench, who is at develop level, I take only the new object, no update of existing field, and I'm getting this error on my log:

11/09/2024` 08:48:27 - CMDPHP PHP ERROR WARNING Backtrace: (/templates_import.php[43]:form_save(), /templates_import.php[117]:import_xml_data(), /lib/import.php[246]:xml_to_data_query(), /lib/import.php[1488]:CactiErrorHandler()) 11/09/2024 08:48:27 - ERROR PHP WARNING: Undefined variable $data_query_graph_rrd_sv_id in file: /usr/share/cacti/lib/import.php on line: 1488 11/09/2024 08:48:27 - 4 Import Error: Error Importing into snmp_query_graph_rrd_sv table 11/09/2024 08:48:27 - CMDPHP Import Error: Import found an invalid dependency hash of :712df431bb48d2dc00822a8c1871a468 for Table snmp_query_graph_rrd_sv. Please open bug on GitHub. 11/09/2024 08:48:27 - 4 Import Error: inserting into snmp_query_graph_rrd 11/09/2024 08:48:27 - CMDPHP Import Error: Import found an invalid dependency hash of :a7450db582239aef8e23ba93d9d2ca55 for Table snmp_query_graph_rrd. Please open bug on GitHub. 11/09/2024 08:48:27 - CMDPHP Import Error: Import found an invalid dependency hash of :712df431bb48d2dc00822a8c1871a468 for Table snmp_query_graph_rrd. Please open bug on GitHub. 11/09/2024 08:48:27 - CMDPHP Import Error: Import found an invalid dependency hash of :38f36fb147911ca35e095a100644aeb3 for Table snmp_query_graph. Please open bug on GitHub. 11/09/2024 08:48:25 - CMDPHP Import Error: Import found an invalid dependency hash of :712df431bb48d2dc00822a8c1871a468 for Table snmp_query_graph_rrd_sv. Please open bug on GitHub. 11/09/2024 08:48:25 - CMDPHP Import Error: Import found an invalid dependency hash of :38f36fb147911ca35e095a100644aeb3 for Table snmp_query_graph. Please open bug on GitHub.

TheWitness commented 1 month ago

The Dev instance is using a separate hash code.

Edit the include/global_arrys.php on the dev system and change the hash code to 103 from 104, and the re-export the template. After which, set back to 104.

Other errors may occur though as the reason we do this is if there was a schema change.

arno-st commented 1 month ago

changing the hash code to 0104 I got this error now: 12/09/2024 09:23:28 - IMPORT ERROR: Import or Preview failed for XML file cacti_data_template_cisco_-_envmon_-_fan.xml! 12/09/2024 09:23:28 - IMPORT ERROR: 0104 hash version does not exist! 12/09/2024 09:23:28 - IMPORT ERROR: 0104 hash version does not exist! 12/09/2024 09:23:28 - IMPORT ERROR: 0104 hash version does not exist!

TheWitness commented 1 month ago

You have to manually copy those files when not using packages. So, simply copy them from the other system to yours.

arno-st commented 1 month ago

Copy which file ? the xml is not a resource, it's the export of a template

TheWitness commented 1 month ago

I still see the wrong $cacti_version_code. Did you replace the 0104 with 0103 before you exported it again?

TheWitness commented 1 month ago

From 1.2.x currently.

image

You have to make the change on the Develop side, and then re-export your template(s).