shyim / shopware

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

Installation fails in migration step #42

Closed Alfagun74 closed 1 year ago

Alfagun74 commented 2 years ago

Everything is empty and clean. Still fails in Migration all the time.

Logs:

Waiting for database connection...
db (10.0.1.111:3306) open
Prepare installation
Created database `shopware`
Imported base schema.sql
Get collection for identifier: "core"
migrate Migrations
   0/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
   2/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
   4/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   0%
   6/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   1%
   8/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   1%
  11/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   2%
  13/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   2%
  15/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   2%
  17/517 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░]   3%
  19/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   3%
  20/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   3%
  22/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   4%
  25/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   4%
  26/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   5%
  28/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   5%
  30/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   5%
  32/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   6%
  34/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   6%
  36/517 [=░░░░░░░░░░░░░░░░░░░░░░░░░░░]   6%
  37/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   7%
  39/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   7%
  41/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   7%
  43/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   8%
  45/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   8%
  47/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   9%
  49/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   9%
  50/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]   9%
  52/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]  10%
  53/517 [==░░░░░░░░░░░░░░░░░░░░░░░░░░]  10%
  56/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  10%
  58/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  11%
  60/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  11%
  62/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  11%
  64/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  12%
  66/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  12%
  68/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  13%
  71/517 [===░░░░░░░░░░░░░░░░░░░░░░░░░]  13%^rm: can't remove '/var/www/html/config/services/defaults_test.xml': No such file or directory
db (10.0.1.111:3306) open

Verisons used:
shyim/shopware:6.4.13.0
mariadb:10.3.27

ENV:

DATABASE_HOST=REDACTED
DATABASE_URL=REDACTED
APP_URL=REDACTED
APP_SECRET=REDACTED
INSTANCE_ID=REDACTED
INSTALL_LOCALE=de-DE
INSTALL_CURRENCY=EUR
INSTALL_ADMIN_USERNAME=admin
INSTALL_ADMIN_PASSWORD=REDACTED
BLUE_GREEN_DEPLOYMENT=0

Volumes mapped:

/state
/var/www/html/custom/plugins
/var/www/html/files
/var/www/html/var/logs
/var/www/html/public/theme
/var/www/html/public/media
/var/www/html/public/bundles
/var/www/html/public/sitemap
/var/www/html/public/thumbnail
/var/www/html/config/jwt
shyim commented 2 years ago

It looks like system:install command failed somehow wtf.

Whats your device 🤔

Alfagun74 commented 2 years ago

a decent server :(

       _,met$$$$$gg.          root@HADES
    ,g$$$$$$$$$$$$$$$P.       ----------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux bookworm/sid x86_64
 ,$$P'              `$$$.     Host: PRIMERGY RX300 S6 GS01
',$$P       ,ggs.     `$$b:   Kernel: 5.18.0-2-amd64
`d$$'     ,$P"'   .    $$$    Uptime: 4 hours, 33 mins
 $$P      d$'     ,    $$P    Packages: 1808 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: fish 3.5.0
 $$;      Y$b._   _,d$P'      CPU: Intel Xeon X5680 (24) @ 1.596GHz
 Y$$.    `.`"Y$$$$P"'         GPU: 09:00.0 Matrox Electronics Systems Ltd.
 `$$b      "-.__              Memory: 4739MiB / 145039MiB
  `Y$$
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""
Alfagun74 commented 2 years ago

@shyim have you got a version of mysql/maria and shopware that definitely work together, so i can try?

shyim commented 2 years ago

Do you have a docker-compose.yml to reproduce it?

Alfagun74 commented 2 years ago

unfortunately i dont use docker-compose but i can try setting one up rl quick

Alfagun74 commented 2 years ago

Okay i tested around a little bit.

local mysql in docker compose works absolutely fine. remote mysql in docker compose crashes though.

My mysql server seems to be the problem. Which version should i use?

Alfagun74 commented 2 years ago

tried 5.7, same problem. maybe its the shopware package after all. i will roll back a couple versions and see.

shyim commented 2 years ago

maybe some connectivity issues?

Alfagun74 commented 2 years ago

No they are on the same local network and it works until around 17%

Alfagun74 commented 2 years ago

MySQL 5.7 Shopware 6.3.5.0

Didn't work either. Same Problem. What could be the cause for this 😩😩😩

shyim commented 2 years ago

maybe look into mysql logs 🤔

shyim commented 2 years ago

I need a reproducer I can't do anything

Alfagun74 commented 2 years ago

I know :(

I'm sorry. I can't seem to reproduce it either..

Alfagun74 commented 2 years ago

My RAID5 seems to be the issue i think.
When i map the Volume of MYSQL to another drive everything works fine.
Is it a no-go to use mysql databases on raid 5?

scolastico commented 2 years ago

Can be fixed with mariadb instead of mysql:

# [...]
  mysql:
    image: mariadb:10.7.4
    environment:
      MYSQL_ROOT_PASSWORD: shopware
      MYSQL_DATABASE: shopware
      MYSQL_USER: shopware
      MYSQL_PASSWORD: shopware
    restart: on-failure
    volumes:
     - mysql-data:/var/lib/mysql
# [...]
shyim commented 2 years ago

Did anyone found how to solve this? I still cannot reproduce it 🙈

scolastico commented 2 years ago

@shyim yes look at my last comment https://github.com/shyim/shopware/issues/42#issuecomment-1192879657 In my eyes this seems to be a compatibility issue with the newer mysql version. But even if it is or not I don't understand why to use mysql anyway. Mysql has a "difficult" license agreement and so in general I can only recommend mariadb.

MariaDB is fully GPL licensed while MySQL takes a dual-license approach. MariaDB supports a lot of different storage engines. In many scenarios, MariaDB offers improved performance.

shyim commented 2 years ago

MariaDB runs much slower than MySQL 8 for Shopware as we use a lot of JSON fields

scolastico commented 2 years ago

Ok that makes sense. However, after checking again today, I don't think it's the RAID as described in the comment by Alfagun74 because I don't use RAID (on the hard drive where the container is located).

Basically I think that it may have something to do with an edgecase. Here are some system data from me maybe they help: Debian 11 Bullseye, stable, on an AMD Ryzen 2700, 128GB DDR4 3600mhz, Nvidia GT700, 2TB NVME Samsung EVO 900, virtualization: Docker version 20.10.20, build 9fdeb9c + Portainer.

shyim commented 1 year ago

Does someone have an idea how we can improve this directly in this image. I would otherwise close it, as I can't reproduce it. 🙈

scolastico commented 1 year ago

Despite changing hosts (this time to an Intel server with NVMe storage), the same problem persisted. However, after running some benchmarks with example data in Shopware, I did not observe any significant differences in speed with mariadb.

Oh almost forgot, locally it works fine, it's just on my servers that's the problem. I don't know. You could close this and add a reference to this ticket in the readme if someone has similar problems.

shyim commented 1 year ago

Maybe it helps to configure some variables inside the MySQL server like innodb_buffer_pool_size :)