Bug in File Upload (PDF, ZIP) - Error 422 #253

Closed
opened 2026-02-04 18:06:22 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @Camo2601 on GitHub (Feb 3, 2017).

  • BookStack Version: v0.14.1
  • PHP Version: PHP 7.0.8-0ubuntu0.16.04.3
  • MySQL Version: 5.7.17-0ubuntu0.16.04.1
Expected Behavior

Successfully upload a PDF to a Site

Actual Behavior

Some PDFs are accepted and some are rejected with a 422 error. Same for ZIP archives. The validation seems to be the issue here. As a temporary workaround I removed the validation call here: 3595ac2551/app/Http/Controllers/AttachmentController.php (L37)

Could you please take a look at this one?

Originally created by @Camo2601 on GitHub (Feb 3, 2017). * BookStack Version: v0.14.1 * PHP Version: PHP 7.0.8-0ubuntu0.16.04.3 * MySQL Version: 5.7.17-0ubuntu0.16.04.1 ##### Expected Behavior Successfully upload a PDF to a Site ##### Actual Behavior Some PDFs are accepted and some are rejected with a 422 error. Same for ZIP archives. The validation seems to be the issue here. As a temporary workaround I removed the validation call here: https://github.com/BookStackApp/BookStack/blob/3595ac25517ad162859ddba0747bfe9dd43b7542/app/Http/Controllers/AttachmentController.php#L37 Could you please take a look at this one?
Author
Owner

@ssddanbrown commented on GitHub (Feb 23, 2017):

Hi @Camo2601, Sorry for my late reply. Do the rejected files differ to the accepted files in any obvious way? Do your perhaps have an example of a rejected file that you could share?

@ssddanbrown commented on GitHub (Feb 23, 2017): Hi @Camo2601, Sorry for my late reply. Do the rejected files differ to the accepted files in any obvious way? Do your perhaps have an example of a rejected file that you could share?
Author
Owner

@Camo2601 commented on GitHub (Feb 24, 2017):

Hi there! I can't find any obvious differences really. I'll email you a PDF that resulted in said error both on our servers as well as on the demo server. Thank you for taking a look into this issue :)

@Camo2601 commented on GitHub (Feb 24, 2017): Hi there! I can't find any obvious differences really. I'll email you a PDF that resulted in said error both on our servers as well as on the demo server. Thank you for taking a look into this issue :)
Author
Owner

@ssddanbrown commented on GitHub (Feb 25, 2017):

Hi @Camo2601, Thanks for sending me that file. I've tested the file on my dev and demo instance and it worked without issue. Could it possibly be filesize upload limits on your server?

What OS are you running BookStack on?

@ssddanbrown commented on GitHub (Feb 25, 2017): Hi @Camo2601, Thanks for sending me that file. I've tested the file on my dev and demo instance and it worked without issue. Could it possibly be filesize upload limits on your server? What OS are you running BookStack on?
Author
Owner

@ofinker commented on GitHub (Feb 27, 2017):

hi @ssddanbrown - did you change something on your demo instance in the past weeks? as we had tried uploading the same file to the demo server too a few days ago and it didn't work there either.

We tried uploading it on the demo server today again and since it worked, we dug deeper into the issue. We were able to resolve the problem in the end by reloading the php7.0-fpm module directly, as the restarting of the nginx webserver did not lead to updating the upload limits as expected.

Thank you for your help!

@ofinker commented on GitHub (Feb 27, 2017): hi @ssddanbrown - did you change something on your demo instance in the past weeks? as we had tried uploading the same file to the demo server too a few days ago and it didn't work there either. We tried uploading it on the demo server today again and since it worked, we dug deeper into the issue. We were able to resolve the problem in the end by reloading the php7.0-fpm module directly, as the restarting of the nginx webserver did not lead to updating the upload limits as expected. Thank you for your help!
Author
Owner

@ssddanbrown commented on GitHub (Feb 27, 2017):

@ofinker I've taken it out of debug mode but other than that I'm not sure.

Glad you've fixed the issue!

@ssddanbrown commented on GitHub (Feb 27, 2017): @ofinker I've taken it out of debug mode but other than that I'm not sure. Glad you've fixed the issue!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#253