cluster, profile and node can't be updated

Bug #1472557 reported by Haiwei Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-senlinclient
Fix Released
Undecided
Haiwei Xu

Bug Description

Currently when you running 'cluster-update', 'profile-update' or 'node-update', will get the same error like:

DEBUG (transport) RESP BODY: 404 Not Found

The resource could not be found.

DEBUG (transport) encoding: UTF-8
Traceback (most recent call last):
  File "/usr/local/bin/senlin", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/shell.py", line 309, in main
    SenlinShell().main(args)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/shell.py", line 295, in main
    args.func(sc, args)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/v1/shell.py", line 191, in do_profile_update
    sc.update(models.Profile, params)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/v1/client.py", line 102, in update
    client_exc.parse_exception(ex)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/common/exc.py", line 234, in parse_exception
    record = jsonutils.loads(exc.details)
  File "/usr/local/lib/python2.7/dist-packages/oslo_serialization/jsonutils.py", line 214, in loads
    return json.loads(encodeutils.safe_decode(s, encoding), **kwargs)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 369, in decode
    raise ValueError(errmsg("Extra data", s, end, len(s)))
ValueError: Extra data: line 1 column 5 - line 5 column 4 (char 4 - 52)

This seems like an openstacksdk bug.

Haiwei Xu (xu-haiwei)
Changed in python-senlinclient:
assignee: nobody → Haiwei Xu (xu-haiwei)
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-senlinclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/204333

Changed in python-senlinclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-senlinclient (master)

Reviewed: https://review.openstack.org/204333
Committed: https://git.openstack.org/cgit/stackforge/python-senlinclient/commit/?id=72da3597e4a00614d49dbec121fce496ebb8c23d
Submitter: Jenkins
Branch: master

commit 72da3597e4a00614d49dbec121fce496ebb8c23d
Author: Haiwei Xu <email address hidden>
Date: Wed Jul 22 10:52:33 2015 +0900

    Parse exception from SDK

    Some exceptions from SDK are not in stardard json format,
    this patch parse it to json.

    Change-Id: If39704f24b084cd1f6aaccd3c951636a53f3ddc1
    Partial-Bug: #1472557

Revision history for this message
Haiwei Xu (xu-haiwei) wrote :

This bug is partially fixed by this patch https://review.openstack.org/204333.

After this fix, we will got this error when updating the resource.

 $senlin -d profile-update -n new_pro -t os.heat.stack ed7defc2

DEBUG (transport) REQ: curl -i -X 'PUT' 'http://192.168.11.81:8778/v1/25f5eb84efc94561a016d05a6c01ade1/profiles/ed7defc2-e576-408c-85bc-05549a7e5156' -H 'User-Agent: python-senlinclient python-openstacksdk/0.5.1 python-requests/2.7.0 CPython/2.7.6 Linux/3.13.0-32-generic' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'X-Auth-Token: 503fdebe781e41ea859c11304d5ff9b1' --data ' {"profile": {"metadata": {}, "spec": null, "name": "new_pro", "permission": ""}} '
DEBUG (connectionpool) "PUT /v1/25f5eb84efc94561a016d05a6c01ade1/profiles/ed7defc2-e576-408c-85bc-05549a7e5156 HTTP/1.1" 404 52
DEBUG (transport) RESP: [404] {'date': 'Wed, 22 Jul 2015 06:07:19 GMT', 'connection': 'keep-alive', 'content-type': 'text/plain; charset=UTF-8', 'content-length': '52', 'x-openstack-request-id': 'req-88aa41b6-a83b-41bd-af51-b6b2587cc08b'}
DEBUG (transport) RESP BODY: 404 Not Found

The resource could not be found.

DEBUG (transport) encoding: UTF-8

Traceback (most recent call last):
  File "/usr/local/bin/senlin", line 10, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/shell.py", line 309, in main
    SenlinShell().main(args)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/shell.py", line 295, in main
    args.func(sc, args)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/v1/shell.py", line 191, in do_profile_update
    sc.update(models.Profile, params)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/v1/client.py", line 89, in update
    client_exc.parse_exception(ex)
  File "/usr/local/lib/python2.7/dist-packages/senlinclient/common/exc.py", line 266, in parse_exception
    raise inst(record)
senlinclient.common.exc.HTTPNotFound: ERROR(404): 404 Not Found

The resource could not be found.

Though the resource exists, 404 is returned. It seems the url doesn't point to the right place.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-senlinclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/204488

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-senlinclient (master)

Reviewed: https://review.openstack.org/204488
Committed: https://git.openstack.org/cgit/stackforge/python-senlinclient/commit/?id=63b054e39f86194b629279ec526510b1a1f12805
Submitter: Jenkins
Branch: master

commit 63b054e39f86194b629279ec526510b1a1f12805
Author: Haiwei Xu <email address hidden>
Date: Wed Jul 22 17:16:18 2015 +0900

    Use PATCH method to update resources

    Senlin api uses PATCH to update resources, client side
    should keep consistency with server side.

    Change-Id: I724f0cb6b8fd2d6cdb6104f1cf3a7cb933d26442
    Partial-Bug: #1472557

Haiwei Xu (xu-haiwei)
Changed in python-senlinclient:
status: In Progress → Fix Committed
Qiming Teng (tengqim)
Changed in python-senlinclient:
status: Fix Committed → Fix Released
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.