Uploaded image for project: 'Marathon'
  1. Marathon
  2. MARATHON-3495

Error message when trying to PUT to /v2/apps is unhelpful

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Low
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: API

      Description

      I'm trying to update an application in Marathon. It has the ID specified in the application JSON. I tried PUTing it to /v2/apps but it gives me an unhelpful error message:

      Q-M:marathon-test sunil$ http -v PUT http://<snipped>:8080/v2/apps < demo.json
      PUT /v2/apps HTTP/1.1
      Accept: application/json
      Accept-Encoding: gzip, deflate
      Connection: keep-alive
      Content-Length: 239
      Content-Type: application/json
      Host: <snipped>:8080
      User-Agent: HTTPie/0.9.2
      
      {
          "cmd": "python -m SimpleHTTPServer $PORT",
          "container": {
              "docker": {
                  "image": "superguenter/demo-app"
              },
              "type": "DOCKER"
          },
          "cpus": 0.01,
          "id": "demo",
          "instances": 300,
          "mem": 256,
          "ports": [
              3000
          ]
      }
      
      HTTP/1.1 400 Bad Request
      Access-Control-Allow-Headers:
      Access-Control-Allow-Methods: GET, HEAD, OPTIONS
      Access-Control-Allow-Origin: *
      Access-Control-Max-Age: 86400
      Cache-Control: no-cache, no-store, must-revalidate
      Content-Type: application/json
      Expires: 0
      Pragma: no-cache
      Server: Jetty(8.y.z-SNAPSHOT)
      Transfer-Encoding: chunked
      X-Marathon-Leader: http://<snipped>:8080
      
      {
          "details": [
              {
                  "errors": [
                      "error.expected.jsarray"
                  ],
                  "path": ""
              }
          ],
          "message": "Invalid JSON"
      }
      

      Turns out I need to PUT to /v2/apps/demo/. It'd be great if this error message could suggest that.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ssk2 Sunil Shah (Inactive)
                Team:
                Orchestration Team
                Watchers:
                Jason Gilanfarr (Inactive), Tim Harper
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: