[ZBX-23903] Database replication error Created: 2024 Jan 02 Updated: 2024 Feb 14 Resolved: 2024 Feb 14 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Problem report | Priority: | Trivial |
Reporter: | Igor Luiz Oliveira | Assignee: | Aigars Kadikis |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() ![]() |
Description |
Specifications: Description: Although the migration was successful, with all data and objects correctly replicated to the target database, we are facing issues related to the database version and communication with the database instance. The application fails to start due to these issues. Even when the database is updated to a version compatible with the application version, the application still attempts internal updates, resulting in the mentioned errors. Steps to reproduce: 1. Alter parameter group set log_bin_trust_function_creator=1 and row_format=ROW Result: |
Comments |
Comment by Aigars Kadikis [ 2024 Jan 03 ] |
Dear Igor, Could it be possible that the line starts with "query failed" and contains the error above? Please share more original lines from zabbix_server.log. Please simulate if the dedicated application user can read the data. Observe the connection characteristics to communicate with DB: grep ^DB /etc/zabbix/zabbix_server.conf From the same host where service "zabbix-server" is installed, use "mysql" client utility to connect to the database. Use dedicated user from the previous output:
mysql --host=dns.of.ip --user=zabbix --password='zabbix' --database=zabbix
See how many items are inside: SELECT COUNT(*) FROM items; A few recognizable host titles which did exist in old instances: SELECT hosts.host FROM hosts WHERE hosts.flags IN (0,4) AND hosts.status IN (0,1); Does the SELinux run on the host? This will tell: getenforce |
Comment by Igor Luiz Oliveira [ 2024 Jan 04 ] |
Hi Aigars. Thank you for your reply.
Follow the commands and images. I've changed this query to COUNT because of privacy policies. SELECT hosts.host FROM hosts WHERE hosts.flags IN (0,4) AND hosts.status IN (0,1); DB configuration on zabbix_server.conf: SELECT COUNT(*) FROM items; SELECT COUNT(*) FROM hosts WHERE hosts.flags IN (0,4) AND hosts.status IN (0,1);
Selinux configuration: Sorry, the message is "cannot read instance id" not "unable". I've noted that config table isn't populated as well:
|
Comment by Aigars Kadikis [ 2024 Jan 30 ] |
Hi Igor. Sorry for late reply. There should be only one row in the config table and you have this one row. It seems the column "instanceid" currently has an empty value. The syntax of instanced is a 32-character long hex string. We can use a bash command to generate one: < /dev/urandom tr -dc a-f0-9 | head -c${1:-32};echo; It can print a string like: "cafc344fe615d8cb24a416cdbd3e9201" After that, you can use DB command to update the field:
UPDATE config SET instanceid='cafc344fe615d8cb24a416cdbd3e9201';
Please check if other data is there. There should be a lot: SELECT * FROM config; At the bare minimum via stock installation, we have: INSERT INTO `config` (`configid`,`work_period`,`alert_usrgrpid`,`discovery_groupid`,`dbversion_status`,`geomaps_tile_provider`) values ('1','1-5,09:00-18:00','7','5','','OpenStreetMap.Mapnik'); |
Comment by Igor Luiz Oliveira [ 2024 Feb 14 ] |
Hello, Aigars! Thank you for your help. The problem was in AWS tool. It's ok now. Thank you. |