can not update locations

Bug #1412304 reported by Yukihiro KAWADA
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Incomplete
Undecided
Unassigned

Bug Description

If location-update using below cli then error occured and locations status changed to deleted.
Believe it or not, the file was also deleted.
I want to update only metadata of the location.

glance location-update (v2)
usage: glance --os-image-api-version 2 location-update --url <URL> [--metadata <STRING>] <ID>

Example:
glance --debug --os-image-api-version 2 location-update --url file:///var/lib/glance/images/7059e766-aa3f-4af9-83f4-c482177533e5 --metadata '{"foo":"bar"}' 7059e766-aa3f-4af9-83f4-c482177533e5

Error logs:
Request returned failure status 400.
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 608, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/shell.py", line 304, in do_location_update
    image = gc.images.update_location(args.id, args.url, metadata)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 284, in update_location
    self._send_image_update_request(image_id, patches)
  File "/usr/lib/python2.7/site-packages/glanceclient/v2/images.py", line 209, in _send_image_update_request
    self.http_client.patch(url, headers=hdrs, data=json.dumps(patch_body))
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 277, in patch
    return self._request('PATCH', url, **kwargs)
  File "/usr/lib/python2.7/site-packages/glanceclient/common/http.py", line 236, in _request
    raise exc.from_response(resp, resp.content)
HTTPBadRequest: <html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Invalid location<br /><br />

 </body>
</html> (HTTP 400)
<html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Invalid location<br /><br />

 </body>
</html> (HTTP 400)

Changed in glance:
assignee: nobody → Raga lahari (raga-lahari)
Changed in glance:
assignee: Raga lahari (raga-lahari) → nobody
Revision history for this message
Erno Kuvaja (jokke) wrote :

I cannot replicate the issue. Would you mind to share your configuration where you saw this behavior?

Changed in glance:
status: New → Incomplete
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.