Problems enabling Kernel::System::Ticket::IndexAccelerator::StaticDB

Moderator: crythias

Post Reply
MomentoJams
Znuny newbie
Posts: 10
Joined: 17 Mar 2021, 01:36
Znuny Version: 6.0.30
Real Name: James Whitwell

Problems enabling Kernel::System::Ticket::IndexAccelerator::StaticDB

Post by MomentoJams »

Hi,

We're running OTRS 6.0.30 on Ubuntu 20.04 with MariaDB 10.3. I've just enabled Kernel::System::Ticket::IndexAccelerator::StaticDB following https://doc.znuny.org/legacy/manual/adm ... uning.html and have received an email that looks like this:

Code: Select all

DBD::mysql::db do failed: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`ticket_index`, CONSTRAINT `FK_ticket_index_ticket_id_id` FOREIGN KEY (`ticket_id`) REFERENCES `ticket` (`id`)) at /usr/local/src/otrs-6.0.30/Kernel/System/DB.pm line 470.
ERROR: OTRS-otrs.Daemon.pl - Daemon Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker-10 Perl: 5.30.0 OS: linux Time: Thu Aug 10 01:33:44 2023

Message: Cannot add or update a child row: a foreign key constraint fails (`otrs`.`ticket_index`, CONSTRAINT `FK_ticket_index_ticket_id_id` FOREIGN KEY (`ticket_id`) REFERENCES `ticket` (`id`)), SQL: '
               INSERT INTO ticket_index
                   (ticket_id, queue_id, queue, group_id, s_lock, s_state, create_time)
                   VALUES (?, ?, ?, ?, ?, ?, ?)'

Traceback (86229): 
  Module: Kernel::System::Ticket::IndexAccelerator::StaticDB::TicketAcceleratorRebuild Line: 601
  Module: Kernel::System::Ticket::TicketAcceleratorRebuild Line: 7404
  Module: (eval) Line: 144
  Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Cron::Run Line: 123
  Module: Kernel::System::Daemon::DaemonModules::SchedulerTaskWorker::Run Line: 235
  Module: (eval) Line: 330
  Module: main::Start Line: 330
  Module: /usr/local/otrs/bin/otrs.Daemon.pl Line: 151
Probably a hundred or so repeats of this. What can I do to fix the issue?

Thanks.
root
Administrator
Posts: 3968
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: Problems enabling Kernel::System::Ticket::IndexAccelerator::StaticDB

Post by root »

Hi,

Do you have an GenericAgent that delete's tickets? Looks like a race condition to me. Besides that: do you really have more than 80,000 open tickets in your system?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
MomentoJams
Znuny newbie
Posts: 10
Joined: 17 Mar 2021, 01:36
Znuny Version: 6.0.30
Real Name: James Whitwell

Re: Problems enabling Kernel::System::Ticket::IndexAccelerator::StaticDB

Post by MomentoJams »

Ah thanks. Yes, I've been running a GenericAgent to delete (very) old tickets from one of the queues. And yes, unfortunately (due to many reasons) we do have more than 80 0000 open tickets in the system ... which is the reason for the GenericAgent.

Our users (of OTRS) noticed that the queue view was becoming inconsistent since I turned on the index. I've turned it off for now and am continuing to delete old tickets. Judging by your reply, it should be OK to turn it back on again after I've finished?

Thanks.
Post Reply