wyveo / craftcms-docker

Craft3/Craft2 CMS Docker base (Nginx, PHP-FPM 8, PostgreSQL/MariaDB, Redis)
https://hub.docker.com/r/wyveo/craftcms-docker
MIT License
100 stars 31 forks source link

404 on install #17

Closed shanebonham closed 6 years ago

shanebonham commented 6 years ago

Hi, on trying to install Craft3, by visiting http://0.0.0.0/index.php?p=admin, I get the nginx 404 screen (after about a minute). Here's what docker logs shows:

2018/05/27 16:13:30 [info] 19#19: *1 client closed connection while waiting for request, client: 172.19.0.1, server: 0.0.0.0:80
2018/05/27 16:13:32 [error] 19#19: *2 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.19.0.1, server: _, request: "GET /admin/install HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock", host: "0.0.0.0"
2018/05/27 16:13:32 [error] 19#19: *2 open() "/usr/share/nginx/web/50x.html" failed (2: No such file or directory), client: 172.19.0.1, server: _, request: "GET /admin/install HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock", host: "0.0.0.0"
172.19.0.1 - - [27/May/2018:16:13:32 +0000] "GET /admin/install HTTP/1.1" 404 564 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"

Any advice on what my problem might be?

milanojs commented 6 years ago

Hello there, you should wait longer to connect or check the internet connection from the docker container, seems that is waiting to long for downloading something! cheers!

shanebonham commented 6 years ago

Interesting... I get a different result, Internal Server Error, instantly when I try on a different internet connection (or no internet connection). It looks like it's being served from within the application:

image

Is there a way to check PHP logs?

milanojs commented 6 years ago

are u using apache or nginx ? i mean the container its running what?

shanebonham commented 6 years ago

I'm assuming it's nginx: https://github.com/wyveo/craftcms-docker/blob/craft3/Dockerfile#L1

timvoet commented 6 years ago

i am getting the same error 404

` Attaching to craftcms-docker_web_1 web_1 | 2018-05-31 02:07:21,762 INFO Set uid to user 0 succeeded

web_1 | 2018-05-31 02:07:21,769 INFO RPC interface 'supervisor' initialized

web_1 | 2018-05-31 02:07:21,769 INFO supervisord started with pid 11

web_1 | 2018-05-31 02:07:22,774 INFO spawned: 'stdout' with pid 14

web_1 | 2018-05-31 02:07:22,776 INFO spawned: 'php-fpm7' with pid 15

web_1 | 2018-05-31 02:07:22,779 INFO spawned: 'nginx' with pid 16

web_1 | 2018-05-31 02:07:23,832 INFO success: stdout entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

web_1 | 2018-05-31 02:07:23,832 INFO success: php-fpm7 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

web_1 | 2018-05-31 02:07:23,832 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

web_1 | 172.19.0.1 - - [31/May/2018:02:07:35 +0000] "GET /index.php?p=admin HTTP/1.1" 302 5 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36"

web1 | 2018/05/31 02:08:35 [error] 17#17: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.19.0.1, server: , request: "GET /admin/install HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock", host: "localhost"

web1 | 2018/05/31 02:08:35 [error] 17#17: *1 open() "/usr/share/nginx/web/50x.html" failed (2: No such file or directory), client: 172.19.0.1, server: , request: "GET /admin/install HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock", host: "localhost"

web_1 | 172.19.0.1 - - [31/May/2018:02:08:35 +0000] "GET /admin/install HTTP/1.1" 404 564 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36" `

shanebonham commented 6 years ago

Closing this as I got my problem solved. For anyone else who happens upon this, I don't know why I was getting a 404 on this one specific network. Other networks work fine.

The server error was because the redis container failed to start because the permissions of my /data folder were incorrect (I was able to see this error message by running sudo docker-compose up (without detaching). I fixed it by changing the shared folder to ~/data.

artus commented 6 years ago

@shanebonham, is it because you didn't run as sudo or because the /data folder already existed? I think the general idea (when using this docker-compose deployment) is to run it as super-user or using sudo.

shanebonham commented 6 years ago

I did run it with sudo, but had the same result. I think macOS is just extra fussy about stuff in the root directory, and I decided not to fight it.