shyim / shopware

Shopware 6 Docker Image
https://hub.docker.com/r/shyim/shopware
MIT License
66 stars 13 forks source link

theme:change fails on-install as well as manually triggered #31

Closed lvrtmbst closed 2 years ago

lvrtmbst commented 2 years ago

I can start up the entire setup locally and access the backend, set the salesChannel URL and view the storefront. But there is no theme available and I can not change it in the backend.

This seems to originate in the failed theme:compile upon install where I get:

maintenance_1  | Set and compiling theme "Storefront" (3c6e76400aae492293d5a7f35bde1c34) as new theme for sales channel "Headless"
mysql_1        | 2022-02-09 13:38:35 19 [Warning] Aborted connection 19 to db: 'shopware' user: 'shopware' host: '172.25.0.3' (Got an error reading communication packets)
mysql_1        | 2022-02-09 13:38:35 18 [Warning] Aborted connection 18 to db: 'shopware' user: 'shopware' host: '172.25.0.3' (Got an error reading communication packets)
maintenance_1  | /etc/shopware/scripts/on-install/01-install-sw.sh: line 9:    81 Killed                  sudo -E -u www-data php /var/www/html/bin/console theme:change --all Storefront
sw6-test_maintenance_1 exited with code 0

If i start the command manually I'll get basically no feedback:

bash-5.1# ./bin/console theme:compile
Start theme compilation
bash-5.1#

If I try to change the theme, the process is killed after about 30s

bash-5.1# ./bin/console theme:change
Please select a theme:
  [0] Storefront
 > 0
Please select a sales channel:
  [0] Headless | 98432def39fc4624b33213a56b8c944d
  [1] Storefront | d673894724f8492ea8433f5ef9df8b7a
 > 1
Set and compiling theme "Storefront" (3c6e76400aae492293d5a7f35bde1c34) as new theme for sales channel "Storefront"
Killed
mysql_1        | 2022-02-09 14:05:18 177 [Warning] Aborted connection 177 to db: 'shopware' user: 'shopware' host: '172.25.0.4' (Got an error reading communication packets)
mysql_1        | 2022-02-09 14:05:18 176 [Warning] Aborted connection 176 to db: 'shopware' user: 'shopware' host: '172.25.0.4' (Got an error reading communication packets)

If i try to change or set the theme in the admin panel I'll get an error after a while which resolves in the logs as follows

task_1         | Scheduled task runner stopped due to time limit of 60s reached
shopware_1     | [09-Feb-2022 14:09:47] WARNING: [pool www] child 33 exited on signal 9 (SIGKILL) after 1949.060234 seconds from start
shopware_1     | [09-Feb-2022 14:09:47] NOTICE: [pool www] child 547 started
shopware_1     | 2022/02/09 14:09:47 [error] 28#28: *123 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 172.25.0.1, server: localhost, request: "POST /api/_action/theme/3c6e76400aae492293d5a7f35bde1c34/assign/98432def39fc4624b33213a56b8c944d HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost", referrer: "http://localhost/admin"
mysql_1        | 2022-02-09 14:09:47 294 [Warning] Aborted connection 294 to db: 'shopware' user: 'shopware' host: '172.25.0.4' (Got an error reading communication packets)
shopware_1     | 172.25.0.1 - - [09/Feb/2022:14:09:47 +0000] "POST /api/_action/theme/3c6e76400aae492293d5a7f35bde1c34/assign/98432def39fc4624b33213a56b8c944d HTTP/1.1" 502 552 "http://localhost/admin" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36"
task_1         | 127.0.0.1 - - [09/Feb/2022:14:09:47 +0000] "GET /admin HTTP/1.1" 200 2 "-" "curl/7.80.0"

I tried some things but I'm out of ideas what could be responsible for the behaviour. I bumped up some php values because he had some allocation size problems first.

Thank you in advance

lvrtmbst commented 2 years ago

Nevermind. I think I figured it out by myself. It was indeed related to the memory limit problem. After bumping up the resources for Docker on my host system it went thru like a charm.

The error message with strange numbers got me thinking and pushed me in the right direction.

bash-5.1# ./bin/console theme:change
Please select a theme:
  [0] Storefront
 > 0
Please select a sales channel:
  [0] Headless | 98432def39fc4624b33213a56b8c944d
  [1] Storefront | d673894724f8492ea8433f5ef9df8b7a
 > 1
Set and compiling theme "Storefront" (3c6e76400aae492293d5a7f35bde1c34) as new theme for sales channel "Storefront"

Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 20480 bytes) in /var/www/html/vendor/symfony/error-handler/ErrorHandler.php on line 477

Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 32768 bytes) in /var/www/html/vendor/symfony/error-handler/Error/OutOfMemoryError.php on line 1