mesosphere / marathon

Deploy and manage containers (including Docker) on top of Apache Mesos at scale.
https://mesosphere.github.io/marathon/
Apache License 2.0
4.07k stars 845 forks source link

Edit in the UI an app using a docker image with an entrypoint result in entrypoint override and empty command #2677

Closed geoffroyjabouley closed 8 years ago

geoffroyjabouley commented 8 years ago

Hello

my setup is the following:

I have a running Marathon application created using the attached json, which works fine.

The docker image domain/backoffice has an entrypoint declaration, thus no "cmd" field is needed in the json.

A docker ps command on the host running the image returns (truncated):

CONTAINER ID        IMAGE                        COMMAND              
556680ec25fc        domain/backoffice            "/home/domain/launch_b"

docker inspect 556680ec25fc returns (truncated):

"Entrypoint": [
    "/home/domain/launch_backoffice.sh"
],

I am trying to update this app using the Marathon UI. For example only change the memory field to 256MB.

Whenever i make the change and submit the new configuration, the task is not able to start anymore.

It seems that Marathon overrides the image entry point with /bin/sh and then use an empty cmd field in the configuration, so the docker container starts and immediately exits without error.


Some information for debugging:

A docker ps command on the host containing the container with updated Marathon configuration (truncated):

CONTAINER ID        IMAGE                        COMMAND                  CREATED             STATUS                
b376477a706a        domain/backoffice            "/bin/sh -c ' '"         10 hours ago        Exited (0) 10 hours ago

docker inspect b376477a706a returns (truncated):

"Entrypoint": [
    "/bin/sh"
],

Marathon log when updating the configuration

[2015-11-18 18:08:23,096] INFO [/backoffice-app]: upgrade detected for app (oldVersion FullVersionInfo(2015-11-18T14:58:46.133Z,2015-11-18T14:58:46.133Z,2015-11-18T14:58:46.133Z)) (mesosphere.marathon.upgrade.GroupVersioningUtil$:31)
  * Restart(App(/backoffice-app, image="domain/backoffice", cmd=" ")))
  * Restart(App(/backoffice-app, image="domain/backoffice", cmd=" ")))
[2015-11-18 18:08:23,102] INFO [/backoffice-app] storing new app version 2015-11-18T17:08:23.079Z (mesosphere.marathon.state.GroupManager:144)
  * Restart(App(/backoffice-app, image="domain/backoffice", cmd=" ")))
[backoffice.txt](https://github.com/mesosphere/marathon/files/38837/backoffice.txt)
kolloch commented 8 years ago

Hi @geoffroyjabouley, thanks for reporting this. It seems to be a duplicate of https://github.com/mesosphere/marathon/issues/2373. Reopen if you disagree.

geoffroyjabouley commented 8 years ago

Yep just found it, thanks for having closing this duplicate.

kolloch commented 8 years ago

Well, your bug report was really good, so thanks for that :) @geoffroyjabouley