Jump to content

504 Timeout or weird symbols when uploading a file


Recommended Posts

I'm facing an issue where uploading a file with more than one photo, results in very long processing that usually ends with PHP child exit (timeout). The issue first occured when we switch to a more powerful VPS, where I've had to install and configure PHP. The issue both happens on 7.4 (production site + clean test install) and 8.0 (clean test install).

Sadly, I'm not getting any errors that may point me to the problem. PHP logs:

[09-Oct-2022 00:00:01] NOTICE: error log file re-opened
[09-Oct-2022 13:40:49] NOTICE: Terminating ...
[09-Oct-2022 13:40:49] NOTICE: exiting, bye-bye!
[09-Oct-2022 13:40:49] NOTICE: fpm is running, pid 3864656
[09-Oct-2022 13:40:49] NOTICE: ready to handle connections
[09-Oct-2022 13:40:49] NOTICE: systemd monitor interval set to 10000ms
[12-Oct-2022 20:09:37] NOTICE: Terminating ...
[12-Oct-2022 20:09:37] NOTICE: exiting, bye-bye!
[12-Oct-2022 20:09:37] NOTICE: fpm is running, pid 3970713
[12-Oct-2022 20:09:37] NOTICE: ready to handle connections
[12-Oct-2022 20:09:37] NOTICE: systemd monitor interval set to 10000ms
[14-Oct-2022 21:38:00] WARNING: [pool www] child 4023417 exited with code 124 after 322.923399 seconds from start
[14-Oct-2022 21:38:00] NOTICE: [pool www] child 4023548 started
[14-Oct-2022 21:49:29] WARNING: [pool www] child 4020578 exited with code 124 after 10309.977722 seconds from start
[14-Oct-2022 21:49:29] NOTICE: [pool www] child 4023909 started

Apache logs:

[Fri Oct 14 00:00:01.653125 2022] [mpm_prefork:notice] [pid 3864704] AH00163: Apache/2.4.54 (Debian) OpenSSL/1.1.1n configured -- resuming normal operations
[Fri Oct 14 00:00:01.653175 2022] [core:notice] [pid 3864704] AH00094: Command line: '/usr/sbin/apache2'
[Fri Oct 14 21:20:49.692260 2022] [proxy_fcgi:error] [pid 4022796] (70007)The timeout specified has expired: [client <IP>:58690] AH01075: Error dispatching request to : (polling), referer: https://polishemergencyv.com/file/<file-name>/?do=newVersion
[Fri Oct 14 21:37:58.417042 2022] [proxy_fcgi:error] [pid 4023416] (70007)The timeout specified has expired: [client <IP>:41485] AH01075: Error dispatching request to : (polling), referer: https://polishemergencyv.com/file/<file-name>/?do=newVersion
[Fri Oct 14 21:49:26.555609 2022] [proxy_fcgi:error] [pid 4023825] (70007)The timeout specified has expired: [client <IP>:56290] AH01075: Error dispatching request to : (polling), referer: https://polishemergencyv.com/file/<file-name>/?do=newVersion

 

I've tried increasing Apache2 timeout config value and some of the PHP values:

  • max_execution_time
  • max_input_time
  • memory_limit
  • post_max_size
  • upload_max_filesize
  • max_file_uploads

After a lot of tries to fix it, it seems that images are causing it, not the file itself. Disabling the watermark system did not work, smaller images also, choosing to not keep the previous file version - same.

Sometimes instead of the timeout I get a page full of weird, random symbols, mostly non-ASCII (I think?). While writing this post, it only happened once, but it results in a different PHP error:

[Fri Oct 14 22:21:21.294569 2022] [proxy_fcgi:error] [pid 4024337] [client <IP>:42405] AH01071: Got error 'PHP message: PHP Fatal error:  Maximum execution time of 300 seconds exceeded in /var/www/polishemergencyv.com/system/Image/Gd.php on line 150', referer: https://polishemergencyv.com/file/124-hdfghdhfhghfdhgfhfdgfdhg/?do=newVersion
[Fri Oct 14 22:31:49.292785 2022] [proxy_fcgi:error] [pid 4024472] [client <IP>:42537] AH01067: Failed to read FastCGI header, referer: https://polishemergencyv.com/file/124-hdfghdhfhghfdhgfhfdgfdhg/?do=newVersion
[Fri Oct 14 22:31:49.292843 2022] [proxy_fcgi:error] [pid 4024472] (104)Connection reset by peer: [client <IP>:42537] AH01075: Error dispatching request to : , referer: https://polishemergencyv.com/file/124-hdfghdhfhghfdhgfhfdgfdhg/?do=newVersion

Could contain: Text, Word, Rug, Alphabet

 

Refreshing the page returns me to upload settings page, but for a file that doesn't actually exist (even though, screenshots, changelog and version name are from that file).
image.thumb.png.9753444130f34aae8f6463b138077ae5.png

 

No matter the error I get, the file (.zip) itself changes, but both version and changelog gets copied but unchanged
Could contain: Text, File


After attempting to remove the latest version, download button changes to this error:

[[Template downloads/front/view/downloadButton is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

 

I think I've covered most of the stuff.

Link to comment
Share on other sites

Unfortunately, what you are describing with image uploads and receiving weird characters would indicate that your server is not configured properly. I have moved your topic to our self-hosting support forum as this falls outside our scope of support, I'm afraid. You will want to work with your hosting provider to ensure your server is configured correctly.

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
On 11/1/2022 at 1:43 PM, HeavyWolfPL said:

Update, it seems I've fixed the issue (temporarily or permanently) by increasing the values for FPM; 

  • pm.max_children
  • pm.start_servers
  • pm.min_spare_servers
  • pm.max_spare_servers

Works on both PHP 7.4 and 8.0

Out of me having a similar looking issue (not getting 504's) what values did you set for FPM?

Link to comment
Share on other sites

On 6/11/2024 at 9:21 PM, JoramD said:

Out of me having a similar looking issue (not getting 504's) what values did you set for FPM?

I've just used recommended values at the end, but started high to see if it worked. There should be documentation somewhere on the web about suggested values.

Link to comment
Share on other sites

On 6/12/2024 at 4:03 PM, HeavyWolfPL said:

I've just used recommended values at the end, but started high to see if it worked. There should be documentation somewhere on the web about suggested values.

There is no way to say what value to use.  This depends on your server resources, how PHP is used (CGI, FPM, etc), and what else the server is doing.  IPS cannot tell folks how to specifically configure their server.  Instead individuals are recommended to know how to manage and troubleshoot their server or use the IPS cloud solution which would not require configuring things like Apache, PHP, mySQL, etc.  

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...