Nightly Maintenance Failed due to clean_database error

By esupport posted Oct 02, 2018 07:13 AM


Nightly Maintenance Failed due to clean_database error


Below is the error noticed in clean_database log, here the error is pointing to the target_id in scheduled_event table.


Only one row should match. at /usr/local/airwave/lib/perl/Mercury/Utility/ line 59

                eval {...} called at /usr/local/airwave/lib/perl/Mercury/Utility/ line 59

                Mercury::Utility::Assert::assert_quickly('', 'Only one row should match.') called at /usr/local/airwave/lib/perl/Mercury/DB/ line 265

                Mercury::DB::TableRowBase::only_one_row_allowed('Mercury::ScheduledEvent', 'Mercury::ScheduledEvent::Edit=HASH(0x1aee9d60)', 'Mercury::ScheduledEvent::Edit=HASH(0x15834bd8)') called at /usr/local/airwave/lib/perl/Mercury/DB/ line 273

                Mercury::DB::TableRowBase::get_by_fields('Mercury::ScheduledEvent', 'type', 'ARRAY(0x1ae0d6c8)', 'target_id', 13506965) called at /usr/local/airwave/lib/perl/Mercury/DB/ line 68

                Mercury::DB::NewConfigItem::status('Mercury::DB::NewConfigItem=HASH(0x1ae06af0)') called at /usr/local/airwave/bin/ line 66

                main::__ANON__() called at /usr/local/airwave/lib/perl/Mercury/Utility/ line 55

                Mercury::Utility::Time::time_block('CODE(0x10e967a0)', 'new_config expiration') called at /usr/local/airwave/bin/ line 72


Check the scheduled_event table for any duplicate entries.

For Example: Found duplicate entry for the above highlighted target_id 13506965, as shown below.



Check the ids under report_definition as shown below to see which one is not returning any result.

Here the id 8501 did not fetch any result.




Delete the duplicate id (i.e. id that did not return any result) from scheduled_event table using the below command to resolve the issue.

airwave=> delete from scheduled_event where id = 8501;