# Command started multiple times and no logs

**URL:** <https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180>\
**Category:** SUSE Rancher Prime\
**Created:** [February 1, 2019, 12:33pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180 "2019-02-01T12:33:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgv-ebishop](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wgv-ebishop/32/4807_2.png) [@wgv-ebishop](https://forums.suse.com/u/wgv-ebishop)\
**Post date:** [February 1, 2019, 12:33pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/1 "2019-02-01T12:33:22Z")

</div>

I can run this container on the same node, from the command line, and it works fine. But when I create the deployment with Kubernetes, the container “command” is run multiple time I don’t see any logs from the container. I checked this by logging into the node, and running sudo docker logs on the container and sudo docker exec ps -a. When I run the same container, on the same node, from the command line,the container “command” is only executed once and the logs are written properly, and the on container does the work it’s intended for.

In Rancher, the container reports a status of “Running”. Just no logs.

Here’s what ps -a shows:  
PID USER TIME COMMAND  
9 8 root S 1548 0% 0 0% {client-run-help} /bin/sh /bin/client-run-helper.sh  
24 19 root R 1548 0% 0 0% top  
1 0 root S 1544 0% 0 0% /bin/sh -c /bin/client-run-helper.sh 40.xxx.xxx.255 5001 00:12:34:56:00:01 SFC1-000001 10  
8 1 root S 1544 0% 0 0% {client-run-help} /bin/sh /bin/client-run-helper.sh

here’s what is should look like (and how it looks when I run the container from CLI):

PID USER TIME COMMAND  
1 root 0:00 {client-run-help} /bin/sh /bin/client-run-helper.sh 40.xxx.xxx.255 5001 00:12:34:56:00:01 SFC1-000001 10  
16 root 0:00 ./test\_client 40.xxx.xxx.255 5001 00:12:34:56:00:01 SFC1-000001 10  
22 root 0:00 ps -a

From the command line, logs are issued normally, started with Rancher (kubernetes) no logs…none.

Please, advise.

---

<div class="post-metadata">

**Author:** ![Kosmo](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@Kosmo](https://forums.suse.com/u/Kosmo)\
**Post date:** [February 1, 2019, 4:00pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/2 "2019-02-01T16:00:27Z")

</div>

Have you tried using:

`kubectl --namespace default logs [CONTAINER_ID]`

Don’t forget to look the the correct namespace.

To find the container Id use:

`kubectl get pods --all-namespaces`

And the container Id is the one under the “NAME” column.

---

<div class="post-metadata">

**Author:** ![wgv-ebishop](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wgv-ebishop/32/4807_2.png) [@wgv-ebishop](https://forums.suse.com/u/wgv-ebishop)\
**Post date:** [February 1, 2019, 9:32pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/3 "2019-02-01T21:32:55Z")

</div>

Thanks for your reply. I can see the logs, if I start the container from the commandline. I can’t see them if I start it via kubectl create. The kubectl --namespace default logs simulator-oiuproiuy command just returns nothing.

---

<div class="post-metadata">

**Author:** ![Kosmo](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@Kosmo](https://forums.suse.com/u/Kosmo)\
**Post date:** [February 3, 2019, 8:33am UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/4 "2019-02-03T08:33:14Z")

</div>

Is it recreating the container over and over, resulting in running the container “command” multiple times?  
Is the container supposed to run a one-time job and then complete?

---

<div class="post-metadata">

**Author:** ![wgv-ebishop](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wgv-ebishop/32/4807_2.png) [@wgv-ebishop](https://forums.suse.com/u/wgv-ebishop)\
**Post date:** [February 4, 2019, 12:36pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/5 "2019-02-04T12:36:32Z")

</div>

What I really want is to create a Job. But since the Rancher UI only shows a deployment, I was trying to shoehorn my workload into a deployment. So yea,it may have been trying to run the container more than once…not sure why that would run the command more than once.

---

<div class="post-metadata">

**Author:** ![wgv-ebishop](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wgv-ebishop/32/4807_2.png) [@wgv-ebishop](https://forums.suse.com/u/wgv-ebishop)\
**Post date:** [February 4, 2019, 12:51pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/6 "2019-02-04T12:51:21Z")

</div>

Running as a job didn’t help. I still see what appears to be multiple invocations, and no logs. The absence of logs is what bugs me most.

---

<div class="post-metadata">

**Author:** ![wgv-ebishop](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wgv-ebishop/32/4807_2.png) [@wgv-ebishop](https://forums.suse.com/u/wgv-ebishop)\
**Post date:** [February 5, 2019, 9:21pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/7 "2019-02-05T21:21:45Z")

</div>

I had both a “command” and “args” element in the k8s yaml. Apparently this represented two things to run. Seems odd. Anyway, I put the command and all of it’s args in the command value, and it works fine.

---

<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:** [February 6, 2019, 3:10am UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/8 "2019-02-06T03:10:35Z")

</div>

K8s Command == Docker Entrypoint  
K8s Args == Docker Command

---

<div class="post-metadata">

**Author:** ![wgv-ebishop](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wgv-ebishop/32/4807_2.png) [@wgv-ebishop](https://forums.suse.com/u/wgv-ebishop)\
**Post date:** [February 6, 2019, 2:59pm UTC](https://forums.suse.com/t/command-started-multiple-times-and-no-logs/13180/9 "2019-02-06T14:59:28Z")

</div>

thanks, that makes sense.
