New container keeps hanging on "Networking", can't find logs

I created this small repository https://github.com/MetalArend/rancher/ - a readme file, a start.sh script to run from your host machine, a docker-compose file with a server and agent container and another shell script where the registration happens.
I’ve been playing with the UDP ports, the CATTLE_AGENT_IP, DOCKER_HOST and other environment variables, but somehow I can’t get the configuration right.

Setup:
Rancher Server 1.1.0
Rancher Agent 1.0.2
Docker for Mac 1.12.0 (with docker-compose 1.8.0)

The rancher server is running. Docker is available inside the agent_1 container, and showing all running containers. The agent is registering without any problems. I can go to localhost:8080 and see my server_1 container on the hosts tab, but I see no other containers. I can create a new container (only add the name field), and click create. It starts a networking container, which keeps running. And on my host a new agent-instance shows up. But the actual new container I wanted to create does not show up in “docker ps -a”, and the rancher backend keeps telling “Networking…”. I have no idea how to get to the logs from the new container (the rancher gui is not responding, the cli has no new container). Is there also some documentation on why this extra agent instance is popping up?

I would be so thankful for any clues. Maybe there is some very obvious error in the docker-compose file? Is there a method how to get to more logs that I did not think of? Which container should have the 500/udp and 4500/udp ports open? Do I have to set another CATTLE_AGENT_IP?

(((I’ve been on a few of rancher’s online meetups, been looking through the documentation, and been reading a lot of issues on github and forum posts here. I’m trying to put together all these bits and pieces from everywhere to create a very simple way to get rancher going, and probably then do a meetup talk about it in our local ug. I want to love it and I want to introduce our developer team to it, but right now I’m somehow completely stuck, so I’m hoping to get some guidelines and help here…)))

Thanks, and keep up the amazing work!

Found a way to get to the logs: added -v /var/lib/cattle/logs

Report in cattle log is saying:
==> log/cattle-error.log <==
2016-07-02 19:39:27,034 WARN [79e22180-a0b2-4c09-86c4-446ef0588603:79] [containerEvent:1] [containerevent.create->(ContainerEventCreate)] [] [ecutorService-4] [i.c.p.p.c.ContainerEventCreate ] Could not determine network mode for container [externalId: c69cf4622b09f41be99e35d54716a4218aea713600aedf641c6ddc4a7f438263]. Using none networking.

This might be the problem… ?

Already found it. Had to take care of the difference between the server and the host.

For future reference, and anybody also searching the internet for days and days without finding this simple solution… The only reliable way to find the host of a running container was the following oneliner:

netstat -nr | grep '^0\.0\.0\.0' | awk '{print $2}'

Did you ever discover why you were getting the “Could not determine network mode for container” error? I tried adding the redis service from the catalog. The docker containers continually fail/destroy/create so quickly I can never get into one to see the log in the container.

Matt

1 Like