Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update app with minimal=False doesn't work anymore #145

Open
fengyehong opened this issue Aug 23, 2016 · 1 comment
Open

Update app with minimal=False doesn't work anymore #145

fengyehong opened this issue Aug 23, 2016 · 1 comment

Comments

@fengyehong
Copy link
Contributor

If we update app with minimal=False, marathon complains: {"message":"Invalid JSON","details":[{"path":"","errors":["You cannot specify both uris and fetch fields"]}]}

Don't know how to fix it.

>>> import logging
>>> logging.basicConfig()
>>> ...
>>> ...
>>> print app
MarathonApp::{'user': None, 'tasks': [], 'labels': {}, 'cpus': 2, 'instances': 0, 'readiness_checks': [], 'disk': 0, 'id': u'/minimal', 'tasks_running': 0, 'container': MarathonContainer::{"docker": {"forcePullImage": false, "image": "docker-registry.qiyi.virtual/guoguanglu/httpd:2.4", "network": "BRIDGE", "parameters": [], "portMappings": [{"containerPort": 8080, "hostPort": 0, "labels": {}, "name": null, "protocol": "tcp", "servicePort": 10000}], "privileged": false}, "type": "DOCKER", "volumes": []}, 'readiness_check_results': [], 'max_launch_delay_seconds': 600, 'tasks_staged': 0, 'deployments': [], 'version': None, 'env': {}, 'upgrade_strategy': MarathonUpgradeStrategy::{"maximumOverCapacity": 1, "minimumHealthCapacity": 1}, 'uris': [], 'port_definitions': [PortDefinition::{"labels": {}, "name": null, "port": 10000, "protocol": "tcp"}], 'version_info': MarathonAppVersionInfo::{"lastConfigChangeAt": "2016-08-10T07:25:07.472000Z", "lastScalingAt": "2016-08-10T07:30:06.899000Z"}, 'mem': 1024, 'task_kill_grace_period_seconds': None, 'args': None, 'backoff_factor': 1.15, 'task_stats': None, 'accepted_resource_roles': None, 'backoff_seconds': 1, 'health_checks': [MarathonHealthCheck::{"command": null, "gracePeriodSeconds": 300, "ignoreHttp1Xx": false, "intervalSeconds": 60, "maxConsecutiveFailures": 3, "path": "/", "port": 0, "portIndex": 0, "protocol": "HTTP", "timeoutSeconds": 20}, MarathonHealthCheck::{"command": null, "gracePeriodSeconds": 150, "ignoreHttp1Xx": false, "intervalSeconds": 60, "maxConsecutiveFailures": 3, "path": "/a", "port": 0, "portIndex": 0, "protocol": "HTTP", "timeoutSeconds": 20}], 'tasks_healthy': 0, 'tasks_unhealthy': 0, 'gpus': None, 'task_rate_limit': None, 'secrets': {}, 'fetch': [], 'cmd': u'sleep 100', 'require_ports': False, 'dependencies': [], 'residency': None, 'last_task_failure': MarathonTaskFailure::{"appId": "/minimal", "host": "mesos-master-dev043-cqdx.qiyi.virtual", "message": "Docker container run error: Container exited on error: exited with status 1", "slaveId": "e0a0bfc9-4663-45fa-8a12-4a7e3da9ca20-S1", "state": "TASK_FAILED", "taskId": "minimal.e7de7f4f-5ec7-11e6-b254-525400fd9fbc", "timestamp": "2016-08-10T06:59:02.932000Z", "version": "2016-08-10T06:57:05.525Z"}, 'executor': u'', 'store_urls': [], 'ports': [10000], 'constraints': []}
>>>
>>> marathon.update_app('minimal', app, minimal=True)
{u'deploymentId': u'a08b4f09-5b85-4354-b65f-c226a7e6df3d', u'version': u'2016-08-23T10:07:23.494Z'}
>>> 
>>> marathon.update_app('minimal', app, minimal=False)
ERROR:marathon:Got HTTP 400: {"message":"Invalid JSON","details":[{"path":"","errors":["You cannot specify both uris and fetch fields"]}]}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "marathon/client.py", line 260, in update_app
    'PUT', '/v2/apps/{app_id}'.format(app_id=app_id), params=params, data=data)
  File "marathon/client.py", line 88, in _do_request
    raise MarathonHttpError(response)
marathon.exceptions.MarathonHttpError: MarathonHttpError: HTTP 400 returned with message, "Invalid JSON"
@erSitzt
Copy link

erSitzt commented Aug 1, 2017

I tried
app.__dict__.pop('uris')
and it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants