Rancher-agent not running

Hi,

i have some problems starting the container agents. Had it all running once and tried to re-run it now.

The container log:

INFO: ENV: RANCHER_AGENT_IMAGE=rancher/agent:v0.8.2
time=“2015-11-16T12:39:02Z” level=fatal msg="Error response from daemon: Could not find container for entity id 40ffc3c62cadf1732c11ba3a8c2884ca2347a2500d329421d580be4ce40e4ae7"
Error: No such image or container: rancher-agent-state
dirname: missing operand
Try ‘dirname --help’ for more information.

docker.log from upstart:
ERRO[4529] Handler for GET /v1.18/containers/rancher-agent/json returned error: no such id: rancher-agent
ERRO[4529] HTTP Error err=no such id: rancher-agent statusCode=404
INFO[4529] GET /v1.18/images/rancher-agent/json
ERRO[4529] Handler for GET /v1.18/images/rancher-agent/json returned error: No such image: rancher-agent
ERRO[4529] HTTP Error err=No such image: rancher-agent statusCode=404
INFO[4529] GET /v1.18/containers/rancher-agent-state/json
ERRO[4529] Handler for GET /v1.18/containers/rancher-agent-state/json returned error: no such id: rancher-agent-state
ERRO[4529] HTTP Error err=no such id: rancher-agent-state statusCode=404
INFO[4529] GET /v1.18/images/rancher-agent-state/json
ERRO[4529] Handler for GET /v1.18/images/rancher-agent-state/json returned error: No such image: rancher-agent-state
ERRO[4529] HTTP Error err=No such image: rancher-agent-state statusCode=404
INFO[4529] POST /v1.18/containers/create?name=rancher-agent-state
ERRO[4529] Handler for POST /v1.18/containers/create returned error: Could not find container for entity id 40ffc3c62cadf1732c11ba3a8c2884ca2347a2500d329421d580be4ce40e4ae7
ERRO[4529] HTTP Error err=Could not find container for entity id 40ffc3c62cadf1732c11ba3a8c2884ca2347a2500d329421d580be4ce40e4ae7 statusCode=500
INFO[4529] GET /v1.18/containers/rancher-agent-state/json
ERRO[4529] Handler for GET /v1.18/containers/rancher-agent-state/json returned error: no such id: rancher-agent-state
ERRO[4529] HTTP Error err=no such id: rancher-agent-state statusCode=404
INFO[4529] GET /v1.18/images/rancher-agent-state/json
ERRO[4529] Handler for GET /v1.18/images/rancher-agent-state/json returned error: No such image: rancher-agent-state
ERRO[4529] HTTP Error err=No such image: rancher-agent-state statusCode=404

If i try to pull it manually it fails also. I’ve already tried to delete all containers which aren’t running.

Thanks for your help/ideas.

Marc

Did you remove the container rancher-agent-state? When you launch the rancher-agent, it actually spins up 3 containers with only 1 remaining running.

The stopped container called rancher-agent-state cannot be deleted. Otherwise, rancher-agent container won’t work.

1 Like

Hi Denise, thank you. I’ve already tried deleting it via docker rmi rancher-agent-state:
docker rmi rancher-agent-state
Error response from daemon: could not find image: no such id: rancher-agent-state
Error: failed to remove images: [rancher-agent-state]

docker rm -fv rancher-agent-state
Error response from daemon: no such id: rancher-agent-state
Error: failed to remove containers: [rancher-agent-state]

docker rmi rancher-agent
Error response from daemon: could not find image: no such id: rancher-agent
Error: failed to remove images: [rancher-agent]

and i’ve also tried
docker rmi $(docker images -f “dangling=true” -q)
docker rm -v $(docker ps -a -q -f status=exited)

This happens on all 4 nodes where it was previously started.

I stopped and removed the rancher agent containers, and then removed /var/lib/rancher on the host. After this, I restarted the rancher agent and it came right up. It’s a bit harsh, but it worked.

2 Likes

@ebishop: Thanks. i’ve tried it but it still doesn’t want to start

in docker.log from upstart it still complains about
ERRO[165404] Handler for GET /v1.18/images/rancher-agent-state/json returned error: No such image: rancher-agent-state
ERRO[165404] HTTP Error err=No such image: rancher-agent-state statusCode=404

When you say that you went to re-run, what are you doing specifically?

So you had something running rancher/agent and then you were trying to re-run rancher/agent command to update it?

Can you share the command that you are running? I don’t know why it’s trying to get an image called rancher-agent-state. We only have a rancher/agent image that is used when starting rancher/agent.

Hi Denise, i had it running some weeks ago and stopped the rancher-agent. I’ve started the rancher server on another linux docker host via
docker run -d --restart=always -p 8080:8080 rancher/server
which works fine. After that i’ve visited the gui which gave me the command to add other nodes to the rancher cluster, similar to this:

docker run -e CATTLE_HOST_LABELS=‘internal=1&zone=internal&slave=1’ -d rancher-agent --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent:v0.8.2 http://rancherserver:8080/v1/scripts/A1ABE1A609482E85BA0D:1847635200000:URrNci0dkFIAAfrclfbCYy4BpK0

Did you alter the command provided by the uI? Typically, re running rancher-agent on a host used in a different set up has no issues. I’ve done it myself quite often with no issues.

Mostly just asking because the -d rancher-agent --privileged is strange. It typically doesn’t have the rancher-agent at that section…

I just downloaded rancher, and have the exact same issue the first time I ran an agent. Did anybody find a solution to this problem?

Nov 9 20:14:07 devbzdocker01 kernel: [24442.454043] XFS (dm-10): Unmounting Filesystem
Nov 9 20:14:08 devbzdocker01 systemd-udevd[6242]: inotify_add_watch(7, /dev/dm-10, 10) failed: No such file or directory
Nov 9 20:14:09 devbzdocker01 systemd-udevd[6242]: inotify_add_watch(7, /dev/dm-10, 10) failed: No such file or directory
Nov 9 20:14:09 devbzdocker01 systemd-udevd[6242]: inotify_add_watch(7, /dev/dm-10, 10) failed: No such file or directory
Nov 9 20:14:09 devbzdocker01 dockerd[684]: time=“2016-11-09T20:14:09.330812983-05:00” level=error msg="Handler for GET /v1.18/containers/rancher-agent/json returned error: No such container: rancher-agent"
Nov 9 20:14:09 devbzdocker01 dockerd[684]: time=“2016-11-09T20:14:09.332259262-05:00” level=error msg="Handler for GET /v1.18/images/rancher-agent/json returned error: No such image: rancher-agent"
Nov 9 20:14:09 devbzdocker01 kernel: [24443.917789] XFS (dm-10): Mounting V5 Filesystem
Nov 9 20:14:09 devbzdocker01 kernel: [24443.927147] XFS (dm-10): Ending clean mount
Nov 9 20:14:09 devbzdocker01 kernel: [24443.939667] XFS (dm-10): Unmounting Filesystem
Nov 9 20:14:09 devbzdocker01 kernel: [24444.007704] XFS (dm-10): Mounting V5 Filesystem
Nov 9 20:14:09 devbzdocker01 kernel: [24444.018979] XFS (dm-10): Ending clean mount
Nov 9 20:14:09 devbzdocker01 kernel: [24444.027437] XFS (dm-10): Unmounting Filesystem
Nov 9 20:14:09 devbzdocker01 kernel: [24444.092027] XFS (dm-10): Mounting V5 Filesystem
Nov 9 20:14:09 devbzdocker01 kernel: [24444.100823] XFS (dm-10): Ending clean mount
Nov 9 20:14:09 devbzdocker01 dockerd[684]: time=“2016-11-09T20:14:09.666376789-05:00” level=error msg=“containerd: start container” error=“oci runtime error: container_linux.go:247: starting container process caused “process_linux.go:245: running exec setns process for init caused \“exit status 17\””\n” id=33df1bab609c6017eeb0031cfe2d9548b7c7da853292e071bcfbea0093f3bc66
Nov 9 20:14:09 devbzdocker01 dockerd[684]: time=“2016-11-09T20:14:09.671218456-05:00” level=error msg="Create container failed with error: invalid header field value “oci runtime error: container_linux.go:247: starting container process caused \“process_linux.go:245: running exec setns process for init caused \\\“exit status 17\\\”\”\n”"
Nov 9 20:14:09 devbzdocker01 kernel: [24444.191304] XFS (dm-10): Unmounting Filesystem
Nov 9 20:14:09 devbzdocker01 dockerd[684]: time=“2016-11-09T20:14:09.733427348-05:00” level=error msg=“Handler for POST /v1.18/containers/33df1bab609c6017eeb0031cfe2d9548b7c7da853292e071bcfbea0093f3bc66/start returned error: invalid header field value “oci runtime error: container_linux.go:247: starting container process caused \“process_linux.go:245: running exec setns process for init caused \\\“exit status 17\\\”\”\n””