glance image-show does not output correctly

Bug #1487645 reported by Colleen Murphy
36
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Critical
David Sariel
python-glanceclient (Ubuntu)
Fix Released
High
James Page
python-urllib3 (Ubuntu)
Invalid
High
Unassigned
requests (Ubuntu)
Invalid
High
Unassigned

Bug Description

1) Description of the problem

When running `glance image-show` on an existing image, the glance client does not output the details of the image.

glance client version: 0.19.0

operating system: ubuntu 14.04

The glance client is installed from the UCA liberty-staging repo. This bug does not appear when python-glanceclient is installed from the CentOS 7 delorean repo or when installed directly from pip.

2) Impact

A user can't view details of their image via the command line.

The behavior trickles down to python-openstackclient.

Our use case is in puppet: the glance_image provider in the glance puppet module cannot fetch details of an uploaded image, and so tries to upload the image again with --copy-from and fails.

3) Expected behavior

(Installed from UCA Kilo)

# glance --version
0.15.0
# glance image-show 3aa89a60-a18f-4c5e-bda1-a60eed5f6997
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | d972013792949d0d3ba628fbe8685bce |
| container_format | bare |
| created_at | 2015-08-21T21:22:57.000000 |
| deleted | False |
| disk_format | qcow2 |
| id | 3aa89a60-a18f-4c5e-bda1-a60eed5f6997 |
| is_public | True |
| min_disk | 0 |
| min_ram | 0 |
| name | test_image |
| owner | fe3360a176d54a049883f9914552798d |
| protected | False |
| size | 13147648 |
| status | active |
| updated_at | 2015-08-21T21:23:00.000000 |
+------------------+--------------------------------------+

4) Actual behavior

(Installed from UCA Liberty-staging)

# glance --version
0.19.0
# glance image-show 728d718c-22cd-4c59-a25d-58ec163d7c69
id

5) Steps to reproduce

 - install the liberty-staging repo
 - apt-get install python-glanceclient
 - run glance image-show against an openstack cloud with glance exposed

Additional information:

# lsb_release -rd
Description: Ubuntu 14.04.2 LTS
Release: 14.04
# apt-cache policy python-glanceclient
python-glanceclient:
  Installed: 1:0.19.0-1ubuntu1~cloud0
  Candidate: 1:0.19.0-1ubuntu1~cloud0
  Version table:
 *** 1:0.19.0-1ubuntu1~cloud0 0
        500 http://ppa.launchpad.net/ubuntu-cloud-archive/liberty-staging/ubuntu/ trusty/main amd64 Packages
        100 /var/lib/dpkg/status
     1:0.12.0-0ubuntu1 0
        500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in python-glanceclient (Ubuntu):
status: New → Confirmed
Revision history for this message
Ed Balduf (ebalduf) wrote :

I'm getting this too, on a fresh devstack pull from head on Friday 8/21 onto Fedora 21.

[e@devstack devstack]$ glance image-list
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
| e20fae04-35b1-42f4-9025-2712be7396e0 | cirros-0.3.2-x86_64-disk | qcow2 | bare | 13167616 | active |
| 66e788d6-ee11-492a-ba7b-3d3e1ff70cbe | cirros-0.3.2-x86_64-uec | ami | ami | 25165824 | active |
| 51b75631-d165-4f5f-b869-997a25ecc211 | cirros-0.3.2-x86_64-uec-kernel | aki | aki | 4969360 | active |
| c6ecd6bc-031c-4129-8de4-c8c0c9263bf6 | cirros-0.3.2-x86_64-uec-ramdisk | ari | ari | 3723817 | active |
+--------------------------------------+---------------------------------+-------------+------------------+----------+--------+
[e@devstack devstack]$ glance image-show e20fae04-35b1-42f4-9025-2712be7396e0
id
[e@devstack devstack]$ glance --version
0.19.0
[e@devstack devstack]$ cat /etc/fedora-release
Fedora release 21 (Twenty One)
[e@devstack devstack]$ uname -a
Linux devstack.p.solidfire.net 4.0.4-202.fc21.x86_64 #1 SMP Wed May 27 22:28:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Colleen Murphy (krinkle) wrote :

Moving this to the python-glanceclient project instead of the Ubuntu package since this appears to be a cross-distro problem.

affects: python-glanceclient (Ubuntu) → python-glanceclient
Revision history for this message
Ed Balduf (ebalduf) wrote :
Download full text (3.6 KiB)

A bit more detail here to help. Here is the output from glanceclient with debug and verbose. Taking a look at the trace and the code in master they were radically different, so it seems like this is a version problem. See below

[e@devstack glanceclient]$ glance -d -v image-show e20fae04-35b1-42f4-9025-2712be7396e0
curl -g -i -X HEAD -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}1e5ffd286b348fd2232645b4f21adbd41e27d447' -H 'Content-Type: application/octet-stream' http://172.27.162.241:9292/v1/images/e20fae04-35b1-42f4-9025-2712be7396e0

HTTP/1.1 200 OK
Content-Length: 0
X-Image-Meta-Id: e20fae04-35b1-42f4-9025-2712be7396e0
X-Image-Meta-Deleted: False
X-Image-Meta-Checksum: 64d7c1cd2b6f60c92c14662941cb7913
X-Image-Meta-Status: active
X-Image-Meta-Container_format: bare
X-Image-Meta-Protected: False
X-Image-Meta-Min_disk: 0
X-Image-Meta-Min_ram: 0
X-Image-Meta-Created_at: 2015-08-21T21:26:27.000000
X-Image-Meta-Size: 13167616
Connection: keep-alive
Etag: 64d7c1cd2b6f60c92c14662941cb7913
X-Image-Meta-Is_public: True
Date: Mon, 24 Aug 2015 14:28:26 GMT
X-Image-Meta-Owner: 6880ca64ebd04c10ad81b92eb0a890c0
X-Image-Meta-Updated_at: 2015-08-21T21:26:30.000000
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-6b63d869-0069-44cb-83f4-cbe77aa1ee0e
X-Image-Meta-Disk_format: qcow2
X-Image-Meta-Name: cirros-0.3.2-x86_64-disk

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glanceclient/shell.py", line 667, in main
    args.func(client, args)
  File "/usr/lib/python2.7/site-packages/glanceclient/v1/shell.py", line 142, in do_image_show
    image_id = utils.find_resource(gc.images, args.image).id
  File "/usr/lib/python2.7/site-packages/glanceclient/openstack/common/apiclient/base.py", line 491, in __getattr__
    self.get()
  File "/usr/lib/python2.7/site-packages/glanceclient/openstack/common/apiclient/base.py", line 509, in get
    new = self.manager.get(self.id)
  File "/usr/lib/python2.7/site-packages/glanceclient/openstack/common/apiclient/base.py", line 494, in __getattr__
    raise AttributeError(k)
AttributeError: id
id

What I have also found is that if I pull python-glanceclient from the git.openstack.org and move it into site-packages, I still get the same version reported, BUT it now works.

[e@devstack site-packages]$ glance --version
0.19.0
[e@devstack site-packages]$ glance image-show e20fae04-35b1-42f4-9025-2712be7396e0
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | 64d7c1cd2b6f60c92c14662941cb7913 |
| container_format | bare |
| created_at | 2015-08-21T21:26:27Z |
| disk_format | qcow2 |
| id | e20fae04-35b1-42f4-9025-2712be7396e0 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-0.3.2-x86_64-disk |
| owner | 6880ca...

Read more...

Revision history for this message
Flavio Percoco (flaper87) wrote :

This might be related to https://bugs.launchpad.net/python-glanceclient/+bug/1476770

I'll keep looking into it

Revision history for this message
Emilien Macchi (emilienm) wrote :
Download full text (1.3 MiB)

So I don't have the issue in RDO trunk right now (Liberty).

See output:

FailedConsole Output

2015-08-25 13:07:01.721 | Started by user anonymous
2015-08-25 13:07:01.722 | [EnvInject] - Loading node environment variables.
2015-08-25 13:07:05.546 | Building remotely on devstack-centos7-hpcloud-b3-4517871 (devstack-centos7) in workspace /home/jenkins/workspace/gate-puppet-openstack-integration-dsvm-centos7
2015-08-25 13:07:06.133 | [gate-puppet-openstack-integration-dsvm-centos7] $ /bin/sh /tmp/hudson6094296708933848930.sh
2015-08-25 13:07:06.813 | Detailed logs: http://logs.openstack.org/94/216694/1/check/gate-puppet-openstack-integration-dsvm-centos7/efc827b//
2015-08-25 13:07:07.168 | [gate-puppet-openstack-integration-dsvm-centos7] $ /bin/bash /tmp/hudson3488950356828175082.sh
2015-08-25 13:07:07.480 | INFO:zuul.CloneMapper:Workspace path set to: /home/jenkins/workspace/gate-puppet-openstack-integration-dsvm-centos7
2015-08-25 13:07:07.480 | INFO:zuul.CloneMapper:Mapping projects to workspace...
2015-08-25 13:07:07.480 | INFO:zuul.CloneMapper: openstack/puppet-openstack-integration -> /home/jenkins/workspace/gate-puppet-openstack-integration-dsvm-centos7/openstack/puppet-openstack-integration
2015-08-25 13:07:07.480 | INFO:zuul.CloneMapper:Expansion completed.
2015-08-25 13:07:07.480 | INFO:zuul.Cloner:Preparing 1 repositories
2015-08-25 13:07:07.481 | INFO:zuul.Cloner:Creating repo openstack/puppet-openstack-integration from cache file:///opt/git/openstack/puppet-openstack-integration
2015-08-25 13:07:07.528 | INFO:zuul.Cloner:Updating origin remote in repo openstack/puppet-openstack-integration to git://git.openstack.org/openstack/puppet-openstack-integration
2015-08-25 13:07:07.936 | INFO:zuul.Cloner:upstream repo has branch master
2015-08-25 13:07:08.411 | INFO:zuul.Cloner:Prepared openstack/puppet-openstack-integration repo with commit 2d92d4171d4e1b20b7afa7b413884c91dc2f0b44
2015-08-25 13:07:08.411 | INFO:zuul.Cloner:Prepared all repositories
2015-08-25 13:07:08.615 | [gate-puppet-openstack-integration-dsvm-centos7] $ /bin/bash -xe /tmp/hudson4866344334000611000.sh
2015-08-25 13:07:08.621 | + cd openstack/puppet-openstack-integration
2015-08-25 13:07:08.621 | + mkdir .bundled_gems
2015-08-25 13:07:08.622 | ++ pwd
2015-08-25 13:07:08.622 | + export GEM_HOME=/home/jenkins/workspace/gate-puppet-openstack-integration-dsvm-centos7/openstack/puppet-openstack-integration/.bundled_gems
2015-08-25 13:07:08.622 | + GEM_HOME=/home/jenkins/workspace/gate-puppet-openstack-integration-dsvm-centos7/openstack/puppet-openstack-integration/.bundled_gems
2015-08-25 13:07:08.622 | + gem install bundler --no-rdoc --no-ri --verbose
2015-08-25 13:07:10.489 | GET https://rubygems.org/latest_specs.4.8.gz
2015-08-25 13:07:10.489 | 302 Moved Temporarily
2015-08-25 13:07:10.489 | GET https://rubygems.global.ssl.fastly.net/latest_specs.4.8.gz
2015-08-25 13:07:10.489 | 200 OK
2015-08-25 13:07:10.489 | GET https://rubygems.org/quick/Marshal.4.8/bundler-1.10.6.gemspec.rz
2015-08-25 13:07:10.489 | 302 Moved Temporarily
2015-08-25 13:07:10.489 | GET https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/bundler-1.10.6.gemspec.rz
2015-08-25 13:07:10.490 | 200 O...