Database not migrated correctly with 2.2.8

Started by MartinR, September 21, 2018, 01:07:47 PM

Previous topic - Next topic

MartinR

Hi guys,
my main Problem is, that the database Forgets all devices each time the Netxms Server Service starts.
I use Version 2.2.8, upgraded from 2.2.7, upgraded from 2.0.M2 in a Windows Environment with around 150 devices to monitor with MariaDB.
All Upgrades seem to work.
The Problem exists from 2.2.7 and is not fixed by upgrade.

The eventlog showed many db Errors, there were many links, which did not match.

I ran nxdbmgr check, which found many Errors. I let it fix them all.
I ran nxdbmgr check-data-tables and let it fix one error.

-> devices already do not survive a Restart of the netxms Server Service.
-> eventlog Shows an error "table nodes has no column named rack_image_front"

I suppose a Problem in nxdbmgr in this Version, which does not check this table correctly.

Now I wanted to create a new install with a new database. The Setup created an empty database file and the Service won't start.
I suppose another Problem with the Setup, which does not create a new database correctly.

What can I do now?

Thank you for your help.
Regards
Martin

Victor Kirhenshtein

Hi,

can you share exact errors you have? What database driver you are using?

Best regards,
Victor

MartinR

Hi Victor,
it seems that any newly detected device will not be put into the database. In the Eventlog there ist following error message repeating:

---8<----

SQL query failed (Query = "INSERT INTO nodes (primary_ip,primary_name,snmp_port,node_flags,snmp_version,community,status_poll_type,agent_port,auth_method,secret,snmp_oid,uname,agent_version,platform_name,poller_node_id,zone_guid,proxy_node,snmp_proxy,icmp_proxy,required_polls,use_ifxtable,usm_auth_password,usm_priv_password,usm_methods,snmp_sys_name,bridge_base_addr,down_since,driver_name,rack_image_front,rack_position,rack_height,rack_id,boot_time,agent_cache_mode,snmp_sys_contact,snmp_sys_location,last_agent_comm_time,syslog_msg_count,snmp_trap_count,node_type,node_subtype,ssh_login,ssh_password,ssh_proxy,chassis_id,port_rows,port_numbering_scheme,agent_comp_mode,tunnel_id,lldp_id,fail_time_snmp,fail_time_agent,runtime_flags,rack_orientation,rack_image_rear,agent_id,agent_cert_subject,hypervisor_type,hypervisor_info,id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"): table nodes has no column named rack_image_front

--->8---

During runtime the devices could be treated normally, but after a Restart of the Netxms Server they are all vanished. I assume because they where never in the database.
I suppose somewhere in the Migration path the additional Column "rack_image_front" is not added correctly. Also the table check of nxdbmgr claims all ok, even if this column is missed. I think this should be fixed.

Meanwhile I set up a completely new instance of Netxms and it is now working as expected. Due to all Devices where missed either, it was not worth to repair the old database.

I use SQLite database. In the Version before it was mariaDB.

Thank you for your help and sorry for the late answer.

Best Regards
Martin

Tatjana Dubrovica

It looks like it might be MarinaDB problem we have fixed (we had a lot of problems with MarinaDB recently). Most probably this problem happened due to corrupted DB upgrade. The fix will be included in next release 2.2.9. Now this problem could be fixed only with hands, by manually adding a column to the table or as you did - by recreating the database.
We highly do not recommend SQLite usage, we recommend PostgreSQL as a database.