Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #12458] Insert fails for the icinga_scheduleddowntime table due to duplicate key #4499

Closed
icinga-migration opened this issue Aug 17, 2016 · 5 comments

Comments

Projects
None yet
1 participant
@icinga-migration
Copy link
Member

commented Aug 17, 2016

This issue has been migrated from Redmine: https://dev.icinga.com/issues/12458

Created by TheFlyingCorpse on 2016-08-17 05:54:30 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2016-08-17 11:30:04 +00:00)
Target Version: 2.5.0
Last Update: 2016-08-17 11:30:04 +00:00 (in Redmine)

Icinga Version: 2.4.10-master
Backport?: Not yet backported
Include in Changelog: 1

On a startup with no changes to icinga2 other than compiling some modifications for perfdata, I got an error in Ido, pasted below.
No changes to configuration.

Error:

[2016-08-17 07:46:55 +0200] critical/IdoMysqlConnection: Error "Duplicate entry '1-84-2016-08-17 05:46:54-2' for key 'instance_id'" when executing query "INSERT INTO icinga_scheduleddowntime (actual_start_time, actual_start_time_usec, author_name, comment_data, downtime_type, duration, endpoint_object_id, entry_time, instance_id, internal_downtime_id, is_fixed, is_in_effect, name, object_id, scheduled_end_time, scheduled_start_time, session_token, was_started) VALUES (FROM_UNIXTIME(1471478400), '0', 'icingaadmin', 'Scheduled downtime for backup', '1', '0', 4, FROM_UNIXTIME(1471412814), 1, '2', '1', '0', 'deb-i2-host.labdomain.net!load!deb-i2-host-1471412814-0', 84, FROM_UNIXTIME(1471482000), FROM_UNIXTIME(1471478400), 1471412814, '0');INSERT INTO icinga_scheduleddowntime (actual_start_time, actual_start_time_usec, author_name, comment_data, downtime_type, duration, endpoint_object_id, entry_time, instance_id, internal_downtime_id, is_fixed, is_in_effect, name, object_id, scheduled_end_time, scheduled_start_time, session_token, was_started) VALUES (FROM_UNIXTIME(1471478400), '0', 'icingaadmin', 'Scheduled downtime for backup', '1', '0', 4, FROM_UNIXTIME(1471412814), 1, '2', '1', '0', 'deb-i2-host.labdomain.net!load!deb-i2-host-1471412814-0', 84, FROM_UNIXTIME(1471482000), FROM_UNIXTIME(1471478400), 1471412814, '0');INSERT INTO icinga_contactnotifications (contact_object_id, end_time, end_time_usec, instance_id, notification_id, start_time, start_time_usec) VALUES (75, FROM_UNIXTIME(1471412814), '176911', 1, 17, FROM_UNIXTIME(1471412814), '176911');UPDATE icinga_objects SET is_active = 1 WHERE object_id = 6;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 8;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 7;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 9;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 10;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 11;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 12;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 13;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 14;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 15;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 17;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 16;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 19;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 18;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 21;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 20;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 22;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 23;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 24;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 26;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 28;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 25;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 27;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 29;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 30;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 31;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 32;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 33;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 35;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 34;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 36;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 37;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 38;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 39;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 40;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 41;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 42;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 43;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 44;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 45;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 46;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 47;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 48;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 49;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 51;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 50;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 52;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 53;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 54;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 55;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 56;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 58;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 57;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 60;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 59;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 61;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 62;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 63;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 64;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 65;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 66;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 4;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 88;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 74;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 89;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 90;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 91;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 92;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 93;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 69;UPDATE icinga_objects SET is_active = 1 WHERE object_id = 70"
[2016-08-17 07:46:55 +0200] critical/IdoMysqlConnection: Exception during database operation: Verify that your database is operational!
[2016-08-17 07:46:55 +0200] debug/IdoMysqlConnection: Exception during database operation: Error: std::exception

        (0) libdb_ido_mysql.so: void boost::throw_exception(icinga::database_error const&) (+0x97) [0x7f58878a52d7]
        (1) libdb_ido_mysql.so: void boost::exception_detail::throw_exception_(icinga::database_error const&, char const*, char const*, int) (+0x3e) [0x7f58878a535e]
        (2) libdb_ido_mysql.so: icinga::IdoMysqlConnection::FinishAsyncQueries() (+0x927) [0x7f588788ece7]
        (3) libdb_ido_mysql.so: icinga::IdoMysqlConnection::Query(icinga::String const&) (+0x32) [0x7f588788f3e2]
        (4) libdb_ido_mysql.so: icinga::IdoMysqlConnection::ClearTableBySession(icinga::String const&) (+0x19c) [0x7f588789a44c]
        (5) libdb_ido_mysql.so: icinga::IdoMysqlConnection::ClearTablesBySession() (+0x34) [0x7f588789a7b4]
        (6) libbase.so: icinga::WorkQueue::WorkerThreadProc() (+0x500) [0x7f5892165430]
        (7) libboost_thread.so.1.55.0:  (+0xdaea) [0x7f5892e18aea]
        (8) libpthread.so.0:  (+0x80a4) [0x7f58924660a4]
        (9) libc.so.6: clone (+0x6d) [0x7f588f96f87d]

Attachments

Changesets

2016-08-17 11:24:18 +00:00 by gbeutner 1ea9f9c

Fix problem with duplicate INSERTs for the same key columns

fixes #12461
fixes #12458

2016-08-17 11:35:10 +00:00 by gbeutner 4c54cdd

Fix problem with duplicate INSERTs for the same key columns

fixes #12461
fixes #12458
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2016

Updated by TheFlyingCorpse on 2016-08-17 05:57:17 +00:00

  • File added exception-log.txt

Log cut off, attached instead.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2016

Updated by gbeutner on 2016-08-17 06:21:13 +00:00

  • Subject changed from Error on startup with icinga2 to Insert fails for the icinga_scheduleddowntime table due to duplicate key

The title for this bug is terrible. Also this seems to be a race condition between the AddDowntimes() call in the host/service config update and an event ("new downtime created"). I've seen this before but have been unable to reproduce it reliably.

@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2016

Updated by gbeutner on 2016-08-17 06:40:22 +00:00

  • Description updated
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2016

Updated by gbeutner on 2016-08-17 11:24:59 +00:00

  • Status changed from New to Assigned
  • Assigned to set to gbeutner
@icinga-migration

This comment has been minimized.

Copy link
Member Author

commented Aug 17, 2016

Updated by gbeutner on 2016-08-17 11:30:04 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 1ea9f9c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.