简体   繁体   中英

Can't Deploy Bitnami Docker Prestashop to Azure Web App for Linux Containers

I am deploying the bitnami/prestashop:latest container to Azure Web Apps for Linux using Docker Compose. The app runs as it should, however, during setup, the container is stopped with the following log:

2020-04-24 16:41:54.795 INFO - Pulling image from Docker hub: bitnami/prestashop:latest 2020-04-24 16:41:54.975 INFO - latest Pulling from bitnami/prestashop 2020-04-24 16:41:54.975 INFO - Digest:
sha256:e9b855aacd98f030a5eb5da1bb67d85826f45de93a22c46d10a32dd926a406b4 2020-04-24 16:41:54.975 INFO - Status: Image is up to date for bitnami/prestashop:latest 2020-04-24 16:41:54.980 INFO - Pull Image successful, Time taken: 0 Minutes and 0 Seconds 2020-04-24 16:41:55.048 INFO - Starting container for site 2020-04-24 16:41:55.049 INFO - docker run.... [I omitted this for privacy reasons] 2020-04-24 16:42:42.765 INFO - Started multi-container app 2020-04-24 16:42:42.767 INFO - Initiating warmup request to container ____ for site ____ 2020-04-24 16:42:42.768 INFO - Container ____ for site ____ initialized successfully and is ready to serve requests.
2020-04-24T16:41:58.113523956Z �[0m�[1mWelcome to the Bitnami prestashop container�[0m 2020-04-24T16:41:58.158369413Z �[0mSubscribe to project updates by watching
�[1mhttps://github.com/bitnami/bitnami-docker-prestashop�[0m 2020-04-24T16:41:58.158918215Z �[0mSubmit issues and feature requests at�[1mhttps://github.com/bitnami/bitnami-docker-prestashop/issues�[0m 2020-04-24T16:41:58.159232316Z �[0mSend us your feedback at �[1mcontainers@bitnami.com�[0m 2020-04-24T16:41:58.159518117Z �[0m
2020-04-24T16:42:08.422158445Z nami INFO Initializing apache
2020-04-24T16:42:08.608163795Z nami INFO apache successfully initialized 2020-04-24T16:42:17.713547687Z nami INFO Initializing php 2020-04-24T16:42:17.857312289Z nami INFO php successfully initialized 2020-04-24T16:42:27.757340561Z nami INFO Initializing mysql-client 2020-04-24T16:42:27.865075237Z nami INFO mysql-client successfully initialized 2020-04-24T16:42:40.440013656Z nami INFO Initializing prestashop 2020-04-24T16:42:43.016056554Z prestas INFO Configuring webserver... 2020-04-24T16:42:43.962865361Z prestas INFO Configuring PHP settings... 2020-04-24T16:42:44.588998548Z mysql-c INFO Trying to connect to MySQL server
2020-04-24T16:42:44.647265552Z mysql-c INFO Found MySQL server listening at ____.mysql.database.azure.com:3306 2020-04-24T16:42:44.971537885Z mysql-c INFO MySQL server listening and working at ____.mysql.database.azure.com:3306 2020-04-24T16:42:45.001331589Z prestas INFO Configuring PrestaShop... 2020-04-24T16:44:20 No new trace in the past 1 min(s).
2020-04-24T16:45:20 No new trace in the past 2 min(s).
2020-04-24T16:46:20 No new trace in the past 3 min(s).
2020-04-24T16:47:20 No new trace in the past 4 min(s).
2020-04-24T16:48:20 No new trace in the past 5 min(s).
2020-04-24T16:49:20 No new trace in the past 6 min(s).
2020-04-24T16:50:20 No new trace in the past 7 min(s). 2020-04-24 16:50:32.785 ERROR - Container for ____ site ____ is unhealthy, Stopping site. 2020-04-24 16:50:32.798 INFO - Stoping site ____ because it is not healthy. 2020-04-24T16:50:28.672683616Z Error executing 'postInstallation': PHP Warning: Error while sending QUERY
packet. PID=114 in /opt/bitnami/prestashop/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 105

The container is always killed 7 minutes after no new activity happens; however, I do not believe that this is some sort of timeout in Azure's health checking service as I already increased it to 30 minutes by setting the Application Variable WEBSITES_CONTAINER_START_TIME_LIMIT = 1800.

Does anyone have any idea on how to solve this?

Edit: After enabling more detailed debugging as suggested by Carlos I got the following log:

2020-04-27 15:39:10.239 INFO - Started multi-container app 2020-04-27 15:39:10.271 INFO - Initiating warmup request to container 321online-loja_prestashop_0_ef62c472 for site 321online-loja 2020-04-27 15:39:10.276 INFO - Container 321online-loja_prestashop_0_ef62c472 for site 321online-loja initialized successfully and is ready to serve requests. 2020-04-27T15:37:23.531465284Z [38;5;6mapp-entrypoint.sh [38;5;5m15:37:23.47 [0m 2020-04-27T15:37:23.537751108Z [38;5;6mapp-entrypoint.sh [38;5;5m15:37:23.53 [0m[1mWelcome to the Bitnami prestashop container[0m 2020-04-27T15:37:23.545257337Z [38;5;6mapp-entrypoint.sh [38;5;5m15:37:23.54 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/bitnami-docker-prestashop[0m 2020-04-27T15:37:23.547788747Z [38;5;6mapp-entrypoint.sh [38;5;5m15:37:23.54 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/bitnami-docker-prestashop/issues[0m 2020-04-27T15:37:23.576949258Z [38;5;6mapp-entrypoint.sh [38;5;5m15:37:23.57 [0mSend us your feedback at [1mcontainers@bitnami.com[0m 2020-04-27T15:37:23.587086397Z [38;5;6mapp-entrypoint.sh [38;5;5m15:37:23.58 [0m 2020-04-27T15:37:51.932887130Z nami INFO Initializing apache 2020-04-27T15:37:52.389063777Z nami INFO apache successfully initialized 2020-04-27T15:38:29. 275126198Z nami INFO Initializing php 2020-04-27T15:38:29.625726441Z php TRACE [configurePermissions] List of files: ["/opt/bitnami/php/tmp"] 2020-04-27T15:38:29.627354347Z php TRACE [configurePermissions] File to chown: /opt/bitnami/php/tmp 2020-04-27T15:38:29.647537424Z php TRACE [configurePermissions] List of files: ["/opt/bitnami/php/logs"] 2020-04-27T15:38:29.647563424Z php TRACE [configurePermissions] File to chown: /opt/bitnami/php/logs 2020-04-27T15:38:29.674731628Z php TRACE [configurePermissions] List of files: ["/opt/bitnami/php/var","/opt/bitnami/php/var/log","/opt/bitnami/php/var/run"] 2020-04-27T15:38:29.676041133Z php TRACE [configurePermissions] File to chown: /opt/bitnami/php/var 2020-04-27T15:38:29.684988368Z php TRACE [conf igurePermissions] File to chown: /opt/bitnami/php/var/log 2020-04-27T15:38:29.694472104Z php TRACE [configurePermissions] File to chown: /opt/bitnami/php/var/run 2020-04-27T15:38:29.696478412Z nami INFO php successfully initialized 2020-04-27T15:38:45.152588783Z nami INFO Initializing mysql-client 2020-04-27T15:38:45.559259940Z nami INFO mysql-client successfully initialized 2020-04-27T15:39:06.310691781Z nami INFO Initializing prestashop 2020-04-27T15:39:06.713661623Z apache TRACE Skipping reload: com.bitnami.apache not running 2020-04-27T15:39:06.862334593Z apache TRACE [runProgram] Executing: null /opt/bitnami/apache/bin/httpd -f /opt/bitnami/apache/conf/httpd.conf 2020-04-27T15:39:11.518859518Z apache TRACE code: 0 2020-04-27T15:39:11.525561144Z ZB6EF D606D118D0F62066E31419FF04CCZ TRACE stdout: 2020-04-27T15:39:11.525576644Z 2020-04-27T15:39:11.526110846Z apache TRACE stderr: 2020-04-27T15:39:11.526124746Z 2020-04-27T15:39:11.528346855Z prestas INFO Configuring webserver... 2020-04-27T15:39:11.765893364Z apache TRACE [runProgram] Executing: /opt/bitnami/apache/bin/apachectl graceful 2020-04-27T15:39:12.784509463Z prestas INFO Configuring PHP settings... 2020-04-27T15:39:13.126322572Z apache TRACE [runProgram] Executing: /opt/bitnami/apache/bin/apachectl graceful 2020-04-27T15:39:13.830620768Z mysql-c INFO Trying to connect to MySQL server 2020-04-27T15:39:13.916307096Z mysql-c INFO Found MySQL server listening at _____.mysql.database.azure.com:3306 2020-04-27T15:39:13.9177391 01Z mysql-c TRACE [canConnect] Testing connection with '_____mysql-srv' user 2020-04-27T15:39:13.918756005Z mysql-c TRACE [showDatabases] Getting databases for 'loja-prestashop-db-user@321online-loja-mysql-srv' user 2020-04-27T15:39:13.927700339Z mysql-c TRACE [execute] Executing: mysql -N -P 3306 -h_____.mysql.database.azure.com -uloja-_____db-user@_____-mysql-srv -_____ -e SHOW DATABASES; 2020-04-27T15:39:14.220290960Z mysql-c TRACE [execute] Result: {"code":0,"stdout":"information_schema\n321onlinelojadb\n","stderr":""} 2020-04-27T15:39:14.223593772Z mysql-c TRACE [showDatabases] Databases: information_schema 2020-04-27T15:39:14.223610272Z 321onlinelojadb 2020-04-27T15:39:14.223615972Z 2020-04-27T15:39:14.224821077Z mysql-c TRACE [canConnect] Connection with '_____@_____-mysql-srv' user is successful 2020-04-27T15:39:14.232732907Z mysql-c INFO MySQL server listening and working at _____.mysql.database.azure.com:3306 2020-04-27T15:39:14.382364580Z prestas INFO Configuring PrestaShop... 2020-04-27T15:39:14.525421028Z php TRACE [runProgram] Executing: /opt/bitnami/php/bin/php install/index_cli.php,--db_user=______-user@______-mysql-srv,--db_password=______,--db_server=______.Z81C3B080DAD537DE7E1 0E0987A4BF52EZ.database.azure.com:3306,--db_name=______db,--domain=______.azurewebsites.net,--firstname=Bitnami,--lastname=User,--password=______,--email=______,--timezone=PST8PDT,--country=BR,--language=pt-BR,--newsletter=0 2020-04-27 15:39:25.299 ERROR - Container for 321online-loja_prestashop_0_ef62c472 site 321online-loja is unhealthy, Stopping site. 2020-04-27 15:39:25.347 INFO - Stoping site 321online-loja because it is not healthy. 2020-04-27T15:39:22.179714528Z Error executing 'postInstallation': Program exited with exit code 1 2020-04-27T15:39:22.187320457Z nami
TRACE Error: Error executing 'postInstallation': Program exited with exit code 1 2020-04-27T15:39:22.187351658Z at runProgram (/opt/bitnami/nami/node_modules/nami-utils/lib/os/run-program.js:223:14) 2020-04-27T15:39:22.187358458Z at Object.runProgram (/opt/bitnami/nami/node_modules/nami-utils/lib/os/index.js:63:12) 2020-04-27T15:39:22.187363158Z at Object.$app.helpers.execute (/root/.nami/components/com.bitnami.php/helpers.js:69:14) 2020-04-27T15:39:22.187367858Z at Object. (/opt/bitnami/nami/node_modules/lodash/index.js:51:276) 2020-04-27T15:39:22.187372958Z at Component.$app.postInstallation (/root/.nami/components/com.bitnami.prestashop/main.js:49:9) 2020-04-27T15:39:22.187377558Z at Component.runStep (/opt/bitnami/nami/node_modules/nami-core/lib/components/component.js:159:12) 2020-04-27T15:39:22.187391458Z at _.each.step (/opt/bitnami/nami/node_modules/nami-core/lib/components/component.js:236:32) 2020-04-27T15:39:22.187396158Z at r (/opt/bitnami/nami/node_modules/lodash/index.js:5:348) 2020-04-27T15:39:22.187400358Z at Function.sf (/opt/bitnami/nami/node_modules/lodash/index.js:78:256) 2020-04-27T15:39:22.187404658Z at Component.install (/opt/bitnami/nami/node_modules/nami-core/lib/components/component.js:236:7)

Prestashop is an application that takes time to initialize mainly because of the initialization of the database.

Adding the NAMI_DEBUG=true environment variable to the container you should see some messages after the INFO Configuring PrestaShop... . Those messages are TRACE level so they are not shown by default, but enabling the debug you should see something like:

prestashop_1  | prestas INFO  Configuring PrestaShop...
prestashop_1  | php     TRACE [runProgram] Executing: /opt/bitnami/php/bin/php install/index_cli.php,--db_user=bn_prestashop,--db_password=,--db_server=mariadb:3306,--db_name=bitnami_prestashop,--domain=localhost,--firstname=Bitnami,--lastname=User,--password=bitnami1,--email=user@example.com,--timezone=PST8PDT,--country=us,--language=en,--newsletter=0
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e UPDATE ps_configuration SET value='1' WHERE name='PS_REWRITING_SETTINGS';
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e UPDATE ps_configuration SET value='1' WHERE name='PS_SMARTY_CACHE';
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e UPDATE ps_configuration SET value='0' WHERE name='PS_SMARTY_FORCE_COMPILE';
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e INSERT INTO ps_configuration (name, value) VALUES ('PS_CSS_THEME_CACHE', '1');
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e INSERT INTO ps_configuration (name, value) VALUES ('PS_JS_THEME_CACHE', '1');
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e INSERT INTO ps_configuration (name, value) VALUES ('PS_HTML_THEME_COMPRESSION', '1');
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e INSERT INTO ps_configuration (name, value) VALUES ('PS_JS_HTML_THEME_COMPRESSION', '1');
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | mysql-c TRACE [execute] Executing: mysql -N -P 3306 -hmariadb -Dbitnami_prestashop -ubn_prestashop -e INSERT INTO ps_configuration (name, value) VALUES ('PS_HTACCESS_CACHE_CONTROL', '1');
prestashop_1  | mysql-c TRACE [execute] Result: {"code":0,"stdout":"","stderr":""}
prestashop_1  | prestas TRACE [prepareDataToPersist] Preparing /opt/bitnami/prestashop to persist in /bitnami/prestashop
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/administration/backups
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/administration/import
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/cache
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/var/cache
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/app/config
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/var/logs
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/img
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/mails
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/config
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/modules
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/override
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/themes
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/translations
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/upload
prestashop_1  | prestas TRACE [configurePermissions] File to chown: /opt/bitnami/prestashop/download
prestashop_1  | apache  TRACE [runProgram] Executing: /opt/bitnami/apache/bin/apachectl graceful
prestashop_1  | prestas INFO
prestashop_1  | prestas INFO  ########################################################################
prestashop_1  | prestas INFO   Installation parameters for prestashop:
prestashop_1  | prestas INFO     First Name: Bitnami
prestashop_1  | prestas INFO     Last Name: User
prestashop_1  | prestas INFO     Email: user@example.com
prestashop_1  | prestas INFO     Password: **********
prestashop_1  | prestas INFO     Shop Name: PrestaShop
prestashop_1  | prestas INFO     Admin URL: http://localhost/administration
prestashop_1  | prestas INFO   (Passwords are not shown for security reasons)
prestashop_1  | prestas INFO  ########################################################################
prestashop_1  | prestas INFO
prestashop_1  | nami    INFO  prestashop successfully initialized

Please, note the TRACE messages before the next INFO one.

When I say that this application needs some time to be initialized I am talking about 7/10 minutes, but if you set the WEBSITES_CONTAINER_START_TIME_LIMIT to 30 minutes that shouldn't be the issue. Can you try increasing the debug by setting the NAMI_DEBUG=true environment variable to the container?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM