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

Error Handling/validation required for COMMAND health check #2117

Closed jolexa closed 8 years ago

jolexa commented 9 years ago

Hello,

mesos 0.23.0 marathon 0.10.0

marathon happily accepted an invalid COMMAND health check and then the deployment is stuck in waiting status without any details into why. I had to log into the leading marathon and grok the logs to determine that the health check is invalid.

The error in the logs was: Aug 27 12:22:02 marathon[20611]: java.lang.AssertionError: assertion failed: A command is required when using the COMMAND health check protocol.

The json that I used to deploy was:

{
    "id": "myapp",
    "cmd": "my-app command",
    "cpus": 0.5,
    "mem": 600,
    "instances": 1,
    "uris": [
        "http://1.2.3.4/artifact.tar.gz"
    ],
    "backoffSeconds": 1,
    "backoffFactor": 1.15,
    "maxLaunchDelaySeconds": 3600,
    "healthChecks": [
        {
          "protocol": "COMMAND",
          "cmd": { "value": "curl -f -X GET http://$HOST:$PORT0/health | grep STRING" },
          "gracePeriodSeconds": 5,
          "intervalSeconds": 10,
          "timeoutSeconds": 10,
          "maxConsecutiveFailures": 3
        }
    ]
}
pierluigi commented 9 years ago

@jolexa thanks for reporting this. I took the liberty of re-formatting the JSON block in your comment for easier readability.

cc @kolloch

aquamatthias commented 8 years ago

This is basically #2164 for json handling