Open exepowered opened 1 year ago
I just realised my nginx.conf was completely wrong. Now that I fixed it, I can access the Prestashop installer correctly, but the original issue with the 504 Gateway Time-out that I had running the Apache image, occurs with the FPM setup too. I've updated the title of this issue to match my problem correctly.
Everything runs well until Prestashop wants to install the theme. Both Apache and FPM images spits 504 Gateway Time-out error.
Running Docker on M2 Macbook Pro 2023. Ventura 13.4.1
Log:
sklepzherbatamipl-nginx-1 | 172.18.0.1 - - [10/Aug/2023:19:34:22 +0000] "GET /install/index.php?installTheme=true&_=1691695967736 HTTP/2.0" 504 569 "https://localhost/install/index.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36" "-"
prestashop | NOTICE: PHP message: PHP Warning: require(/var/www/html/var/cache/pro_/ContainerHOomYsF/getConsole_CommandLoaderService.php): Failed to open stream: No such file or directory in /var/www/html/var/cache/pro_/ContainerHOomYsF/appAppKernelProdContainer.php on line 2254
prestashop | NOTICE: PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/var/www/html/var/cache/pro_/ContainerHOomYsF/getConsole_CommandLoaderService.php' (include_path='/var/www/html/vendor/pear/pear_exception:/var/www/html/vendor/pear/console_getopt:/var/www/html/vendor/pear/pear-core-minimal/src:/var/www/html/vendor/pear/archive_tar:.:/usr/local/lib/php') in /var/www/html/var/cache/pro_/ContainerHOomYsF/appAppKernelProdContainer.php:2254
prestashop | Stack trace:
prestashop | #0 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(255): ContainerHOomYsF\appAppKernelProdContainer->load('getConsole_Comm...')
prestashop | #1 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php(231): Symfony\Component\DependencyInjection\Container->make('console.command...', 1)
prestashop | #2 /var/www/html/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(184): Symfony\Component\DependencyInjection\Container->get('console.command...')
prestashop | #3 /var/www/html/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php(75): Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands()
prestashop | #4 /var/www/html/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php(149): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\NullOutput))
prestashop | #5 /var/www/html/src/Adapter/Cache/Clearer/SymfonyCacheClearer.php(79): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\NullOutput))
prestashop | #6 [internal function]: PrestaShop\PrestaShop\Adapter\Cache\Clearer\SymfonyCacheClearer->PrestaShop\PrestaShop\Adapter\Cache\Clearer\{closure}()
prestashop | #7 {main}
prestashop | thrown in /var/www/html/var/cache/pro_/ContainerHOomYsF/appAppKernelProdContainer.php on line 2254
Updated nginx.conf for reference:
server {
server_name localhost;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
http2 on;
server_name localhost;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_timeout 1d;
ssl_session_cache shared:MozSSL:10m;
ssl_session_tickets off;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
index index.php index.html;
root /var/www/html;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass prestashop:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
I got it working after adding this
proxy_read_timeout 600;
Yup, it worked, but I get error 500 now when using the GUI web installer.
1: HTTP 500 - error - {"success":true,"message":""}
Installing via CGI worked, and I was able to install.
Hi,
I am trying to get Prestashop 8.1 running on Docker as my dev environment, but I can't succeed. First I tried the prestashop:latest image with Apache web server and used Nginx as a SSL Proxy to run it over HTTPS. Everything worked fine until the Theme Installation step in the installer; I was getting 504 Gateway Time-out error. Running it just on Apache without Nginx didn't helped. Tried setting the proxy timeout limits to a higher value, still no luck.
I've decided to use FPM image instead. Now the Prestashop's docker log says that the FPM is listening for connections, my nginx server seems to be configured correctly, everything's up, but I get the 502 Bad Gateway error trying to open the installer via localhost in my browser...
Can someone help me with this one?
Docker log:
My docker-compose.yml: I have all my .env values in correctly. "PS_DOMAIN" is set to "localhost".
nginx.conf: