Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket printing issue and attachments not storing/opening correctly #579

Closed
josh1856 opened this issue Jun 3, 2013 · 21 comments
Closed
Assignees
Labels

Comments

@josh1856
Copy link

josh1856 commented Jun 3, 2013

After updating to the latest version via pull. Started receiving random errors:

  • When in a ticket and click the print function receiving the following error: FPDF error: Some data has already been output, can't send PDF file
  • When SOME attached files more specifically .xls, .jpg, .docx come into the system via fetch or web creation they are stored or delivered in corrupted format. PDF files and .pptx seem to work fine.
@josh1856
Copy link
Author

josh1856 commented Jun 3, 2013

Here are some examples
doc_test
xls_test
ticket_print

@josh1856
Copy link
Author

josh1856 commented Jun 3, 2013

I was able to solve the printing ticket issue by cleaning the headers by adding the following to class.pdf.php after line 51. Would someone please verify the code and add if necessary.

50 //report header...most stuff are hard coded for now...
51 function Header() {
52 while (ob_get_level())
53 ob_end_clean();
54 header("Content-Encoding: None", true);
55 global $cfg;

@FourFoot
Copy link

FourFoot commented Jun 5, 2013

Just following this, but we're seeing a corruption issue on all attachments coming through email pipe. Tested with .docx, .pdf, .jpg, .png, .psd, .xlsx file sizes ranging from 10KB through to 22MB

@josh1856
Copy link
Author

josh1856 commented Jun 5, 2013

I have confirmed .zip files as well. I also tried a number of sizes and it does not seem to matter what size the document is it corrupts the document. Although I am able to get ALL sized pdf files to work.

@FourFoot
Copy link

FourFoot commented Jun 5, 2013

Seems to be fine if we retrieve the emails via POP3. We've experienced attachment corruption issues on other software when the email was piped directly to it (it added odd characters to the end of the file, which is what we're seeing in the file chunks OsTicket creates), turned out to be due to the MIME encoding of the email/attachment, might be similar problem here...

@greezybacon
Copy link
Contributor

How did you guys come across this issue? Is this a streamed (git tracking) upgrade or a fresh install?

I'm just wondering where I should go and start looking for culprits?

@josh1856
Copy link
Author

josh1856 commented Jun 5, 2013

My issue came up when I did a gitpul upgrade. Prior to the last update everything worked flawless.

@FourFoot
Copy link

FourFoot commented Jun 5, 2013

I found this attachment corruption on piped emails issue on a fresh 1.7.0 install from osticket.com an update from github about 6hrs ago didn't change it.

@josh1856
Copy link
Author

josh1856 commented Jun 5, 2013

I am able to replicate this issue via regardless of pull/creation method IMAP/POP3 or uploading to the public portal directly. So it must have something to do with FILE CHUNKS!

@josh1856
Copy link
Author

josh1856 commented Jun 5, 2013

I just did a fresh install and was able to replicate the issue also. Greezybacon were you able to replicate? Fourfoot what version of MySQL re you using?

@FourFoot
Copy link

FourFoot commented Jun 6, 2013

MySQL version is 5.1.69-cll. However, for me on the fresh install uploads via the /scp/ panel are fine, and emailed via POP3 are fine - just when they're directly piped that's causing me an issue. Using the same files for testing each time. Are you experiencing the issue with ALL methods on the fresh install?

@josh1856
Copy link
Author

josh1856 commented Jun 6, 2013

It is happening on all methods with mine on upgrade and fresh install. I also tested it on a backup of a fully working version and then upgraded. Tickets that were created prior to the upgrade open properly and once the upgrade is completed the previously created/closed ticket attachments no longer open attachments properly. All previous PDF files open correctly. Errors are still created opening .xls, .tiff, .jpg, .png. Perhaps the issue lies in the pull/fetch request?

@josh1856
Copy link
Author

josh1856 commented Jun 6, 2013

I am on MySQL 5.0.77

@josh1856
Copy link
Author

josh1856 commented Jun 7, 2013

Greezybacon did you replicate?

@greezybacon
Copy link
Contributor

Josh, honestly I haven't had time to review it yet. My hunch is that the problem is in the http response code rather than the database fetch code

@josh1856
Copy link
Author

josh1856 commented Jun 9, 2013

Greezybacon did you change the http response code in Ny recent updates?

@greezybacon
Copy link
Contributor

I believe this is fixed in #583, can someone verify

@josh1856
Copy link
Author

Confirmed fixed.

@greezybacon
Copy link
Contributor

@josh1856, the fix is merged, and I added a test to find leading and trailing whitespace in the code in hopes of avoiding this issue again in the future.

@ghost ghost assigned greezybacon Jun 13, 2013
@josh1856
Copy link
Author

Glad we got it fixed and I could help. Did you commit the print issue?

@greezybacon
Copy link
Contributor

#536 is a different issue. The email address does not fit in the space given on the PDF output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants