Docker container run error: Container exited on error: exited with status 1
<p>I am running dependency application in marathon, one is mongo DB and other is karesti voting app. I have deployed these applications in marathon within a docker container. First I deployed mongo db and later the voting app. </p>

<p>mongo db docker image is working fine in marathon.
the issue is with voting app....
voting app is switching between the running mode and suspend mode continuously. Due to this the port number is also getting changed in each deployment and a new container is creating the docker for the same image.</p>

<p>Here I have mesos DNS for service discovery.</p>

<p>Error from marathon: </p>

<blockquote>
  <p>Docker container run error: Container exited on error: exited with
  status 1</p>
</blockquote>

<p>Error from voting app: </p>

<blockquote>
  <p>Received killTask for task
  cmvoting.dff585d5-2bc5-11e6-a4c0-0242efa3f3aa</p>
</blockquote>

<pre><code>Log message from mesos slave: 
I0607 07:24:04.297161  1957 slave.cpp:3243] Handling status update TASK_RUNNING (UUID: ed039d5b-ef25-45e5-962f-367feaa33ae5) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 from executor(1)@127.0.0.1:50983
I0607 07:24:04.299815  1957 status_update_manager.cpp:320] Received status update TASK_RUNNING (UUID: ed039d5b-ef25-45e5-962f-367feaa33ae5) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001
I0607 07:24:04.300282  1957 status_update_manager.cpp:824] Checkpointing UPDATE for status update TASK_RUNNING (UUID: ed039d5b-ef25-45e5-962f-367feaa33ae5) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001
I0607 07:24:04.391424  1957 slave.cpp:3641] Forwarding the update TASK_RUNNING (UUID: ed039d5b-ef25-45e5-962f-367feaa33ae5) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 to master@172.31.29.198:5050
I0607 07:24:04.391826  1957 slave.cpp:3551] Sending acknowledgement for status update TASK_RUNNING (UUID: ed039d5b-ef25-45e5-962f-367feaa33ae5) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 to executor(1)@127.0.0.1:50983
I0607 07:24:04.421507  1951 status_update_manager.cpp:392] Received status update acknowledgement (UUID: ed039d5b-ef25-45e5-962f-367feaa33ae5) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001
I0607 07:24:04.421766  1951 status_update_manager.cpp:824] Checkpointing ACK for status update TASK_RUNNING (UUID: ed039d5b-ef25-45e5-962f-367feaa33ae5) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001


I0607 07:24:18.299789  1956 slave.cpp:3243] Handling status update TASK_FAILED (UUID: e20d07aa-88e1-497b-9c51-79252c279f27) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 from executor(1)@127.0.0.1:50983
I0607 07:24:18.321115  1953 status_update_manager.cpp:320] Received status update TASK_FAILED (UUID: e20d07aa-88e1-497b-9c51-79252c279f27) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001
I0607 07:24:18.321229  1953 status_update_manager.cpp:824] Checkpointing UPDATE for status update TASK_FAILED (UUID: e20d07aa-88e1-497b-9c51-79252c279f27) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001
I0607 07:24:18.338953  1956 slave.cpp:3641] Forwarding the update TASK_FAILED (UUID: e20d07aa-88e1-497b-9c51-79252c279f27) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 to master@172.31.29.198:5050
I0607 07:24:18.339341  1956 slave.cpp:3551] Sending acknowledgement for status update TASK_FAILED (UUID: e20d07aa-88e1-497b-9c51-79252c279f27) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 to executor(1)@127.0.0.1:50983
I0607 07:24:18.350075  1954 status_update_manager.cpp:392] Received status update acknowledgement (UUID: e20d07aa-88e1-497b-9c51-79252c279f27) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001
I0607 07:24:18.350272  1954 status_update_manager.cpp:824] Checkpointing ACK for status update TASK_FAILED (UUID: e20d07aa-88e1-497b-9c51-79252c279f27) for task voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3 of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001
I0607 07:24:19.301136  1951 slave.cpp:3769] executor(1)@127.0.0.1:50983 exited
I0607 07:24:19.327797  1953 docker.cpp:2011] Executor for container 'd4447d21-23da-45db-a9aa-f6b2d75e2db7' has exited
I0607 07:24:19.327910  1953 docker.cpp:1731] Destroying container 'd4447d21-23da-45db-a9aa-f6b2d75e2db7'
I0607 07:24:19.328034  1953 docker.cpp:1859] Running docker stop on container 'd4447d21-23da-45db-a9aa-f6b2d75e2db7'
I0607 07:24:19.328732  1958 slave.cpp:4120] Executor 'voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3' of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 exited with status 0
I0607 07:24:19.328843  1958 slave.cpp:4224] Cleaning up executor 'voting.cfc5c791-2c80-11e6-b454-0242f9dcd7c3' of framework 4925c40b-fb4b-4ec7-91fc-3ffc16e1bac8-0001 at executor(1)@127.0.0.1:50983
</code></pre>

<p>I am not able to identify where is the issue, why the voting app is been failed in slave.</p>

<p>If I run the voting from bare ubuntu machine, I am able to access the application, which has linked to the database and everything is working fine. Which shows that no issue with the app, no issue with the docker image.</p>

<p>My suspect is that, something is happening in mesos slave which is not able to handle or might not be able to connect to the database.</p>

<p>my mongo db listen to the the port 27017 and voting app listen to port 9000. I can see the only the port 27017 is being used when i do the netstat -anp | grep 27017</p>

<p>The command used to run the slave is</p>

<pre><code>sudo ./bin/mesos-slave.sh --master=zk://172.31.36.222:2181/home/ubuntu/mesos --executor_registration_timeout=5mins --containerizers="docker,mesos"
</code></pre>

<p>The command used to run the marathon is</p>

<pre><code>./bin/start --master zk://172.31.36.222:2181/home/ubuntu/mesos --zk zk://172.31.36.222:2181/home/ubuntu/marathon-1.1.1 --task_launch_timeout 600000
</code></pre>

<p>Please let me know if you need any more info or clarity on the problem</p>

<p>Thanks in advance for your kind help....</p>