I'm having a problem on attachments. They seem to work fine on tickets created through the support portal and email piping, but I do a lot of ticket creation through the API and the attachments seems to get messed up.
I've got two symptoms:
- Attachment content gets messed up inside the mysql database. Consistently, all the png images are stored as a two byte chunk "3c d1". I haven't done much testing with other file types. gif images also seems to be getting stored as a 4 byte "18 81 7c f5". The files link appear correctly in the thread, indicating the right original size. You can actually download the content, but it yields the two byte thing.
- Sometimes, downloading the file yields a 500 response, which I'm listing below.
[Wed Apr 27 09:42:57 2016] [error] [client 192.168.2.112] PHP Fatal error: Uncaught exception 'ObjectNotUnique' with message 'One object was expected; however multiple objects in the database matched the query. In fact, there are 2 matching objects.' in /var/www/html/osticket194/include/class.orm.php:1175\nStack trace:\n#0 /var/www/html/osticket194/include/class.orm.php(544): QuerySet->one()\n#1 /var/www/html/osticket194/include/class.file.php(581): VerySimpleModel::lookup(Array)\n#2 /var/www/html/osticket194/include/class.file.php(586): AttachmentFile::lookupByHash('baqggzizreqrfhv...')\n#3 /var/www/html/osticket194/file.php(24): AttachmentFile::lookup('baqggzizreqrfhv...')\n#4 {main}\n thrown in /var/www/html/osticket194/include/class.orm.php on line 1175
I'm using a CENTOS with php 5.6.8. The osticket version v1.10-rc.2-325-ge231550.
I'm still testing this. OST comes with a hash based file storage. It's quite effective but it means that a previous erroneous file upload tend to persist. I'm going to test now with fresh files. I'll let you know.
Anyone seeing this?
If the file storage tables are messed up, is there a cleaning procedure I may follow?