Today the system started spitting out DB error 1062 on ticket creation trough mail fetch. Afaik nothing has changed in the system, configuration, etc. The error looks like this:
[INSERT INTO `os_thread_referral` SET `thread_id` = 524, `object_id` = 1, `object_type` = 'D', `created` = NOW()]
Duplicate entry '1-D-524' for key 'ref'<br />
<br />
---- Backtrace ----<br />
#0 (root)/include/mysqli.php(211): osTicket->logDBError()<br />
#1 (root)/include/class.orm.php(3482): db_query()<br />
#2 (root)/include/class.orm.php(658): MySqlExecutor->execute()<br />
#3 (root)/include/class.thread.php(1961): VerySimpleModel->save()<br />
#4 (root)/include/class.thread.php(380): ThreadReferral::create()<br />
#5 (root)/include/class.ticket.php(3039): Thread->refer()<br />
#6 (root)/include/class.thread.php(1418): Ticket->systemReferral()<br />
#7 (root)/include/api.tickets.php(187): ThreadEntry::lookupByEmailHeaders()<br />
#8 (root)/include/class.mailfetch.php(84): TicketApiController->processEmail()<br />
#9 (root)/include/class.mailfetch.php(137): osTicket\Mail\Fetcher->processMessage()<br />
#10 (root)/include/class.email.php(1129): osTicket\Mail\Fetcher->processEmails()<br />
#11 (root)/include/class.mailfetch.php(254): MailBoxAccount->fetchEmails()<br />
#12 (root)/include/class.cron.php(25): osTicket\Mail\Fetcher::run()<br />
#13 (root)/include/class.cron.php(110): Cron::MailFetcher()<br />
#14 (root)/include/api.cron.php(15): Cron::run()<br />
#15 (root)/include/api.cron.php(45): CronApiController->run()<br />
#16 (root)/api/cron.php(23): LocalCronApiController::call()<br />
#17 {main}
Based on the ticket, I noticed they lack the auto-assignment to a team that is default for my installation, so that's the thing that errors out. But given that nothing has changed, I don't understand how or why this now suddenly started happening.
Could anyone please help me figure out how this is now happening, and probably more importantly, help me stop it from happening again? 😋