Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

DB Error#1062 after updating from 1.9.14 to 1.10 (901e5ea)

Ive got a couple of issues going on, but will outline those in other posts.

I am dealing with an error ive not seen before, and my MySQL experience is null.

Here is the error:

 DB Error #1062

[INSERT INTO `ost_attachment` SET `file_id` = 391, `type` = 'D', `object_id` = 3893] Duplicate entry '3893-391-D' for key 'file-type'

---- Backtrace ----
#0 C:\xampp\htdocs\Support\include\mysqli.php(204): osTicket->logDBError('DB Error #1062', '[INSERT INTO `o...')
#1 C:\xampp\htdocs\Support\include\class.orm.php(3133): db_query('INSERT INTO `os...', true, true)
#2 C:\xampp\htdocs\Support\include\class.orm.php(597): MySqlExecutor->execute()
#3 C:\xampp\htdocs\Support\include\class.attachment.php(161): VerySimpleModel->save()
#4 C:\xampp\htdocs\Support\include\ajax.draft.php(101): GenericAttachments->upload(Array)
#5 C:\xampp\htdocs\Support\include\ajax.draft.php(300): DraftAjaxAPI->_uploadInlineImage(Object(Draft))
#6 [internal function]: DraftAjaxAPI->uploadInlineImage('3893')
#7 C:\xampp\htdocs\Support\include\class.dispatcher.php(145): call_user_func_array(Array, Array)
#8 C:\xampp\htdocs\Support\include\class.dispatcher.php(38): UrlMatcher->dispatch('3893/attach', Array)
#9 C:\xampp\htdocs\Support\include\class.dispatcher.php(120): Dispatcher->resolve('3893/attach', Array)
#10 C:\xampp\htdocs\Support\include\class.dispatcher.php(38): UrlMatcher->dispatch('/draft/3893/att...', NULL)
#11 C:\xampp\htdocs\Support\scp\ajax.php(262): Dispatcher->resolve('/draft/3893/att...')
#12 {main}

Not sure what action generated the error as it was over the weekend.

I am running 1.10 through Xampp on a Windows 2008r2 OS.

here is my system information. Please let me know what else might be helpful.

Server Information
osTicket Versionv1.10 (901e5ea) Up to date
Web Server SoftwareApache/2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.23
MySQL Version10.1.13
PHP Version5.6.23
PHP Extensions
gdlib Used for image manipulation and PDF printing
imap Used for email fetching
xml-dom Used for HTML email processing
json Improves performance creating and processing JSON
mbstring Highly recommended for non western european language content
phar Highly recommended for plugins and language packs
intl Highly recommended for non western european language content
fileinfo Used to detect file types for uploads
APCu Improves overall performance
Zend Opcache Improves overall performance
PHP Settings
cgi.fix_pathinfo "1" is recommended if AJAX is not working
Database Information and Usage
SchemaOST (localhost)
Schema Signature98ad7d550c26ac44340350912296e673
Space Used19.45 MiB
Space for Attachments8.87 MiB


  • The error says: Duplicate entry '3893-391-D' for key 'file-type'
    Which means that something is trying to insert a file into the attachment table (ost_attachment) that already exists.  Are you getting this during the upgrade process or after upgrading?>
  • it started happening after the upgrade completed.
  • Do you know what user and sending what image that might be causing it?

  • No, unfortunately. The error has occurred twice since updating, which isn't too bad I guess. From two different IPs. No information on those addresses at all.

    So does the error mean that someone is trying to add an attachment to a ticket? With no MySQL familiarity, its difficult for me to try and track this entry down.

  • It looks to me like someone is trying to add a duplicate attachment to a ticket.  It could (and likely is) something like an image in their signature or something.
  • Bottom line is, there doesn't seem to be anything fundamentally wrong with my system. That's good news. Thanks for the feedback.
  • Very welcome.
Sign In or Register to comment.