Article ID: 125992, created on Jun 18, 2015, last review on Jun 18, 2015

  • Applies to:
  • Plesk Automation 11.5

Symptoms

The migration to PA fails with error 504 Gateway Time-out and output as below:

Detailed Migration Status
¦
L Client 'client'
   ¦   
   L Subscription 'example.org'     
     ¦     
     + error: Failed to restore file permissions.     
     ¦ Exception: HttpClientError(HTTP Error 504: Gateway Time-out, '<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body bgcolor="white">\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n')     

Cause

The API requests from PA to Plesk takes much time, so the API requests are interrupted after timeout expires and the migration fails.

Resolution

In order to fix the issue increase timeouts for sw-cp-server and sw-engine on the management node as follows:

  1. Increase request_terminate_timeout in /etc/sw-engine/pool.d/plesk.conf:

    request_terminate_timeout = 600s
    

    If you want to track slow queries, you can enable thie logging by uncommeting these lines:

    ;slowlog = /var/log/sw-cp-server/slow.log
    ;request_slowlog_timeout = 10s
    
  2. Increase the following values in the /etc/sw-cp-server/config file:

    fastcgi_read_timeout 600;
    fastcgi_send_timeout 600;
    

    and increaser buffers:

    fastcgi_buffers 8 128k;
    fastcgi_buffer_size 256k;
    
  3. Restart Plesk services:

    /etc/init.d/sw-cp-server restart
    /etc/init.d/sw-engine restart
    

Search Words

HTTP Error 504

Exception: HttpClientError

504 Gateway Time-out

HTTP Error 504: Gateway Time-out

Move subscription

Exception: HttpClientError(HTTP Error 504: Gateway Time-out, '<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body bgcolor="white">\r\n<center><h1>504 Gateway Time-out</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n')

33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065 e0aff7830fa22f92062ee4db78133079

Email subscription for changes to this article
Save as PDF