osTicket Version v1.12.2 (a5d898b) — Up to date
Web Server Software Apache/2.4.29 (Ubuntu)
MySQL Version 5.7.27
PHP Version 7.3.9-1+ubuntu18.04.1+deb.sury.org+1

Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic

I'm getting the following error:

When i try to paste an image inline in the message i get a "DB Error #1062"

The image does not show up. The only way to attach a screenshot / image is to save the file as a normal attachment and attach it.

#############################################################################
DB Error #1062

[INSERT INTO 2ost_attachment SET file_id = 438, type = 'D', object_id = 22843]

Duplicate entry '22843-438-D' for key 'file-type'<br /> <br />
---- Backtrace ----<br />
#0 (root)/include/mysqli.php(199): osTicket->logDBError('DB Error #1062', '[INSERT INTO 2...')<br />
#1 (root)/include/class.orm.php(3455): db_query('INSERT INTO
2o...', 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(301): DraftAjaxAPI->_uploadInlineImage(Object(Draft))<br />
#6 (root)/include/class.dispatcher.php(145): DraftAjaxAPI->uploadInlineImage('22843')<br />
#7 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('22843/attach', Array)<br />
#8 (root)/include/class.dispatcher.php(120): Dispatcher->resolve('22843/attach', Array)<br />
#9 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/draft/22843/at...', NULL)<br />
#10 (root)/scp/ajax.php(289): Dispatcher->resolve('/draft/22843/at...')<br />
#11 {main}
#############################################################################

I was at PHP 5.x.x prior, thought it might be PHP. So I went ahead and updated PHP to 7.3 - Did not help.

Thanks!

I believe that this is caused by the auto draft save feature. So the item already gets saved and cannot add a second copy to the DB. There is a pull for the forth coming version here that changes the behavior a little:
https://github.com/osTicket/osTicket/pull/5046

Thanks for the information.

Do you have a WAG / ETA on the next version this patch might be included on to see if it fixes my issue?

Thanks again!

The devs do not give release dates.

Yeah I figured no actual date / commitment.

The issue has been around for a a long time now and was Just curious if it was a hopefully a target out by the end of the year or by end of q2 2020 etc...

Anyways thanks.

To be fair there are several PRs attempting to address the issue different ways on github. You could easily try them out yourself instead of waiting for the next release.

Good point! Will take a look and give it a try.

Thanks again.

Write a Reply...