glance-replicator livecopy cannot work due to Bad header: x-image-meta-virtual-size

Bug #1373333 reported by Jun Hong Li
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Jun Hong Li

Bug Description

I would like to use "glance-replicator livecopy" command to replicate the images from one openstack instance to anthor, it goes to error while running the livecopy command:

2014-09-24 17:32:09.082 24953 CRITICAL glance [-] ServerErrorException: 400 Bad Request

The server could not comply with the request since it is either malformed or otherwise incorrect.

 Bad header: x-image-meta-virtual-size
2014-09-24 17:32:09.082 24953 TRACE glance Traceback (most recent call last):
2014-09-24 17:32:09.082 24953 TRACE glance File "/usr/bin/glance-replicator", line 10, in <module>
2014-09-24 17:32:09.082 24953 TRACE glance sys.exit(main())
2014-09-24 17:32:09.082 24953 TRACE glance File "/usr/lib/python2.6/site-packages/glance/cmd/replicator.py", line 739, in main
2014-09-24 17:32:09.082 24953 TRACE glance command(options, args)
2014-09-24 17:32:09.082 24953 TRACE glance File "/usr/lib/python2.6/site-packages/glance/cmd/replicator.py", line 516, in replication_livecopy
2014-09-24 17:32:09.082 24953 TRACE glance image_response)
2014-09-24 17:32:09.082 24953 TRACE glance File "/usr/lib/python2.6/site-packages/glance/cmd/replicator.py", line 238, in add_image
2014-09-24 17:32:09.082 24953 TRACE glance response = self._http_request('POST', url, headers, image_data)
2014-09-24 17:32:09.082 24953 TRACE glance File "/usr/lib/python2.6/site-packages/glance/cmd/replicator.py", line 125, in _http_request
2014-09-24 17:32:09.082 24953 TRACE glance raise ServerErrorException(response.read())
2014-09-24 17:32:09.082 24953 TRACE glance ServerErrorException: 400 Bad Request
2014-09-24 17:32:09.082 24953 TRACE glance
2014-09-24 17:32:09.082 24953 TRACE glance The server could not comply with the request since it is either malformed or otherwise incorrect.
2014-09-24 17:32:09.082 24953 TRACE glance
2014-09-24 17:32:09.082 24953 TRACE glance Bad header: x-image-meta-virtual-size
2014-09-24 17:32:09.082 24953 TRACE glance

Revision history for this message
Jun Hong Li (junhongl) wrote :

The v1 version API is used by the client.

Jun Hong Li (junhongl)
Changed in glance:
assignee: nobody → Jun Hong Li (junhongl)
Zhi Yan Liu (lzy-dev)
Changed in glance:
status: New → Triaged
importance: Undecided → Medium
Changed in glance:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/124601
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=4b2304d6bb1d77db1e411f375a00a93aaabca262
Submitter: Jenkins
Branch: master

commit 4b2304d6bb1d77db1e411f375a00a93aaabca262
Author: Jun Hong Li <email address hidden>
Date: Fri Sep 26 10:16:23 2014 +0800

    Fix bad header bug in glance-replicator

    When trying to use "glance-replicator livecopy" to replicate the
    images from one OpenStack glance to another, it encounters "Bad
    header" error for "x-image-meta-virtual-size" header. This is
    because this header is not in the whitelist of v1 API headers of
    form "x-image-meta-xxx".

    Another problem after adding this "x-image-meta-virtual-size" to
    header whitelist is that the sqlalchemy fail due to virual_size is
    "None", which cannot be converted to int. To fix this problem, we
    should avoid converting the None value attribute in GET
    /v1/images/detail response to the header of POST /v1/images. I
    added the None value check, following what the way in
    glance/common/utils.py image_meta_to_http_headers() method.

    Closes-Bug: #1373333

    Change-Id: I13182c4e3212024a9d5663cefd2951c576961f4f

Changed in glance:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (proposed/juno)

Fix proposed to branch: proposed/juno
Review: https://review.openstack.org/128177

Thierry Carrez (ttx)
tags: added: juno-rc-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (proposed/juno)

Change abandoned by Thierry Carrez (<email address hidden>) on branch: proposed/juno
Review: https://review.openstack.org/128177
Reason: 2014.2 released

Thierry Carrez (ttx)
tags: added: juno-backport-potential
removed: juno-rc-potential
Revision history for this message
Erno Kuvaja (jokke) wrote :

Hi Jun Hong,

Are you still working on this to bring it in Kilo?

Changed in glance:
status: Fix Committed → New
importance: Medium → Low
Revision history for this message
Jun Hong Li (junhongl) wrote :

Hi Jokke,

The fix has been merged into Kilo branch, I will close this bug.

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