shyim / shopware-docker

Easy to use Docker Installation for Shopware 5 and Shopware 6
MIT License
115 stars 27 forks source link

File not found. #17

Closed RafaelKr closed 5 years ago

RafaelKr commented 5 years ago

I'm using the shopware composer project for Shopware 5.

I had swdc working. But suddenly I have the problem, that I'm only getting File not found. when trying to open a shop in the browser. I tried to update the URL of one of my shops, I'm not sure if it was working before that change. Afterwards I tried to do a clean install of swdc and a shop but without success.

The command docker logs shopware-docker_nginx_1 shows the following:

127.0.0.1 -  24/Jul/2019:11:03:00 +0000 "GET /index.php" 404
2019/07/24 11:03:00 [error] 23#23: *5 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 172.25.0.1, server: ~^(?<sname>\w+)\.platform\.localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "sw-cd-testing.dev.localhost"

Do you know about that problem? Is this maybe related to permissions?

Show debug.txt ``` === docker-compose.yml version: '3' services: mysql: image: mariadb:10.3 env_file: docker.env smtp: image: mailhog/mailhog nginx: image: shyim/shopware-nginx:php72 env_file: - docker.env - .env ports: - 80:80 - 443:443 volumes: - ~/Code:/var/www/html cli: image: shyim/shopware-cli:php72 env_file: docker.env volumes: - ~/Code:/var/www/html - .:/opt/swdc tty: true ports: - 8181:8181 === docker-compose.override.yaml version: '3' services: nginx: image: shyim/shopware-nginx:php72 volumes: - /home/rafael/coding/shopware/shops:/var/www/html extra_hosts: sw-cd-testing.dev.localhost: 127.0.0.1 volumes: - /home/rafael/coding/shopware/shops:/var/www/html mysql: image: shyim/shopware-mysql:57 ports: - 3306:3306 volumes: - ./mysql-data:/var/lib/mysql cli: links: - nginx:sw-cd-testing.dev.localhost volumes: - /home/rafael/coding/shopware/shops:/var/www/html adminer: image: adminer env_file: docker.env === .env # Persistent Database? PERSISTENT_DATABASE=true # Elasticsearch ENABLE_ELASTICSEARCH=false # See https://www.docker.elastic.co/ for tags ELASTICSEARCH_VERSION="6.8.1" # Redis ENABLE_REDIS=false # S3 compatible Server ENABLE_MINIO=false # Possible values are 5.6, 7.0, 7.1, 7.2, 7.3 PHP_VERSION=7.2 # Possible values are 5.5, 5.6, 5.7, 8 MYSQL_VERSION=5.7 # Expose mysql port to host EXPOSE_MYSQL_LOCAL=true # Possible values are adminer / phpmyadmin DATABASE_TOOL=adminer # Selenium Server ENABLE_SELENIUM=false # Source code root directory CODE_DIRECTORY="$HOME/coding/shopware/shops" # Blackfire configurations ENABLE_BLACKFIRE=false BLACKFIRE_SERVER_ID= BLACKFIRE_SERVER_TOKEN= === mysql logs Attaching to shopware-docker_mysql_1 mysql_1 | 2019-07-24T11:01:52.816931Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). mysql_1 | 2019-07-24T11:01:52.817005Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. mysql_1 | 2019-07-24T11:01:52.818743Z 0 [Note] mysqld (mysqld 5.7.26) starting as process 1 ... mysql_1 | 2019-07-24T11:01:52.823874Z 0 [Note] InnoDB: PUNCH HOLE support available mysql_1 | 2019-07-24T11:01:52.823926Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins mysql_1 | 2019-07-24T11:01:52.823933Z 0 [Note] InnoDB: Uses event mutexes mysql_1 | 2019-07-24T11:01:52.823938Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier mysql_1 | 2019-07-24T11:01:52.823944Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 mysql_1 | 2019-07-24T11:01:52.823949Z 0 [Note] InnoDB: Using Linux native AIO mysql_1 | 2019-07-24T11:01:52.831745Z 0 [Note] InnoDB: Number of pools: 1 mysql_1 | 2019-07-24T11:01:52.831994Z 0 [Note] InnoDB: Using CPU crc32 instructions mysql_1 | 2019-07-24T11:01:52.834601Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 8, chunk size = 128M mysql_1 | 2019-07-24T11:01:53.085462Z 0 [Note] InnoDB: Completed initialization of buffer pool mysql_1 | 2019-07-24T11:01:53.126000Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). mysql_1 | 2019-07-24T11:01:53.142627Z 0 [Note] InnoDB: Highest supported file format is Barracuda. mysql_1 | 2019-07-24T11:01:53.278743Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables mysql_1 | 2019-07-24T11:01:53.278825Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... mysql_1 | 2019-07-24T11:01:53.358328Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. mysql_1 | 2019-07-24T11:01:53.359341Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. mysql_1 | 2019-07-24T11:01:53.359355Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. mysql_1 | 2019-07-24T11:01:53.360110Z 0 [Note] InnoDB: 5.7.26 started; log sequence number 38349966 mysql_1 | 2019-07-24T11:01:53.360280Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool mysql_1 | 2019-07-24T11:01:53.360552Z 0 [Note] Plugin 'FEDERATED' is disabled. mysql_1 | 2019-07-24T11:01:53.369825Z 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them. mysql_1 | 2019-07-24T11:01:53.370201Z 0 [Warning] CA certificate ca.pem is self signed. mysql_1 | 2019-07-24T11:01:53.374166Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 mysql_1 | 2019-07-24T11:01:53.374229Z 0 [Note] IPv6 is available. mysql_1 | 2019-07-24T11:01:53.374245Z 0 [Note] - '::' resolves to '::'; mysql_1 | 2019-07-24T11:01:53.374262Z 0 [Note] Server socket created on IP: '::'. mysql_1 | 2019-07-24T11:01:53.379946Z 0 [Warning] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory. mysql_1 | 2019-07-24T11:01:53.398887Z 0 [Note] Event Scheduler: Loaded 0 events mysql_1 | 2019-07-24T11:01:53.399049Z 0 [Note] mysqld: ready for connections. mysql_1 | Version: '5.7.26' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL) mysql_1 | 2019-07-24T11:01:53.430156Z 0 [Note] InnoDB: Buffer pool(s) load completed at 190724 13:01:53 ```
shyim commented 5 years ago

Can you rename the folder and remove "-"? Maybe thats the problem

RafaelKr commented 5 years ago

Oh yes. That was the problem. Thank you!

The current RegEx in the nginx config does not work with dashes. https://regex101.com/r/6ld5Nu/1

But dashes are valid domain characters. So I would recommend to update the RegEx. I just tested the following RegEx with nginx, it's working: https://regex101.com/r/6ld5Nu/2