504 ошибка prestashop

I’ve got a dedicated server 

configuration test script told me  — it’s ok — see atached screenshot

Nginx options were increased, but the last step of installation stopped with with error: 1: «HTTP 504 — error — 504 Gateway Time-out»

Could you help any workaround how to finish installation? 😞 

————

fastcgi_connect_timeout 600
fastcgi_read_timeout 1000
fastcgi_send_timeout 1000
memory_limit =  256M
post_max_size = 128M
upload_max_filesize = 128M
max_input_vars = 5000
proxy_connect_timeout 600s
proxy_send_timeout 600
proxy_read_timeout 600
default_socket_timeout 600

————— 

server-config.png

error-504.png

settings-ini.png

Everyone expects their websites to work smoothly.

But, this situation may change anytime and your website may show unexpected errors.

One such error is 504 gateway time-out on your Prestashop website.

At Bobcares, we help customers resolve website errors as part of our Dedicated Support Services.

Today, we’ll discuss the top 6 reasons for this error and how we fix them.

504 gateway time-out in Prestashop – What this means?

Website owners usually face this error when installing a new version of Prestashop, updating a new product from backoffice, etc.

Firstly, our Support Experts enable Prestashop debug mode from backoffice. This helps us to know if there is any other underlying error message.

For example, in Prestashop 1.5.3 -1.6, we enable it by adding the below parameter in the file config/defines.inc.php.

define('_PS_MODE_DEV_', true);

Similarly, in Prestashop 1.4 – 1.5.3, we enable debug mode by adding the below parameter in the file config/config.inc.php.

@ini_set('display_errors', 'on');

And, once we’re done with the troubleshooting, we’ll disable error reporting, because leaving debug mode enabled can give unpredictable results to visitors.

504 gateway time-out in Prestashop – Causes & Fixes

Now, let’s see the main reasons for this error and how our Support Engineers fix them.

1) Client side issues

Misconfigurations at the client side can result in “504 gateway time-out error in Prestashop”. It can be due to various reasons like:

  • Improper browser settings or browser cache.
  • Temporary problems with the network devices such as modems, routers, etc.
  • Incorrect proxy settings in the browser or application.
  • Network issues at the ISP end.
How we fix?

Our Support Engineers make customers test these things to confirm that there are no problems at the client side.

  • Double check the browser settings and ask them to access their Prestashop application after clearing the browser cache.
  • Try to load from another browser or from incognito window.
  • Restart network devices such as router, modem, etc. and confirm that they have been configured correctly.
  • Review the proxy settings used in the browser or user’s application.
  • Check if there is any problems with their ISP.

If everything works fine, then we do the rest of the checks to identify the issues at the server side.

2) Proxy timeout values

Proxy errors are not always due to insufficient resources. It’s also possible that the proxy has been configured incorrectly. As a result, the proxy server times out before processing the request. Similarly, complex and long running scripts which takes longer time to complete the execution also results in this error.

For example, we’ve seen instances where website throws 504 gateway time-out error in Prestashop with Nginx configured as the reverse proxy.

How we fix?

Our Support Engineers solve this timeout problem by tweaking certain values in the proxy or the web server configuration file. For instance, we adjust the following parameters in the Nginx reverse proxy configuration file nginx.conf to increase the timeout values.

proxy_connect_timeout
proxy_send_timeout
proxy_read_timeout
send_timeout

Similarly, for servers with Nginx and FastCGI(PHP-FPM), our Support Experts resolve this problem by adjusting the parameter max_execution_time in php.ini and request_terminate_timeout  in www.conf files. In addition to that, we adjust the following parameters in the Nginx file.


fastcgi_send_timeout
fastcgi_read_timeout

Most importantly, we restart the necessary services such as nginx, php-fpm to bring the changes into effect.

[Need to adjust the proxy settings on your server? Our experienced Server Administrators can help you.]

3) DNS issues

Similarly, 504 gateway time-out prestashop errors can sometimes be a result of incorrect DNS settings. It can be at the server side or the at client side. Let’s first check the issues that can happen at server side.

DNS changes are often required after domain migration, hosting provider switch, etc. So, it’s important to wait for the DNS changes to propagate globally. So, when the customer browses the website or perform updates during the propagation period, timeout error may occur.

That’s why, our Support Engineers reduce the TTL values during migration, inorder to reduce the propagation delay period.

Likewise, the DNS caching issues at the client side can also lead to this error. The DNS cache on the user’s system stores records of all the recent visits. And, if the DNS cache contain old records, it’ll throw errors.

How we fix?

Here, our Support Experts check if the DNS propagation period is complete using the dig command.

dig +trace domain.com

If not, we’ll ask the customer to check after the DNS propagation period. If there are any DNS resolution errors, we’ll fix them immediately.

Similarly, if we identify that the issue is on the client side, we’ll help the customers to clear their local DNS cache. For example, we use the below command to clear the DNS cache in Windows.

ipconfig /flushdns

4) Server issues

The next step is to check whether the problem lies at the server side. We’ve seen instance where the server becomes unresponsive due to heavy load. It can be due to ongoing DDOS attack, heavy website traffic, a compromised server, application bugs causing resource outages, etc.

Sometimes, the web server which handles the incoming requests become too slow due to performance problems or heavy traffic. Similarly, network problems between the proxy server and the web server can cause delays in getting response for HTTP requests.

How we fix?

Our Support Experts check the server and identify the abused resource. We then find out which service is abusing the resource. At this point, we identify the user who owns the malicious script or software. Finally, we remove or disable this abusive script.

Similarly, if we find there are no enough resources in the server to process the valid incoming requests, the only solution is to upgrade the resources on the server.

For slow web servers, our Server experts optimize web server and tweak it’s configuration parameters to solve the problem.

[Need help in resolving the frequent load issues on your server? Click here and get one of our Server Experts to fix it for you.]

5) Issues with CDN

Website owners use CDNs(Content Delivery Network) to serve contents faster. However, if it’s not properly configured, it can result in errors. The common errors that we’ve seen are the IP address of the website not set in CDN, firewall blocking CDN, etc.

How we fix?

Our Support Experts verify if CDN is creating problems by temporarily disabling the CDN service for the domain. If the website worked well, we’ll review the CDN settings and correct the misconfiguration.

6) Website configuration issues

Last but not least, Prestashop configuration issues can also lead to this error.

In other words, corrupted databases, faulty extensions or themes, incorrect configuration can always create problems.

How we fix?

Firstly, our Support Experts check the database logs to identify the corrupted databases. Once identified, we repair the database using the mysqlcheck command. Also, we always backup the database before making any changes.

mysqlcheck -r DATABASE

Replace DATABASE with original database name.

Similarly, we’ll disable each of the themes/extensions one by one to identify the faulty one. If the website works fine, we upload a fresh copy of the theme/extension. If not, then only the theme developer can fix it.

[Need to recover the corrupted database on your server? We can help you here.]

Conclusion

In short, 504 gateway time-out in Prestashop can occur due to proxy timeout values, DNS issue and more. Today, we’ve discussed the top 6 reasons for this error and how our Dedicated Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

My installation meets all of the requires shown by phppsinfo.php.

The issue is the time that the installation takes. On my development system, the Fast CGI interface had a default execution time limit of 60 seconds although my PHP max_execution_time was 90 seconds. The Fast CGI timeout was the error reported. On a shared hosting package at, say, hostgator.com (where I managed multiple websites), it is possible to modify the php.ini file, but not the Apache/PHP interface timeout. So my concern is that the installation time may be exceeded for other users who are using shared hosting packages where they cannot increase the execution time limit of the web server/PHP interface.

Although I am able to engineer a workaround on my development system, others may not be able to do so. So the open issue, I think, is whether the installation is taking longer than expected and can that time be reduced so that installation on shared hosting packages is more likely to work. Until those questions have been answered, I’d recommend leaving the issue open, but at a low priority.

From: khouloudbelguith <notifications@github.com>
Sent: Monday, February 18, 2019 12:15 AM
To: PrestaShop/PrestaShop <PrestaShop@noreply.github.com>
Cc: ivordurham <ivor.durham@ivor.cc>; Mention <mention@noreply.github.com>
Subject: Re: [PrestaShop/PrestaShop] PS 1.7.5 database initialization fails with 504 Gateway Timeout error (#12599)

Hi @ivordurham <https://github.com/ivordurham> ,

Thanks for your report.
To install PrestaShop, we need to set memory_limit to «128M», it is required, you can follow this link <https://www.prestashop.com/en/system-requirements> .
Also, you can follow this link: https://github.com/PrestaShop/php-ps-info
phppsinfo file provides an equivalent to the phpinfo() function that reports PrestaShop Requirements information about the PHP/MySQL/Apache environment and offers suggestions for improvement.

1. Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file.
2. Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phppsinfo.php, replacing example.com with your own domain name.
3. Now you can view all of the information about PHP for your server for that particular directory.

About your issue, since it is fixed, can I close the issue?
Thanks!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#12599 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AGSbYDXNN1F4MMj09vuh-E4gbcfk6QdAks5vOmEQgaJpZM4a-kEK> . <https://github.com/notifications/beacon/AGSbYC67jzxEy_acaVQsWfhEeSKkoCr9ks5vOmEQgaJpZM4a-kEK.gif>

Вообщем есть VPS на котором развернута связка php 5.4 + mysql + nginx.
Используется движок Prestashop 1.6.1.4.
При импорте товаров и категорий из CSV файла, примерно через 30 секунд возникает ошибка «504 Gateway Time-out».
Я так понимаю, что проблема в том, что скрипт перестает выполняться по таймауту.
Куда копать и как правильно решить проблему?

В файлах /etc/php5/cli/php.ini и cat /etc/php5/fpm/php.ini

max_execution_time = 3600

В файле /etc/nginx/nginx.conf

user www-data;
worker_processes 1;
worker_cpu_affinity 0101 1010;
timer_resolution 100ms;
worker_rlimit_nofile 8192;
worker_priority -10;
pid /run/nginx.pid;

events {
    worker_connections 2048;
    # multi_accept on;
}

http {

    ##
    # Basic Settings
    ##



    reset_timedout_connection on;
    client_header_timeout 3600 ;
    client_body_timeout 3600;

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 3600;
    proxy_connect_timeout 3600;
    proxy_send_timeout 3600;
    proxy_read_timeout 3600;
    send_timeout 3600;
    types_hash_max_size 2048;
    # server_tokens off;

    client_max_body_size 100m;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    ##
    # Gzip Settings
    ##

    gzip on;
    gzip_disable "msie6";

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

Part 4 : How to fix Nginx 504 Gateway Time-out for PrestaShop 1.7.6.3 on CWP7?

Welcome to our serious tutorial. When we are installing PrestaShop 1.7.6.3 on CWP7.pro server, we are getting error «Nginx 504 Gateway Time-out » That means CWP The gateway did not receive a timely response from the upstream server or application.

1. Adjust Timeout Value  for proxy settings 

# vi /etc/nginx/proxy.inc

proxy_connect_timeout 600s;
proxy_send_timeout 600;
proxy_read_timeout 600;

2. Change the default_socket_timeout 

# vi /opt/alt/php-fpm72/usr/php/php.ini

default_socket_timeout 600

Change PHP-FPM Configuration:

Default Location:

/opt/alt/php-fpm72/usr/etc/
/opt/alt/php-fpm72/usr/etc/php-fpm.d/
/opt/alt/php-fpm72/usr/etc/php-fpm.d/users/

3. Add following value cwpsvc.conf file :

 # vi /opt/alt/php-fpm72/usr/etc/php-fpm.d/cwpsvc.conf

[cwpsvc]
listen = /opt/alt/php-fpm72/usr/var/sockets/cwpsvc.sock
listen.owner = cwpsvc
listen.group = cwpsvc
listen.mode = 0640
user = cwpsvc
group = cwpsvc

;request_slowlog_timeout = 5s
;slowlog = /opt/alt/php-fpm72/usr/var/log/php-fpm-slowlog-cwpsvc.log
listen.allowed_clients = 127.0.0.1

pm = ondemand
pm.max_children = 1000
pm.process_idle_timeout = 300s
;listen.backlog = -1
request_terminate_timeout = 300s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
env[PATH] = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

4. Add following value nobody.conf file :

# vi /opt/alt/php-fpm72/usr/etc/php-fpm.d/users/nobody.conf

[nobody]
listen = /opt/alt/php-fpm72/usr/var/sockets/nobody.sock
listen.allowed_clients = 127.0.0.1

listen.owner = nobody
listen.group = nobody
listen.mode = 0660
user = nobody
group = nobody

;request_slowlog_timeout = 15s
;slowlog = /opt/alt/php-fpm72/usr/var/log/php-fpm-slowlog-nobody.log

pm = ondemand
pm.max_children = 1000
pm.max_requests = 6000
pm.process_idle_timeout = 300s

;listen.backlog = -1
request_terminate_timeout = 300s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /tmp
env[TMPDIR] = /tmp
env[TEMP] = /tmp
env[PATH] = /usr/local/bin:/usr/bin:/bin

5. Change the following 

# vi /opt/alt/php-fpm72/usr/etc/php-fpm.d/users/datahead.conf

[datahead]
listen = /opt/alt/php-fpm72/usr/var/sockets/datahead.sock
listen.allowed_clients = 127.0.0.1

;listen.owner = "datahead"
listen.group = "nobody"
listen.mode = 0660
user = "datahead"
group = "datahead"

;request_slowlog_timeout = 15s
;slowlog = /opt/alt/php-fpm72/usr/var/log/php-fpm-slowlog-datahead.log

pm = ondemand
pm.max_children = 1000
pm.max_requests = 4000
pm.process_idle_timeout = 300s

;listen.backlog = -1
request_terminate_timeout = 300s
rlimit_files = 131072
rlimit_core = unlimited
catch_workers_output = yes

env[HOSTNAME] = $HOSTNAME
env[TMP] = /home/datahead/tmp
env[TMPDIR] = /home/datahead/tmp
env[TEMP] = /home/datahead/tmp
env[PATH] = /usr/local/bin:/usr/bin:/bin

N.B: Change the value only which is only marked as Blue.

Now Llet’s add fastcgi_read_timeout variable inside our Nginx virtual host configuration. If you use PHP-FPM hosting then add (you can use 600s)

# vi /etc/nginx/conf.d/vhosts/datahead.biz.ssl.conf

 fastcgi_pass    unix:/opt/alt/php-fpm72/usr/var/sockets/datahead.sock;
 fastcgi_index   index.php;
        fastcgi_send_timeout 300s;
        fastcgi_read_timeout 300s;
 include         /etc/nginx/fastcgi_params;

If you use PHP-CGI , then use it nginx.conf file:

# Proxy settings
proxy_redirect      off;
proxy_set_header    Host            $host;
proxy_set_header    X-Real-IP       $remote_addr;
proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header   Set-Cookie;
proxy_connect_timeout   600;
proxy_send_timeout  600;
proxy_read_timeout  600;
fastcgi_send_timeout 600s;
fastcgi_read_timeout 600s;
proxy_buffers       32 4k;

If you use PHP Selector 2

# sed -i 's,^upload_max_filesize =.*$,upload_max_filesize = 4096M,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^post_max_size =.*$,post_max_size = 4146M,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^memory_limit =.*$,memory_limit = 5120M,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^max_input_time =.*$,max_input_time = 300,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^max_execution_time =.*$,max_execution_time = 300,' /opt/alt/php72/usr/php/php.ini

# sed -i 's,^; max_input_vars =.*$,max_input_vars = 5000,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^max_file_uploads =.*$,max_file_uploads = 50,' /opt/alt/php72/usr/php/php.ini

# sed -i 's,^allow_url_fopen =.*$,allow_url_fopen = On,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^allow_url_include =.*$,allow_url_include = Off,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^short_open_tag =.*$,short_open_tag = Off,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^;date.timezone =.*$,date.timezone = Asia/Dhaka,' /opt/alt/php72/usr/php/php.ini

# sed -i 's,^display_errors =.*$,display_errors = Off,' /opt/alt/php72/usr/php/php.ini
# sed -i 's,^expose_php =.*$,expose_php = Off,' /opt/alt/php72/usr/php/php.ini 

PHP Security

https://nixcp.com/hardening-php-on-cpanel/

https://docs.cpanel.net/knowledge-base/security/php-security-concepts/

https://www.cyberciti.biz/faq/linux-unix-apache-lighttpd-phpini-disable-functions/

https://www.cyberciti.biz/tips/php-security-best-practices-tutorial.html

PHP command line syntax checking

https://tecadmin.net/category/programming/php-2/

Everyone expects their websites to work smoothly.

But, this situation may change anytime and your website may show unexpected errors.

One such error is 504 gateway time-out on your Prestashop website.

At Bobcares, we help customers resolve website errors as part of our Dedicated Support Services.

Today, we’ll discuss the top 6 reasons for this error and how we fix them.

504 gateway time-out in Prestashop – What this means?

Website owners usually face this error when installing a new version of Prestashop, updating a new product from backoffice, etc.

Firstly, our Support Experts enable Prestashop debug mode from backoffice. This helps us to know if there is any other underlying error message.

For example, in Prestashop 1.5.3 -1.6, we enable it by adding the below parameter in the file config/defines.inc.php.

define('_PS_MODE_DEV_', true);

Similarly, in Prestashop 1.4 – 1.5.3, we enable debug mode by adding the below parameter in the file config/config.inc.php.

@ini_set('display_errors', 'on');

And, once we’re done with the troubleshooting, we’ll disable error reporting, because leaving debug mode enabled can give unpredictable results to visitors.

504 gateway time-out in Prestashop – Causes & Fixes

Now, let’s see the main reasons for this error and how our Support Engineers fix them.

1) Client side issues

Misconfigurations at the client side can result in “504 gateway time-out error in Prestashop”. It can be due to various reasons like:

  • Improper browser settings or browser cache.
  • Temporary problems with the network devices such as modems, routers, etc.
  • Incorrect proxy settings in the browser or application.
  • Network issues at the ISP end.
How we fix?

Our Support Engineers make customers test these things to confirm that there are no problems at the client side.

  • Double check the browser settings and ask them to access their Prestashop application after clearing the browser cache.
  • Try to load from another browser or from incognito window.
  • Restart network devices such as router, modem, etc. and confirm that they have been configured correctly.
  • Review the proxy settings used in the browser or user’s application.
  • Check if there is any problems with their ISP.

If everything works fine, then we do the rest of the checks to identify the issues at the server side.

2) Proxy timeout values

Proxy errors are not always due to insufficient resources. It’s also possible that the proxy has been configured incorrectly. As a result, the proxy server times out before processing the request. Similarly, complex and long running scripts which takes longer time to complete the execution also results in this error.

For example, we’ve seen instances where website throws 504 gateway time-out error in Prestashop with Nginx configured as the reverse proxy.

How we fix?

Our Support Engineers solve this timeout problem by tweaking certain values in the proxy or the web server configuration file. For instance, we adjust the following parameters in the Nginx reverse proxy configuration file nginx.conf to increase the timeout values.

proxy_connect_timeout
proxy_send_timeout
proxy_read_timeout
send_timeout

Similarly, for servers with Nginx and FastCGI(PHP-FPM), our Support Experts resolve this problem by adjusting the parameter max_execution_time in php.ini and request_terminate_timeout  in www.conf files. In addition to that, we adjust the following parameters in the Nginx file.


fastcgi_send_timeout
fastcgi_read_timeout

Most importantly, we restart the necessary services such as nginx, php-fpm to bring the changes into effect.

[Need to adjust the proxy settings on your server? Our experienced Server Administrators can help you.]

3) DNS issues

Similarly, 504 gateway time-out prestashop errors can sometimes be a result of incorrect DNS settings. It can be at the server side or the at client side. Let’s first check the issues that can happen at server side.

DNS changes are often required after domain migration, hosting provider switch, etc. So, it’s important to wait for the DNS changes to propagate globally. So, when the customer browses the website or perform updates during the propagation period, timeout error may occur.

That’s why, our Support Engineers reduce the TTL values during migration, inorder to reduce the propagation delay period.

Likewise, the DNS caching issues at the client side can also lead to this error. The DNS cache on the user’s system stores records of all the recent visits. And, if the DNS cache contain old records, it’ll throw errors.

How we fix?

Here, our Support Experts check if the DNS propagation period is complete using the dig command.

dig +trace domain.com

If not, we’ll ask the customer to check after the DNS propagation period. If there are any DNS resolution errors, we’ll fix them immediately.

Similarly, if we identify that the issue is on the client side, we’ll help the customers to clear their local DNS cache. For example, we use the below command to clear the DNS cache in Windows.

ipconfig /flushdns

4) Server issues

The next step is to check whether the problem lies at the server side. We’ve seen instance where the server becomes unresponsive due to heavy load. It can be due to ongoing DDOS attack, heavy website traffic, a compromised server, application bugs causing resource outages, etc.

Sometimes, the web server which handles the incoming requests become too slow due to performance problems or heavy traffic. Similarly, network problems between the proxy server and the web server can cause delays in getting response for HTTP requests.

How we fix?

Our Support Experts check the server and identify the abused resource. We then find out which service is abusing the resource. At this point, we identify the user who owns the malicious script or software. Finally, we remove or disable this abusive script.

Similarly, if we find there are no enough resources in the server to process the valid incoming requests, the only solution is to upgrade the resources on the server.

For slow web servers, our Server experts optimize web server and tweak it’s configuration parameters to solve the problem.

[Need help in resolving the frequent load issues on your server? Click here and get one of our Server Experts to fix it for you.]

5) Issues with CDN

Website owners use CDNs(Content Delivery Network) to serve contents faster. However, if it’s not properly configured, it can result in errors. The common errors that we’ve seen are the IP address of the website not set in CDN, firewall blocking CDN, etc.

How we fix?

Our Support Experts verify if CDN is creating problems by temporarily disabling the CDN service for the domain. If the website worked well, we’ll review the CDN settings and correct the misconfiguration.

6) Website configuration issues

Last but not least, Prestashop configuration issues can also lead to this error.

In other words, corrupted databases, faulty extensions or themes, incorrect configuration can always create problems.

How we fix?

Firstly, our Support Experts check the database logs to identify the corrupted databases. Once identified, we repair the database using the mysqlcheck command. Also, we always backup the database before making any changes.

mysqlcheck -r DATABASE

Replace DATABASE with original database name.

Similarly, we’ll disable each of the themes/extensions one by one to identify the faulty one. If the website works fine, we upload a fresh copy of the theme/extension. If not, then only the theme developer can fix it.

[Need to recover the corrupted database on your server? We can help you here.]

Conclusion

In short, 504 gateway time-out in Prestashop can occur due to proxy timeout values, DNS issue and more. Today, we’ve discussed the top 6 reasons for this error and how our Dedicated Engineers fix them.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

My installation meets all of the requires shown by phppsinfo.php.

The issue is the time that the installation takes. On my development system, the Fast CGI interface had a default execution time limit of 60 seconds although my PHP max_execution_time was 90 seconds. The Fast CGI timeout was the error reported. On a shared hosting package at, say, hostgator.com (where I managed multiple websites), it is possible to modify the php.ini file, but not the Apache/PHP interface timeout. So my concern is that the installation time may be exceeded for other users who are using shared hosting packages where they cannot increase the execution time limit of the web server/PHP interface.

Although I am able to engineer a workaround on my development system, others may not be able to do so. So the open issue, I think, is whether the installation is taking longer than expected and can that time be reduced so that installation on shared hosting packages is more likely to work. Until those questions have been answered, I’d recommend leaving the issue open, but at a low priority.

From: khouloudbelguith <notifications@github.com>
Sent: Monday, February 18, 2019 12:15 AM
To: PrestaShop/PrestaShop <PrestaShop@noreply.github.com>
Cc: ivordurham <ivor.durham@ivor.cc>; Mention <mention@noreply.github.com>
Subject: Re: [PrestaShop/PrestaShop] PS 1.7.5 database initialization fails with 504 Gateway Timeout error (#12599)

Hi @ivordurham <https://github.com/ivordurham> ,

Thanks for your report.
To install PrestaShop, we need to set memory_limit to «128M», it is required, you can follow this link <https://www.prestashop.com/en/system-requirements> .
Also, you can follow this link: https://github.com/PrestaShop/php-ps-info
phppsinfo file provides an equivalent to the phpinfo() function that reports PrestaShop Requirements information about the PHP/MySQL/Apache environment and offers suggestions for improvement.

1. Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file.
2. Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phppsinfo.php, replacing example.com with your own domain name.
3. Now you can view all of the information about PHP for your server for that particular directory.

About your issue, since it is fixed, can I close the issue?
Thanks!


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#12599 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AGSbYDXNN1F4MMj09vuh-E4gbcfk6QdAks5vOmEQgaJpZM4a-kEK> . <https://github.com/notifications/beacon/AGSbYC67jzxEy_acaVQsWfhEeSKkoCr9ks5vOmEQgaJpZM4a-kEK.gif>

‘504 gateway time-out’ in Prestashop – Here’s how to fix it

Everyone expects their websites to work smoothly.

But, this situation may change anytime and your website may show unexpected errors.

One such error is 504 gateway time-out on your Prestashop website.

At Bobcares, we help customers resolve website errors as part of our Dedicated Support Services.

Today, we’ll discuss the top 6 reasons for this error and how we fix them.

504 gateway time-out in Prestashop – What this means?

Website owners usually face this error when installing a new version of Prestashop, updating a new product from backoffice, etc.

Firstly, our Support Experts enable Prestashop debug mode from backoffice. This helps us to know if there is any other underlying error message.

For example, in Prestashop 1.5.3 -1.6, we enable it by adding the below parameter in the file config/defines.inc.php.

Similarly, in Prestashop 1.4 – 1.5.3, we enable debug mode by adding the below parameter in the file config/config.inc.php.

And, once we’re done with the troubleshooting, we’ll disable error reporting, because leaving debug mode enabled can give unpredictable results to visitors.

504 gateway time-out in Prestashop – Causes & Fixes

Now, let’s see the main reasons for this error and how our Support Engineers fix them.

1) Client side issues

Misconfigurations at the client side can result in “504 gateway time-out error in Prestashop”. It can be due to various reasons like:

  • Improper browser settings or browser cache.
  • Temporary problems with the network devices such as modems, routers, etc.
  • Incorrect proxy settings in the browser or application.
  • Network issues at the ISP end.
How we fix?

Our Support Engineers make customers test these things to confirm that there are no problems at the client side.

  • Double check the browser settings and ask them to access their Prestashop application after clearing the browser cache.
  • Try to load from another browser or from incognito window.
  • Restart network devices such as router, modem, etc. and confirm that they have been configured correctly.
  • Review the proxy settings used in the browser or user’s application.
  • Check if there is any problems with their ISP.

If everything works fine, then we do the rest of the checks to identify the issues at the server side.

2) Proxy timeout values

Proxy errors are not always due to insufficient resources. It’s also possible that the proxy has been configured incorrectly. As a result, the proxy server times out before processing the request. Similarly, complex and long running scripts which takes longer time to complete the execution also results in this error.

For example, we’ve seen instances where website throws 504 gateway time-out error in Prestashop with Nginx configured as the reverse proxy.

How we fix?

Our Support Engineers solve this timeout problem by tweaking certain values in the proxy or the web server configuration file. For instance, we adjust the following parameters in the Nginx reverse proxy configuration file nginx.conf to increase the timeout values.

Similarly, for servers with Nginx and FastCGI(PHP-FPM), our Support Experts resolve this problem by adjusting the parameter max_execution_time in php.ini and request_terminate_timeout in www.conf files. In addition to that, we adjust the following parameters in the Nginx file.

Most importantly, we restart the necessary services such as nginx, php-fpm to bring the changes into effect.

[Need to adjust the proxy settings on your server? Our experienced Server Administrators can help you.]

3) DNS issues

Similarly, 504 gateway time-out prestashop errors can sometimes be a result of incorrect DNS settings. It can be at the server side or the at client side. Let’s first check the issues that can happen at server side.

DNS changes are often required after domain migration, hosting provider switch, etc. So, it’s important to wait for the DNS changes to propagate globally. So, when the customer browses the website or perform updates during the propagation period, timeout error may occur.

That’s why, our Support Engineers reduce the TTL values during migration, inorder to reduce the propagation delay period.

Likewise, the DNS caching issues at the client side can also lead to this error. The DNS cache on the user’s system stores records of all the recent visits. And, if the DNS cache contain old records, it’ll throw errors.

How we fix?

Here, our Support Experts check if the DNS propagation period is complete using the dig command.

If not, we’ll ask the customer to check after the DNS propagation period. If there are any DNS resolution errors, we’ll fix them immediately.

Similarly, if we identify that the issue is on the client side, we’ll help the customers to clear their local DNS cache. For example, we use the below command to clear the DNS cache in Windows.

4) Server issues

The next step is to check whether the problem lies at the server side. We’ve seen instance where the server becomes unresponsive due to heavy load. It can be due to ongoing DDOS attack, heavy website traffic, a compromised server, application bugs causing resource outages, etc.

Sometimes, the web server which handles the incoming requests become too slow due to performance problems or heavy traffic. Similarly, network problems between the proxy server and the web server can cause delays in getting response for HTTP requests.

How we fix?

Our Support Experts check the server and identify the abused resource. We then find out which service is abusing the resource. At this point, we identify the user who owns the malicious script or software. Finally, we remove or disable this abusive script.

Similarly, if we find there are no enough resources in the server to process the valid incoming requests, the only solution is to upgrade the resources on the server.

For slow web servers, our Server experts optimize web server and tweak it’s configuration parameters to solve the problem.

[Need help in resolving the frequent load issues on your server? Click here and get one of our Server Experts to fix it for you.]

5) Issues with CDN

Website owners use CDNs(Content Delivery Network) to serve contents faster. However, if it’s not properly configured, it can result in errors. The common errors that we’ve seen are the IP address of the website not set in CDN, firewall blocking CDN, etc.

How we fix?

Our Support Experts verify if CDN is creating problems by temporarily disabling the CDN service for the domain. If the website worked well, we’ll review the CDN settings and correct the misconfiguration.

6) Website configuration issues

Last but not least, Prestashop configuration issues can also lead to this error.

In other words, corrupted databases, faulty extensions or themes, incorrect configuration can always create problems.

How we fix?

Firstly, our Support Experts check the database logs to identify the corrupted databases. Once identified, we repair the database using the mysqlcheck command. Also, we always backup the database before making any changes.

Replace DATABASE with original database name.

Similarly, we’ll disable each of the themes/extensions one by one to identify the faulty one. If the website works fine, we upload a fresh copy of the theme/extension. If not, then only the theme developer can fix it.

[Need to recover the corrupted database on your server? We can help you here.]

Conclusion

In short, 504 gateway time-out in Prestashop can occur due to proxy timeout values, DNS issue and more. Today, we’ve discussed the top 6 reasons for this error and how our Dedicated Engineers fix them.

Источник

PS 1.7.5 database initialization fails with 504 Gateway Timeout error #12599

Comments

ivordurham commented Feb 15, 2019

Describe the bug
PS 1.7.5 installation fails with a 504 Gateway Timeout on Fedora 29, PHP 7.2.14, Apache 2.4.38, MariaDB 10.3.11

To Reproduce
Download prestashop_1.7.5.0.zip and unpack in HOME/new_shop
Visit https://x.x.x/HOME/new_shop
Follow steps through local database setup (127.0.0.1) and test database connection successfully.
Click Next.
Long delay stuck at 12% followed by 504 Gateway Timeout error.

Screenshots
PS Error & phpMyAdmin configuration block:


Additionnal information
PrestaShop version: 1.7.5
PHP version: 7.2.14
MariaDB version: 10.3.11

A total of 227 tables were created in the database (ps_access through ps_zone_shop), but all tables appear to be empty, including ps_configuration so I’m not sure it is even getting as far as loading sample product information.

I had previously initialized PS 1.7.5 successfully under Fedora 28 with PHP 7.2 and the latest MariaDB version, but recently upgraded to the latest Fedora release. Then I needed to start my PrestaShop installation over again in preparation for converting/re-implementing a PrestaShop 1.4 installation. This time I could not complete the installation. None of my previous MariaDB, Apache or php.ini files have been modified since before the upgrade from Fedora 28 to Fedora 29.

The text was updated successfully, but these errors were encountered:

ivordurham commented Feb 16, 2019

My default Apache installation apparently uses the Fast CGI proxy. I have been able to evade the timeout issue by creating an Apache configuration file: /etc/httpd/conf.d/custom.conf which contains

This doubles the default timeout of 60s. I have not tried to narrow down how much extra time is actually needed.

However, anyone trying to install PrestaShop on a shared hosting package may not have the option of changing the timeout. It would be far better to evade this issue in the first place.

khouloudbelguith commented Feb 18, 2019

Thanks for your report.
To install PrestaShop, we need to set memory_limit to «128M», it is required, you can follow this link.
Also, you can follow this link: https://github.com/PrestaShop/php-ps-info
phppsinfo file provides an equivalent to the phpinfo() function that reports PrestaShop Requirements information about the PHP/MySQL/Apache environment and offers suggestions for improvement.

  1. Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file.
  2. Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phppsinfo.php, replacing example.com with your own domain name.
  3. Now you can view all of the information about PHP for your server for that particular directory.

About your issue, since it is fixed, can I close the issue?
Thanks!

Cc: ivordurham ; Mention Subject: Re: [PrestaShop/PrestaShop] PS 1.7.5 database initialization fails with 504 Gateway Timeout error (#12599) Hi @ivordurham , Thanks for your report. To install PrestaShop, we need to set memory_limit to «128M», it is required, you can follow this link . Also, you can follow this link: https://github.com/PrestaShop/php-ps-info phppsinfo file provides an equivalent to the phpinfo() function that reports PrestaShop Requirements information about the PHP/MySQL/Apache environment and offers suggestions for improvement. 1. Upload the file to the server. You should upload your file to the exact directory you want to test. Typically, this will be your httpdocs (/var/www/vhosts/example.com/httpdocs/) directory, although you can upload it to any subdirectory on your server as well. Use FTP to upload the file. 2. Visit the page in your browser. If you uploaded it to your html directory, you should now visit http://www.example.com/phppsinfo.php, replacing example.com with your own domain name. 3. Now you can view all of the information about PHP for your server for that particular directory. About your issue, since it is fixed, can I close the issue? Thanks! — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub , or mute the thread .

khouloudbelguith commented Feb 19, 2019

Thanks for these clarifications.
I tried with nginx, I edited the file /etc/nginx/nginx.conf where I set fastcgi_read_timeout 120;
When I tried to install PS1751 for example, I have «504 Gateway Time-out»

But, if I edit the fastcgi_read_timeout 120; to fastcgi_read_timeout 600; => the shop is successfully installed
@marion what do you think?
Thanks!

Источник

Error 504 Gateway Time-out #19470

Comments

srn87 commented May 30, 2020

I am having problems when I try to run a script that what it does is import products from my provider and it does not finish running, I get a 504 ngnix error on the screen before it ends, the hosting provider tells me it has to do with the design of my web, what I do not explain is that I have uploaded the type of server with them and before I did not have that problem and now that I have better vps, I do not understand anything!

[Sat May 30 02:29:08.664801 2020] [authz_core:error] [pid 18527:tid 140695075485440] [client 66.249.79.190:57802] AH01630: client denied by server configuration: /var/www/vhosts/myweb/web/img/p/1/8/0/3/7 [Sat May 30 02:30:34.534789 2020] [authz_core:error] [pid 17910:tid 140695192983296] [client 66.249.79.190:57816] AH01630: client denied by server configuration: /var/www/vhosts/myweb.es/myweb/img/p/1/6/4/0/0 [Sat May 30 02:35:25.910697 2020] [authz_core:error] [pid 17912:tid 140695083878144] [client 66.249.79.190:57896] AH01630: client denied by server configuration: /var/www/vhosts/myweb/web/img/p/1/6/3/4/8 [Sat May 30 02:38:43.406929 2020] [proxy_fcgi:error] [pid 18527:tid 140695033521920] [client 79.154.179.211:58010] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught —> Smarty: 0():Missing ‘$template’ parameter Smarty: 0():Missing ‘$template’ parameter Smarty: 0():Missing ‘$template’ parameter

PD: i change «myweb» for my real web direction

  • PrestaShop version: 1.7.6.4
  • PHP version: 7.2.31

The text was updated successfully, but these errors were encountered:

Источник

Тема: Как исправить 504 ошибку сервера из-за prestashop?  (Прочитано 1010 раз)

В административной части Prestashop имеется раздел «ПЕРЕСОЗДАТЬ МИНИАТЮРЫ».
Как при попытке пересоздания как всех картинок сразу, так и по отдельности (изображения, форматы), даже без удаления старых изображений(Удалить старые изображения — НЕТ), сервер вылетает в 504.
Как исправить данную проблему?

Сервер:
4 ядра 1200MHz
RAM: 8GB
HDD: 80GB SSD

Добавил время на выполнение в php, apache и nginx , значения в 600 секунд, однако ошибка появляется через 60. По какой то причине nginx не принимает параметры. — Не помогло
Сжал картинки без потери качества linux-утилиткой, перегенерировал картинки, все равно 504

Может имеется какой-либо пакетный инструмент в Prestashop для пересоздания миниатюр?


Записан

22 Январь 2017, 12:04:25

Ответ #1

Вам нужно настроить сервер или использовать доп. модули. Например, модуль prestashop Regenerate Thumbnails.


Записан

22 Январь 2017, 13:52:24

Ответ #2

Вам нужно настроить сервер или использовать доп. модули. Например, модуль prestashop Regenerate Thumbnails.

Спасибо. Имеется ли бесплатное решение для миниатюр?
Сервер настроили на очень большие таймауты 600


Записан

22 Январь 2017, 14:25:10

Ответ #3

Бесплатное решение встроено в движок. В админке в настройках изображений можно генерировать по типам товары, категории и т.д.


Записан

22 Январь 2017, 14:38:13

Ответ #4


Записан

12 Апрель 2017, 12:31:24

Ответ #5

добрый день, кто-нибудь устанавливал этот модуль, imege regenerator. Я по разному пыталась, пишет, что модуль установлен, но в списке модулей его не вижу. Папка в корне где все модули стоит(лежит, есть :D)?


Записан

12 Апрель 2017, 14:07:12

Ответ #6

Как вы его установили если модуль не видно в админке?


Записан

14 Апрель 2017, 09:29:36

Ответ #7

Пишет при загрузке установлен,но не появляется, и в папку модули вставила.


Записан

14 Апрель 2017, 10:25:47

Ответ #8

Если модуль не появился в админке, он не подходит под установленную версию prestashop или в нем ошибки.


Записан

23 Декабрь 2018, 20:53:30

Ответ #9

нужно было именно папку imageregenerator кидать в модули
http://prntscr.com/lyooh6

у меня все получилось, модуль атас работает на ура!!
спасибо автору модуля!


Записан

  • #1

Hello,

I have some Prestashop 1.6 online shops and when I have to run some long scripts like creating products with many combinations or generating sitemap I get a «504 Gateway Time-out.»

I have increased max_execution_time to 300 and set some nginx variables in Additional nginx directives as suggested in other threads, but it doesn’t work: it gets the error always after 60 seconds.

Code:

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

What am I missing?

Versions:
OS: CentOS Linux 7.6.1810 (Core)
PHP: 7.0.33, run as FPM served by Apache

  • #2

It is possible that Apache is timing out, not Nginx. Try to add
TimeOut 1200
to the Apache configuration and see if this helps. By default this is set to 300, in Plesk I think it is set to 120 or less.

It will be helpful to see the log entries of
proxy_error_log
proxy_access_log
access_log
error_log
at the time when the error happens. There may be additional hints on what exactly is causing the timeout.

  • #3

Hello,
thank you for your reply.
Since I am a newby in plesk, where do I set TimeOut for Apache.

In the meantime, I’ve checked the logs and now I get Server Error 503 Service Temporarily Unavailable:
2019-04-05 07:57:20 — Error — (70007)The timeout specified has expired: AH01075: Error dispatching request to :, referer: https://example.com/../&configure=gsitemap&tab_module=seo&module_name=gsitemap Apache error
2019-04-05 07:56:20 — Error — 503 POST /../..&tab_module=seo&module_name=gsitemap HTTP/1.0

  • #4

Are you sure that your scripts are working correctly? Very frequently scripts are buggy and don’t return any output, which will cause the symptoms described here.

  • #5

I am pretty sure. They are standard functions of different versions of Prestashop. It happens for different functions like I said: generating all the variations of products, generating long sitemaps when I want to check also for images. It always stops after exactly 60s.

Going back to the previous answer, I tried to find Timeout and ProxyTimeout variables in httpd.conf file, but I cannot find them. I am checking on this specific file /etc/httpd/conf/httpd.conf. Where can I add them? At the end of the file?

  • #6

Anybody?
How can I change Timeout and ProxyTimeout if they are not in httpd.conf file?

Monty


  • #7

On CentOS those variables are not defined in httpd.conf, they are left at default values.
Simply create a file in /etc/httpd/conf.d/, for example timeouts.conf and put the values in there. And then reload Apache with:
apachectl configtest && apachectl graceful

Please note: I suggest you start by only putting a value for «Timeout» first, because according to the Apache Docs, «ProxyTimeout» takes the value of «Timeout» by default:
mod_proxy — Apache HTTP Server Version 2.4

  • #8

Hello,
thank you for your reply.
I did exactly as you suggested: I created timeout.conf file in /etc/httpd/conf.d/ and added just:

Afterward, I run the command:

Code:

apachectl configtest && apachectl graceful

But, after 60 seconds, I got «504 Gateway Time-out nginx» error.
From the logs, I got this:
5109#0: *1876715 upstream timed out (110: Connection timed out) while reading response header from upstream — nginx error

Monty


  • #9

So this means that nginx was waiting for Apache for 60 seconds and then aborted the request. So you still seem to have a 60 seconds timeout in your nginx config.

— Check your Apache and Nginx settings for the affected domain and check the timeout settings there (if any).

And then follow this KB article: A website is not accessible with «Nginx 504 Gateway Time-out»

  • #10

Thank you for your reply.
Now, it’s working. After adding timeout variable as you suggested, and adding the directives in Additional nginx directives (in Apache & nginx Settings), it works as it should, finally.
Thank you!

Понравилась статья? Поделить с друзьями:
  • 504 get away time out ошибка
  • 508 ошибка нива шевроле
  • 508 ошибка http
  • 507с ошибка бмв е65
  • 507в ошибка бмв