We have a problem that when we attach a file to the ticket, it loads and appears ok, but when we save the reply or create the ticket, that attachment disappears.
This error occurs both in the default store and in the 'Storage: Attachment on the filesystem' plugin.
And it happens on both the client side and the agent side

The file is saved, both in the database and in the plugin file, but it does not appear in the ticket.

This problem started after I upgraded to version 1.11.
I can still see all the attachments that were inserted in version 1.10.4, only those that were attached in version 1.11 that have this problem

I cannot replicate this issue with my production site (but I am running IIS 8.5 w PHP 7.2).

Are you seeing any PHP / Apache errors in your logs?

    @LucasPereira

    I had similar issues earlier today actually and just had to remount my drive. After the remount everything was fine again.

    Are you mounting a drive to your server to store attachments on? Does the filesystem have correct ownership/permissions?

    Cheers.

      KevinTheJedi
      Sorry, I do not speak English very well, what do you mean "had to remount my drive"?

      I am storing the attachments in a file along with the system files. I do not have a specific drive just for the attachments.
      And the system has all permissions / ownership correct.

      But I do not think the problem is with storing the files because they are being stored correctly.
      The problem is that they are not being exported on the tickets.
      Do you know which code places the attachments in the tickets?

      7 days later

      Hi,
      same problem here! osTicket is 1.11.

      Upload is correct, there exists a file "2IR5LcMcP7v71RFqnEpPMX9yDUFAhSFQ" under /srv/www/01-ticket/www/attachements/2
      The file has correct rights, as far as I can tell and if I copy this file to my PC, rename it to image.jpg I'm able to open it with standard image viewers.

      Furthermore, if I open the attachement throu osTicket, I get the following URL:
      https://(mydomain)/file.php?key=2ir5lcmcp7v71rfqneppmx9ydufahsfq&expires=1550880000&signature=(some value) - where the key coincides with the filename above (except for upper- and lower-case letters).
      If I use the browser inspector, there is a file stream with correct length, so the image seems to be transferred.

      !!! But, no image is displayed !!!

      a month later

      Same problem, I follow.
      User attachment is not loaded into the ticket. OsTicket 1.11 - PHP 5.6 or 7.1 - MySQL 5.6

      22 days later

      I'm also having this same issue. One difference for me might be that I'm also running osTicketAwesome. I tried uninstalling the filesystem attachments plugin, but that made no difference.

      @nminaker
      I would say:
      Step 1 - uninstall the mod. Test again. [we do not support modded installations]
      Step 2 - downgrade PHP to 7.2. Test again. [osTicket does not support PHP 7.3 at this time]

      I am having the same issue. No Plugins. 1.11 and my PHP is 5.6.38
      Seems like if I reboot the server that its on it will work for some time but then stops.

      Same problem here.
      In my case, the file storage is database.
      The theme used is osTicket Awesome.
      osTicket v1.10.4 (035fd0a)

      Here is one of the entry I find in the logs:

      [INSERT INTO ost_attachment SET file_id = 21754, type = 'D', object_id = 21]

      Duplicate entry '21-21754-D' for key 'file-type'<br />
      <br />
      ---- Backtrace ----<br />
      #0 (root)/include/mysqli.php(204): osTicket->logDBError('DB Error #1062', '[INSERT INTO o...')<br />
      #1 (root)/include/class.orm.php(3136): db_query('INSERT INTO
      os...', true, true)<br />
      #2 (root)/include/class.orm.php(597): MySqlExecutor->execute()<br />
      #3 (root)/include/class.attachment.php(161): VerySimpleModel->save()<br />
      #4 (root)/include/ajax.draft.php(101): GenericAttachments->upload(Array)<br />
      #5 (root)/include/ajax.draft.php(300): DraftAjaxAPI->_uploadInlineImage(Object(Draft))<br />
      #6 [internal function]: DraftAjaxAPI->uploadInlineImage('21')<br />
      #7 (root)/include/class.dispatcher.php(145): call_user_func_array(Array, Array)<br />
      #8 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('21/attach', Array)<br />
      #9 (root)/include/class.dispatcher.php(120): Dispatcher->resolve('21/attach', Array)<br />
      #10 (root)/include/class.dispatcher.php(38): UrlMatcher->dispatch('/draft/21/attac...', NULL)<br />
      #11 (root)/scp/ajax.php(264): Dispatcher->resolve('/draft/21/attac...')<br />
      #12 {main}

        @btodd if it works and then stops working it is likely a problem with your filesystem or webserver. You should consult your error logs and trouble shot that.

        leleswam You do not appear to be experiencing the same issue your not even configured the same way. Please do not hijack someone else's thread and please start your own thread. Again we do not support modded instances so you will need to uninstall the custom theme mod for support. Also that version is old you should upgrade to current.

        Write a Reply...