Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container trouble [Solved] #1

Closed
icecreammatt opened this issue Aug 3, 2015 · 5 comments
Closed

Container trouble [Solved] #1

icecreammatt opened this issue Aug 3, 2015 · 5 comments

Comments

@icecreammatt
Copy link

Does this container still work?

I tried running this image following the instructions in the README but I get an empty page when I try to curl 127.0.0.1:80. (I ran this command from inside the boot2dockerVM) It looks like the files are on disk and when I check the nginx logs inside the container I see accesses but no errors. The index.php is pretty sparse. Is there another dependency I am missing besides this and linking mysql?

EDIT: For anyone that comes across make sure to visit the IP in the browser. For some reason that works. Curling from inside the container or from boot2docker does not, but visiting the boot2docker ip in the browser does.

@jamesottaway
Copy link
Owner

The --publish=8080:80 flag in the docker run command means that port 80 inside the container is bound to port 8080 of the host.

What do you get if you run curl -I 127.0.0.1:8080?

@icecreammatt
Copy link
Author

@jamesottaway Here is the output. I tried both because 8080 was not accepting any connections.

> $ docker ps
CONTAINER ID        IMAGE                                 COMMAND                CREATED             STATUS              PORTS                  NAMES
cf8bcfa7db5f        jamesottaway/trovebox-docker:latest   "/bin/sh -c 'service   2 days ago          Up 2 days           0.0.0.0:8080->80/tcp   trovebox
17cbc1b8ade8        mysql:5                               "/entrypoint.sh mysq   2 days ago          Up 2 days           3306/tcp               mysql

matt@Aquabot ~                                                                             [12:57:40]
> $ curl -I 127.0.0.1:8080/
curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused

matt@Aquabot ~                                                                             [12:57:42]
> $ boot2docker ssh
                        ##        .
                  ## ## ##       ==
               ## ## ## ##      ===
           /""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ /  ===- ~~~
           \______ o          __/
             \    \        __/
              \____\______/
 _                 _   ____     _            _
| |__   ___   ___ | |_|___ \ __| | ___   ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__|   <  __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.5.0, build master : a66bce5 - Tue Feb 10 23:31:27 UTC 2015
Docker version 1.5.0, build a8a31ef
docker@boot2docker:~$ docker ps
CONTAINER ID        IMAGE                                 COMMAND                CREATED             STATUS              PORTS                  NAMES
cf8bcfa7db5f        jamesottaway/trovebox-docker:latest   "/bin/sh -c 'service   2 days ago          Up 2 days           0.0.0.0:8080->80/tcp   trovebox
17cbc1b8ade8        mysql:5                               "/entrypoint.sh mysq   2 days ago          Up 2 days           3306/tcp               mysql
docker@boot2docker:~$ curl -I 127.0.0.1:8080
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.6.1
Date: Fri, 07 Aug 2015 19:59:19 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=npuj04qnh2lf3r79vit1kb50a0; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: /setup
Cache-Control: max-age=315360000

docker@boot2docker:~$ curl -I 127.0.0.1:8080/setup
HTTP/1.1 500 Internal Server Error
Server: nginx/1.6.1
Date: Fri, 07 Aug 2015 19:59:21 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=clqmjmmm5dn77ktbkt2949p2m7; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

docker@boot2docker:~$ docker exec -it trovebox bash
root@cf8bcfa7db5f:/trovebox# curl -I 127.0.0.1:80
HTTP/1.1 302 Moved Temporarily
Server: nginx/1.6.1
Date: Fri, 07 Aug 2015 19:59:49 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=usmjlfo9v5fg6dmmfvkgrlfqg1; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: /setup
Cache-Control: max-age=315360000

# Manually follow redirect to /setup

root@cf8bcfa7db5f:/trovebox# curl -I 127.0.0.1:80/setup
HTTP/1.1 500 Internal Server Error
Server: nginx/1.6.1
Date: Fri, 07 Aug 2015 19:59:54 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: PHPSESSID=ffperrvvsmkrslvg2b70s85d65; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

root@cf8bcfa7db5f:/trovebox#

I see these logs when I cat the logs inside the container /var/log/nginx/error.log

2015/08/07 19:59:21 [error] 28#0: *15 FastCGI sent in stderr: "PHP message: {severity:warn, description:"Uncaught exception (/trovebox/src/libraries/external/epi/EpiException.php:13): Could not find route /setup from /setup", additional:}" while reading response header from upstream, client: 172.17.42.1, server: , request: "HEAD /setup HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "127.0.0.1:8080"
2015/08/07 19:59:54 [error] 28#0: *19 FastCGI sent in stderr: "PHP message: {severity:warn, description:"Uncaught exception (/trovebox/src/libraries/external/epi/EpiException.php:13): Could not find route /setup from /setup", additional:}" while reading response header from upstream, client: 127.0.0.1, server: , request: "HEAD /setup HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "127.0.0.1"

I'm wondering if I maybe missed something in your steps.

@icecreammatt
Copy link
Author

Looks like this might be a trovebox thing: photo/frontend#1572
I'll continue looking from here.

@jamesottaway
Copy link
Owner

That's weird that it's returning a HTTP 500 response from curl. I've replicated it here:

❯ boot2docker ip
192.168.59.103

❯ curl -I 192.168.59.103:8080/setup
HTTP/1.1 500 Internal Server Error

Interestingly, though, it works fine in my browser here. You'll have to use the boot2docker IP, and port 8080, so try pulling it up in a browser that way and hopefully it will work.

@icecreammatt
Copy link
Author

Wow that worked hitting it in the browser! I guess I should have tried that to begin with... Thanks for helping me troubleshoot this.

@icecreammatt icecreammatt changed the title Container trouble Container trouble [Solved] Aug 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants