Starting on October 19, 2021, we will enable single-sign-on for our Plesk Support Center to provide a seamless login/account experience. This implies that you’ll be able to use a single account across any of our web-facing properties.
To be prepared for this change and to avoid the need to register during your next ticket submission after the change, we encourage you to create an account here before October 19 using the same email address as your current Zendesk login (support account). It’s essential that you use the same email address on our support center to ensure that your tickets stay attached to the same account. You will continue to use ZenDesk authentication until we switch over to single-sign-on on October 19th.

An operation or a script that takes more than 60 seconds to complete fails on a website hosted in Plesk: nginx 504 Gateway Time-out

Follow

Comments

20 comments

  • Avatar
    Kingsley Felix

    now is 502 error, plesk have started again

    0
    Comment actions Permalink
  • Avatar
    Pavel Mikhaylov (Edited )

    Hello iamkingsleyf,

    Do you experience the issue with 502 error at the moment?

    If you do, please let us know, what are other symptoms of the issue? What is in the subscription log files?

    I would also like to recommend contacting our support: https://www.plesk.com/contact-support

    0
    Comment actions Permalink
  • Avatar
    Kingsley Felix

    Yes i do but 504 error all 21 domains

    0
    Comment actions Permalink
  • Avatar
    Bulat Tsydenov

    @iamkingsleyf, the assistance with this issue was provided to you in scope of support ticket. If you need further assistance, please reply to the ticket.

    0
    Comment actions Permalink
  • Avatar
    yoyoy

    hello

    if you experience problems after modifying nginx.conf add the line proxy_connect_timeout 1200s;

    it could be useful ;)

    0
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    @yoyoy, yes, this is mentioned in step 1 of resolution.

    0
    Comment actions Permalink
  • Avatar
    Glenn

    I would also suggest limiting search time period so you're not searching logs months or years old:

    grep -R "upstream timed out" /var/www/vhosts/*/logs/ | grep "2018/10/3*" | wc -l &

    For example. 

    1
    Comment actions Permalink
  • Avatar
    Ivan Postnikov

    Hello @Glenn,

    Thank you for the hint, this command modification may be useful for other Pleskians.

    However, the command in symptom does not require modification in accordance with the present date and is more universal.

    0
    Comment actions Permalink
  • Avatar
    Glenn

    Hi Ivan,

    When I ran the command without a date limit, the result was 12000+ and according to my tech, was parsing logs more than a year old. It's was an insanely high number.

    When we ran it with date limit I got a more reasonable and realistic number of approx. 1100 and adjusted fcgi to 1200s. 

    Thanks for feedback.

     

    0
    Comment actions Permalink
  • Avatar
    Jerome Nameche

    Hi Guys,

    I did the following on my Plesk. and it really helps me to make heavier request on my woocommerce webshop syncing several products with sub-webshops.

    Still, I have a big issue:

    Despite these lines of code in my php-settings. I can still get 504 get away error and when I have it. my server is then down for 5 long minutes ! I then try to load simply the homepage and it's white charging during 1 minutes and finally displaying the lovely 504.

    why the server is getting stuck like this?? how to avoid that?
    I don't see any peak of CPU or memory usage during these 5 minutes.

    How can I know what are the optimale timeout limits?! If I increase too much these values I also think server will crash.

    thx in advance !!

    I need help and knowledge here..please 

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Jerome Nameche

    Hi! The needed timeout values should be determined based on many parameters: the load on the server, the domain number, the code of domains etc. etc. You may try to increase the values a little bit and monitor the server: if the issue persists, increase the values again and repeat it if necessary.
    As for the stuck server: it is needed to check the /var/log/messages or /var/log/syslog to find additional information about what is happening on the server, the timeout values might not be the root cause of the issue. Anyway, I recommend you to create a ticket as per https://support.plesk.com/hc/en-us/articles/213608509-How-to-submit-a-request-to-Plesk-support- to investigate the issue in more details.

    0
    Comment actions Permalink
  • Avatar
    Jack Lee

    I get this exact error.

    Added

    proxy_send_timeout 1200s;
    proxy_read_timeout 1200s;
    fastcgi_send_timeout 1200s;
    fastcgi_read_timeout 1200s;

     

    Changing the configuration removes the error, but NGINX still stops. By this I mean I have a PHP script outputting to the display. PHP keeps running, but after 60 seconds the display ceases to be updated. But PHP completes several minutes later. 

    The NGINX error log has no entry. The Server logs have no entry. The PHP log has no entry.  

    0
    Comment actions Permalink
  • Avatar
    Dinara Aspembitova (Edited )
    Hello @Jack Lee,
     
    You can use strace to check the issue https://linux.die.net/man/1/strace
     
    For example, in the following way:
    --------------
    strace -ff -s 400  <comamnd to run php script> 2>&1 | tee strace111.log
    --------------
     
    When "the display ceases to be updated", stop the command and check created strace111.log file.
     
    Alternatively, you can create a ticket  as described here https://support.plesk.com/hc/en-us/articles/213608509 
     
     
    0
    Comment actions Permalink
  • Avatar
    Jeff Hanes

    Don't forget to restart both Apache and Nginx!

    0
    Comment actions Permalink
  • Avatar
    Alisa Kasyanova

    @Jeff Hanes
    When you press OK in Apache & nginx Settings, both Apache and nginx are restarted

    0
    Comment actions Permalink
  • Avatar
    Jan Bludau

    solved the problem server wide :-)

    0
    Comment actions Permalink
  • Avatar
    Felix Schulze

    @Jan Bludau How did you solve that server wide?

    0
    Comment actions Permalink
  • Avatar
    Denis Bykov

    @Felix Schulze

    I assume that using the second part of resolution, by editing /etc/nginx/nginx.conf file.

    0
    Comment actions Permalink
  • Avatar
    Nicolas Loison1

    Hello,

    Setting these values:

    proxy_connect_timeout 180s;
    proxy_send_timeout 180s;
    proxy_read_timeout 180s;
    fastcgi_send_timeout 180s;
    fastcgi_read_timeout 180s

    doesn't change anything, always 504 after 60s. Plesk 18.0.34, PHP-FPM 7.4.18, FPM served by Nginx.

    Is there any bug that don't take care about the parameters set ?

    Best

    Nico

    0
    Comment actions Permalink
  • Avatar
    shai
    Invalid nginx configuration: nginx: [emerg] "proxy_read_timeout" directive is duplicate in /mnt/files/vhosts/system/XXXXXX/conf/vhost_nginx.conf:3 nginx: configuration file /etc/nginx/nginx.conf test failed
     
    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request