-
Notifications
You must be signed in to change notification settings - Fork 841
Marathon v1.4.0 /v2/apps PUT REST API Error #5211
Comments
For reproducibility, here is the curl command: While the POST command for the same job succeeds: |
Can't reproduce with httpie http PUT localhost:8080/v2/apps/ << EOF
[
{
"id": "/test/sleep120",
"cmd": "sleep 120",
"cpus": 0.3,
"instances": 2,
"mem": 9
}
]
EOF Got: HTTP/1.1 200 OK
Cache-Control: no-cache, no-store, must-revalidate
Content-Type: application/json; qs=2
Date: Sat, 18 Feb 2017 19:36:11 GMT
Expires: 0
Marathon-Deployment-Id: 164d0aa7-5c29-4f48-bdd4-10ab02e5691e
Pragma: no-cache
Server: Jetty(9.3.6.v20151106)
Transfer-Encoding: chunked
X-Marathon-Leader: http://localhost:8080
{
"deploymentId": "164d0aa7-5c29-4f48-bdd4-10ab02e5691e",
"version": "2017-02-18T19:36:11.355Z"
} Edit: curl -X PUT -H "Content-type: application/json" localhost:8080/v2/apps --data '[{"id": "/test/sleep60", "cmd": "sleep 60", "cpus": 0.3, "instances": 2, "mem": 9}]'
{"version":"2017-02-18T19:38:05.903Z","deploymentId":"cb425bc7-6f77-4d3d-a2cf-8e968bea4f1a"}% |
@zanes2016 how do you run Marathon? How it's configured? |
Maybe it's something with my environment?
Response
OS:
Marathon Version:
Mesos:
Zookeeper:
|
@janisz
using the init script that came with the package. Is there some way I can view/post the Marathon configs that would help? Edit:
Returns
|
Maybe I'm missing something obvious. But I'm able to consistently reproduce the issue in a Docker container (ubuntu 14.04 base image) with the following setup: @janisz Do you have any suggestions? Host Machine
Docker Container
The last command always returns:
POST API
Returns
Edit: |
Probably deb is broken. |
I believe it's not just the deb. I built Marathon 1.4.0 from source (I downloaded the .tar.gz from releases here on Github) and it's not possible to update applications from the UI. I see the same 422 responses. This should be easy to reproduce:
PS. The above steps work as expected with Marathon 1.3.10, also built from source. |
With the newly introduced `PATCH` semantic, we introduced a missleading method declaration which is not resolvable for jersey. Therefore this logic was restructured and methods are defined explicitly. Re-enabled AppDeployIntegrationTest by the way. Test Plan: sbt "integration:test-only *AppDeployIntegrationTest"
* Fixes #5211 by defining the jersey annotated methods explicitly. With the newly introduced `PATCH` semantic, we introduced a misleading method declaration which is not resolvable for jersey. Therefore this logic was restructured and methods are defined explicitly. Re-enabled AppDeployIntegrationTest by the way. * Revert "Mark tests as unstable ... (#5202)" This reverts commit abb58a1.
fixed on 1.4 via e1b7952 |
Summary: 1.) PUT on /v2/apps has a PATCH semantic. (d2iq-archive#5157) See 8df2a5d * document that, by default, PUT on /v2/apps has a PATCH semantic: only the fields specified in the app update are applied to the existing app definition. * add a query parameter, `partialUpdate`, that allows for proper PUT semantics for an app. `false` means "completely replace the existing app with the new one that I'm **fully specifying** here" 2.) Add support for PATCH updates to apps in 1.4 (d2iq-archive#5183) See 1ba8ea7 * added support to PATCH apps also-by: unterstein 3.) Fixes d2iq-archive#5211 by defining the jersey annotated methods explicitly. (d2iq-archive#5217) See e1b7952 * With the newly introduced `PATCH` semantic, we introduced a misleading method declaration which is not resolvable for jersey. Therefore this logic was restructured and methods are defined explicitly. Test Plan: sbt test sbt integration:test Reviewers: meichstedt, aquamatthias, jasongilanfarr, jenkins, jdef Reviewed By: meichstedt, aquamatthias, jenkins, jdef Subscribers: jdef, marathon-team Differential Revision: https://phabricator.mesosphere.com/D552
Marathon v1.4.0 on Ubuntu 14.04 REST API /v2/apps PUT does not seem to work. It always returns error status 422.
Try starting a simple new app:
And the return message (status 422):
The easiest way to reproduce this is with the Marathon UI API Console:
http://localhost:8080/api-console/index.html
And use the /v2/apps PUT API.
This same job, /test/sleep120, works if it's started using the POST API.
The only error message I see is in syslog
The text was updated successfully, but these errors were encountered: