newton client incompatible with mitaka magnum server

Bug #1635244 reported by Ricardo Rocha
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
New
Undecided
Unassigned

Bug Description

Upgrading openstack clients to newton (and getting the new magnum newton client), i cannot use it against a magnum mitaka instance any longer. This happens even if i don't specify any of the new parameters in a baymodel, as it seems to insert defaults in the request.

Log from the client:
# magnum --debug baymodel-create --name testmodel00 --image-id fedora-atomic --keypair-id mykeypair --external-network-id NETWORK --coe swarm
DEBUG (session:337) REQ: curl -g -i --cacert "/var/lib/puppet/ssl/certs/ca.pem" -X GET https://keystone.default.svc.cluster.local/main/v2.0 -H "Accept: application/json" -H "User-Agent: magnum keystoneauth1/2.12.1 python-requests/2.10.0 CPython/2.7.5"
INFO (connectionpool:788) Starting new HTTPS connection (1): keystone.default.svc.cluster.local
DEBUG (connectionpool:395) "GET /main/v2.0 HTTP/1.1" 200 361
DEBUG (session:366) RESP: [200] Date: Thu, 20 Oct 2016 12:40:30 GMT Server: Apache/2.4.6 (CentOS) Vary: X-Auth-Token x-openstack-request-id: req-4683885d-73a0-4e09-b4eb-fdc7aa37e23c Content-Length: 361 Connection: close Content-Type: application/json
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "https://keystone.default.svc.cluster.local/main/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG (v2:63) Making authentication request to https://keystone.default.svc.cluster.local/main/v2.0/tokens
INFO (connectionpool:248) Resetting dropped connection: keystone.default.svc.cluster.local
DEBUG (connectionpool:395) "POST /main/v2.0/tokens HTTP/1.1" 200 4945
WARNING: Baymodel commands are deprecated and will be removed in a future release.
Use cluster commands to avoid seeing this message.
DEBUG (session:337) REQ: curl -g -i --cacert "/var/lib/puppet/ssl/certs/ca.pem" -X POST http://magnum.default.svc.cluster.local:9511/v1/baymodels -H "OpenStack-API-Version: container-infra latest" -H "X-Auth-Token: {SHA1}fbf8ff8213bcfe835f6cc30952c2689668d17d48" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: None" -d '{"labels": {}, "floating_ip_enabled": true, "fixed_subnet": null, "master_flavor_id": null, "no_proxy": null, "https_proxy": null, "tls_disabled": false, "keypair_id": "mykeypair", "public": false, "http_proxy": null, "docker_volume_size": null, "server_type": "vm", "external_network_id": "NETWORK", "image_id": "fedora-atomic", "volume_driver": null, "registry_enabled": false, "docker_storage_driver": "devicemapper", "name": "testmodel00", "network_driver": null, "fixed_network": null, "coe": "swarm", "flavor_id": "m1.medium", "master_lb_enabled": false, "dns_nameserver": "8.8.8.8"}'
INFO (connectionpool:213) Starting new HTTP connection (1): magnum.default.svc.cluster.local
DEBUG (connectionpool:395) "POST /v1/baymodels HTTP/1.1" 400 339
DEBUG (session:366) RESP: [400] Date: Thu, 20 Oct 2016 12:40:31 GMT Server: WSGIServer/0.1 Python/2.7.5 X-OpenStack-Magnum-API-Minimum-Version: 1.1 X-OpenStack-Magnum-API-Maximum-Version: 1.1 X-OpenStack-Magnum-API-Version: 1.1 Content-Type: application/json Content-Length: 339 x-openstack-request-id: req-b1fdc9a1-a54b-40d4-b40d-9ea78ea19d32
RESP BODY: {"errors": [{"status": 400, "code": "client", "links": [], "title": "Unknown attributes for argument baymodel: master_lb_enabled, docker_storage_driver, fixed_subnet, floating_ip_enabled", "detail": "Unknown attributes for argument baymodel: master_lb_enabled, docker_storage_driver, fixed_subnet, floating_ip_enabled", "request_id": ""}]}

DEBUG (shell:694) Unknown attributes for argument baymodel: master_lb_enabled, docker_storage_driver, fixed_subnet, floating_ip_enabled (HTTP 400) (Request-ID: req-b1fdc9a1-a54b-40d4-b40d-9ea78ea19d32)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/magnumclient/shell.py", line 691, in main
    OpenStackMagnumShell().main(map(encodeutils.safe_decode, sys.argv[1:]))
  File "/usr/lib/python2.7/site-packages/magnumclient/shell.py", line 633, in main
    args.func(self.cs, args)
  File "<string>", line 2, in do_baymodel_create
  File "/usr/lib/python2.7/site-packages/magnumclient/common/cliutils.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/magnumclient/v1/baymodels_shell.py", line 156, in do_baymodel_create
    baymodel = cs.baymodels.create(**opts)
  File "/usr/lib/python2.7/site-packages/magnumclient/v1/basemodels.py", line 107, in create
    return self._create(self._path(), new)
  File "/usr/lib/python2.7/site-packages/magnumclient/common/base.py", line 49, in _create
    resp, body = self.api.json_request('POST', url, body=body)
  File "/usr/lib/python2.7/site-packages/magnumclient/common/httpclient.py", line 366, in json_request
    resp = self._http_request(url, method, **kwargs)
  File "/usr/lib/python2.7/site-packages/magnumclient/common/httpclient.py", line 350, in _http_request
    error_json.get('debuginfo'), method, url)
BadRequest: Unknown attributes for argument baymodel: master_lb_enabled, docker_storage_driver, fixed_subnet, floating_ip_enabled (HTTP 400) (Request-ID: req-b1fdc9a1-a54b-40d4-b40d-9ea78ea19d32)
ERROR: Unknown attributes for argument baymodel: master_lb_enabled, docker_storage_driver, fixed_subnet, floating_ip_enabled (HTTP 400) (Request-ID: req-b1fdc9a1-a54b-40d4-b40d-9ea78ea19d32)

And in the server side:
2016-10-20 12:40:31.046 1180 DEBUG magnum.api.controllers.v1 [req-cfbecfbf-7a9a-42f1-b357-3b7c77bb784a admin services - - -] Processing request: url: http://magnum.default.svc.cluster.local:9511/v1/baymodels, POST, body: {"labels": {}, "floating_ip_enabled": true, "fixed_subnet": null, "master_flavor_id": null, "no_proxy": null, "https_proxy": null, "tls_disabled": false, "keypair_id": "mykeypair", "public": false, "http_proxy": null, "docker_volume_size": null, "server_type": "vm", "external_network_id": "NETWORK", "image_id": "fedora-atomic", "volume_driver": null, "registry_enabled": false, "docker_storage_driver": "devicemapper", "name": "testmodel00", "network_driver": null, "fixed_network": null, "coe": "swarm", "flavor_id": "m1.medium", "master_lb_enabled": false, "dns_nameserver": "8.8.8.8"} _route /usr/lib/python2.7/site-packages/magnum/api/controllers/v1/__init__.py:250
2016-10-20 12:40:31.048 1180 DEBUG wsme.api [req-e3cb6383-7793-473f-80b9-7eee57e1d8f0 admin services - - -] Client-side error: Unknown attributes for argument baymodel: master_lb_enabled, docker_storage_driver, fixed_subnet, floating_ip_enabled format_exception /usr/lib/python2.7/site-packages/wsme/api.py:221

To keep backwards compatibility we should not insert these defaults in the client if not specified explicitly, the server has defaults.

Probably good to add a note in the Magnum Newton release notes regarding this.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.