[INSERT INTO Support_attachment SET file_id = 2005, type = 'D', object_id = 6381]

Duplicate entry '6381-2005-D' for key 'file-type'<br /> <br />
---- Backtrace ----<br />
#0 (root)/include/mysqli.php(199): osTicket->logDBError('DB Error #1062', '[INSERT INTO S...')<br />
#1 (root)/include/class.orm.php(3455): db_query('INSERT INTO
Su...', true, true)<br />
#2 (root)/include/class.orm.php(658): MySqlExecutor->execute()<br />
#3 (root)/include/class.attachment.php(172): VerySimpleModel->save()<br />
#4 (root)/include/ajax.draft.php(101): GenericAttachments->upload(Array)<br />
#5 (root)/include/ajax.draft.php(230): DraftAjaxAPI->_uploadInlineImage(Object(Draft))<br />
#6 (root)/include/class.dispatcher.php(145): DraftAjaxAPI->uploadInlineImageClient('6381')<br />
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('6381/attach', Array)<br />
#8 (root)/include/class.dispatcher.php(120): Dispatcher->resolve('6381/attach', Array)<br />
#9 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/draft/6381/att...', NULL)<br />
#10 (root)/ajax.php(50): Dispatcher->resolve('/draft/6381/att...')<br />
#11 {main}

The error is:
Duplicate entry '6381-2005-D' for key 'file-type'

It literally says you are trying to upload a file of type D, with an ID that already exists.

This occurs when an end user or agent tries to attach a file to a ticket, it doesn’t happen constantly but occasionally it will happen. since we are not defining ID numbers when we attach files I thought it best to make not of it in the forums

Did they take a long time composing things after adding the image? It could be because the draft saved and inserted the image.

@ntozier I have now tested both Agent and End-User replies waiting for ticket draft to be saved before pressing the reply with a file attached and I have not been able to replicate the duplicate ID error.

Write a Reply...