Hi EveryoneI get this errors after upgrade osTicket from 1.9.3 to 1.9.4Duplicate entry 'H-17509' for key 'PRIMARY'<br />

<br />

---- Backtrace ----<br />

#0 (root)/include/mysqli.php(177): osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')<br />

#1 (root)/include/class.search.php(611): db_query('INSERT INTO `os...')<br />

#2 (root)/include/class.search.php(489): MysqlSearchBackend->__index(Array)<br />

#3 : MysqlSearchBackend->IndexOldStuff(Array, NULL)<br />

#4 (root)/include/class.signal.php(98): call_user_func_array(Array, Array)<br />

#5 (root)/include/class.cron.php(108): Signal:('cron', Array)<br />

#6 (root)/include/api.cron.php(19): Cron->run()<br />

#7 (root)/include/api.cron.php(40): CronApiController->run()<br />

#8 (root)/api/cron.php(23): LocalCronApiController:()<br />

#9 {main}and 5 minutes after, i get this one:Duplicate entry 'T-4664' for key 'PRIMARY'<br />

<br />

---- Backtrace ----<br />

#0 (root)/include/mysqli.php(177): osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')<br />

#1 (root)/include/class.search.php(611): db_query('INSERT INTO `os...')<br />

#2 (root)/include/class.search.php(512): MysqlSearchBackend->__index(Array)<br />

#3 : MysqlSearchBackend->IndexOldStuff(Array, NULL)<br />

#4 (root)/include/class.signal.php(98): call_user_func_array(Array, Array)<br />

#5 (root)/scp/autocron.php(58): Signal:('cron', Array)<br />

#6 {main}what could it be?thanks

You appear to have duplicate keys.Duplicate entry 'H-17509' for key 'PRIMARY'Duplicate entry 'T-4664' for key 'PRIMARY' you would need to look to see which table thats occurring in (the paste you provided doesn't show it) and remove the two dupes from the table.

thank you for the answer.yes, you right, but i don´t know how could they duplicate. it seems not cause major problemsthanx again

Can you post the full error message? At the moment the is truncated:#0 (root)/include/mysqli.php(177): osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')<br />

yes:[INSERT INTO `ost__search` (`object_type`, `object_id`, `title`, `content`)

VALUES ( .......both errors begin the same way

I am also getting the same issue after upgrading to 1.9.4, full error is below;

 

Duplicate entry 'H-43823' for key 'PRIMARY'<br />

<br />

---- Backtrace ----<br />

#0 C:\xampp\htdocs\include\mysqli.php(177):

osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')<br />

#1 C:\xampp\htdocs\include\class.search.php(611):

db_query('INSERT INTO `os...')<br />

#2 C:\xampp\htdocs\include\class.search.php(591):

MysqlSearchBackend->__index(NULL, true)<br />

#3 :

MysqlSearchBackend->IndexOldStuff(Array, NULL)<br />

#4 C:\xampp\htdocs\include\class.signal.php(98):

call_user_func_array(Array, Array)<br />

#5 C:\xampp\htdocs\scp\autocron.php(58):

Signal:('cron', Array)<br />

#6 {main}

Just found that an issue for that was already opened over at Github:https://github.com/osTicket/osTicket-1.8/issues/1215Unfortunately there seems to be no solution yet.I am not sure if the "_search" mysql table rebuilds itself when you delete the whole table or just some entries. So maybe you should clone your osTicket and try what happens when you delete the duplicate entries or even the whole content of the table. But, please, make a backup before you start testing and do not test this on your live system - create a copy and test it with the copy!

15 days later

Today i get this error: (i didn´t upgrade this time, it just happened)

Duplicate entry 'H-19358' for key 'PRIMARY'<br />

<br />

---- Backtrace ----<br />

#0 (root)/include/mysqli.php(177): osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')<br />

#1 (root)/include/class.search.php(611): db_query('INSERT INTO `os...')<br />

#2 (root)/include/class.search.php(591): MysqlSearchBackend->__index(NULL, true)<br />

#3 : MysqlSearchBackend->IndexOldStuff(Array, NULL)<br />

#4 (root)/include/class.signal.php(98): call_user_func_array(Array, Array)<br />

#5 (root)/include/class.cron.php(108): Signal:('cron', Array)<br />

#6 (root)/include/api.cron.php(19): Cron->run()<br />

#7 (root)/include/api.cron.php(40): CronApiController->run()<br />

#8 (root)/api/cron.php(23): LocalCronApiController:()<br />

#9 {main}and this one (from cron.php file), i guess it is related:PHP Fatal error: Uncaught exception 'Exception' with message 'Unable to index content' in /var/www/soporte/include/class.search.php

Stack trace:

#0 /var/www/soporte/include/class.search.php(591): MysqlSearchBackend->__index(NULL, true)

#1 : MysqlSearchBackend->IndexOldStuff(Array, NULL)

#2 /var/www/soporte/include/class.signal.php(98): call_user_func_array(Array, Array)

#3 /var/www/soporte/include/class.cron.php(108): Signal:('cron', Array)

#4 /var/www/soporte/include/api.cron.php(19): Cron->run()

#5 /var/www/soporte/include/api.cron.php(40): CronApiController->run()

#6 /var/www/soporte/api/cron.php(23): LocalCronApiController:()

#7 {main}

thrown in /var/www/soporte/include/class.search.php on line 612is it bad? i don´t know how the keys had duplicate (sorry my english)thank you

I refer you to the github issue report linked earlier in this thread.

Write a Reply...