# Rancher agent cannot be started

**URL:** <https://forums.suse.com/t/rancher-agent-cannot-be-started/3389>\
**Category:** Rancher 1.x\
**Created:** [July 12, 2016, 4:33pm UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389 "2016-07-12T16:33:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dengshaodong](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@dengshaodong](https://forums.suse.com/u/dengshaodong)\
**Post date:** [July 12, 2016, 4:33pm UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/1 "2016-07-12T16:33:25Z")

</div>

When I input:

`docker run -e CATTLE_AGENT_IP="121.xx.xx.4" -it --privileged -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/rancher:/var/lib/rancher rancher/agent:v1.0.2 http://121.xx.xx.4:8080/v1/scripts/874F461593B82EEEEB61:1468335600000:0SsoizxYtibU55WpXq7zcSR5gPg`

the agent container started and then exited immediately, no host is added to server.

no output can be found when I

`docker logs agentcontainerid`

My host is a centos 6.5 VM, with upgraded kernel to 3.10.xx.

How can I do some troubleshooting?

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [July 12, 2016, 10:04pm UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/2 "2016-07-12T22:04:51Z")

</div>

The command given is supposed to run, create two other containers (named `rancher-agent-state` and `rancher-agent`) and then exit. Are the other two there? What’s in the logs for `rancher-agent`?

---

<div class="post-metadata">

**Author:** ![dengshaodong](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@dengshaodong](https://forums.suse.com/u/dengshaodong)\
**Post date:** [July 13, 2016, 1:54am UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/3 "2016-07-13T01:54:30Z")

</div>

> [@vincent](#):
>
> in the logs for rancher-agen

After I run the command, no agent is active. Only rancher-agent-state existed but exited. No other agent existed:

 ![](https://us1.discourse-cdn.com/flex022/uploads/suse/original/2X/8/8aea7bcbd0376936b2436321e8fb32b64488ec0f.png)

---

<div class="post-metadata">

**Author:** ![denise](https://avatars.discourse-cdn.com/v4/letter/d/82dd89/32.png) [@denise](https://forums.suse.com/u/denise)\
**Post date:** [July 20, 2016, 9:21pm UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/4 "2016-07-20T21:21:59Z")

</div>

It looks like the rancher-agent-state was never run. There’s actually 3 containers that run.

Can you look at the detailed agent logs?

[http://docs.rancher.com/rancher/latest/en/faqs/agents/#where-can-i-find-detailed-logs-of-the-rancher-agent-container](http://docs.rancher.com/rancher/latest/en/faqs/agents/#where-can-i-find-detailed-logs-of-the-rancher-agent-container)

---

<div class="post-metadata">

**Author:** ![dengshaodong](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@dengshaodong](https://forums.suse.com/u/dengshaodong)\
**Post date:** [July 21, 2016, 2:36am UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/5 "2016-07-21T02:36:08Z")

</div>

But I can not find rancher directory in /var/log, so no any rancher agent log can be found.

---

<div class="post-metadata">

**Author:** ![MadPipe](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/madpipe/32/1427_2.png) [@MadPipe](https://forums.suse.com/u/MadPipe)\
**Post date:** [July 21, 2016, 1:33pm UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/6 "2016-07-21T13:33:41Z")

</div>

The logs are in the container that exited. Use the `cp` command to copy the logs outside.

`docker cp <container_id>:/var/log/rancher /local/path`

---

<div class="post-metadata">

**Author:** ![MadPipe](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/madpipe/32/1427_2.png) [@MadPipe](https://forums.suse.com/u/MadPipe)\
**Post date:** [July 21, 2016, 1:40pm UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/7 "2016-07-21T13:40:30Z")

</div>

Nope, I was wrong. It seems that the container that never ran creates the logs you’re looking for. What does `docker logs gigantic_lamarr` say?

---

<div class="post-metadata">

**Author:** ![dengshaodong](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@dengshaodong](https://forums.suse.com/u/dengshaodong)\
**Post date:** [July 23, 2016, 12:16am UTC](https://forums.suse.com/t/rancher-agent-cannot-be-started/3389/8 "2016-07-23T00:16:59Z")

</div>

nothing either. I decide to reset the host OS, it may be a problem related to the host system chaos. Thanks all!
