Poor error message when glance CLI options out of order

Bug #1442696 reported by rick jones
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Atul Pandey

Bug Description

I happened to try to download an image, and got a rather inscrutable error message:

(venv)cetest@cer405n0046:~/rjones2$ glance image-download 65b8c8d0-ac4f-4aae-9149-64aa3e31d926 --file netperf_1410_image.qcow2 --progress
object of type 'generator' has no len()

When it was suggested to me that I had the options in the wrong order I was able to get the command to succeed:

(venv)cetest@cer405n0046:~/rjones2$ glance image-download --file netperf_1410_image.qcow2 65b8c8d0-ac4f-4aae-9149-64aa3e31d926
(venv)cetest@cer405n0046:~/rjones2$ ls -l net*
-rw-rw-r-- 1 cetest cetest 1292894208 Apr 9 18:35 netperf_1410_image.qcow2

That error message from the first attempt is completely inscrutable and in no way leads someone towards their mistake. Certainly not anyone who might be classified a "civilian."

Revision history for this message
Louis Taylor (kragniz) wrote :

What version of glanceclient are you running? It seem like you're hitting this bug: https://bugs.launchpad.net/python-glanceclient/+bug/1384664

Revision history for this message
rick jones (rick-jones2) wrote :

Oops - meant to include that -

0.14.1.11

Atul Pandey (atul-4you)
Changed in python-glanceclient:
assignee: nobody → Atul Pandey (atul-4you)
assignee: Atul Pandey (atul-4you) → nobody
Atul Pandey (atul-4you)
Changed in python-glanceclient:
assignee: nobody → Atul Pandey (atul-4you)
Revision history for this message
Atul Pandey (atul-4you) wrote :

I think this bugs talks about error message otherwise we can mark it as duplicate of https://bugs.launchpad.net/python-glanceclient/+bug/1384664

Revision history for this message
Louis Taylor (kragniz) wrote :

Okay, could you update python-glanceclient and confirm it's fixed in versions greater than 0.15.0?

tags: added: propose-close
Revision history for this message
rick jones (rick-jones2) wrote :

I don't have direct control over the environments, but I was able to find an environment with 0.17.0 installed. Sadly, it seems to encounter a different issue:

(venv)cetest@qa-aw1hel-node0003:~/rjones2$ glance image-download 74e4d736-afcb-46f9-8bf6-d6a33ff09e73 --file foo.qcow2 --progress
"1" is not a supported API version. Example values are "1" or "2".
(venv)cetest@qa-aw1hel-node0003:~/rjones2$ glance --version
0.17.0

which may already be logged as another ticket. As this "new" (and seemingly equally unhelpful :) ) message happens with the command that was working in the 0.14.1.11 environment I assume this is more "fundamental" and so I cannot really say if the later version addresses the bogus error message reported in this ticket.

(venv)cetest@qa-aw1hel-node0003:~/rjones2$ glance --file foo.ccow2 image-download 74e4d736-afcb-46f9-8bf6-d6a33ff09e73
"1" is not a supported API version. Example values are "1" or "2".

Revision history for this message
Kamil Rykowski (kamil-rykowski) wrote :

@rick: You got similar issue to the one reported here - https://bugs.launchpad.net/glance/+bug/1402632

Could you run for example the following command and check if there are no import errors:
glance --os-image-api-version 2 image-list

The bug for printing proper error message is still in progress and its driven by Stuart McLaren at https://review.openstack.org/#/c/171180/

Revision history for this message
rick jones (rick-jones2) wrote :

The environments around me are in a semi-constant state of flux so getting the same version of glance each time is rare.

$ glance --os-image-api-version 2 image-list
"2" is not a supported API version. Example values are "1" or "2".
$ glance --version
0.16.1

There is another which has 0.18.0:
$ glance --version
0.18.0
$ glance --os-image-api-version 2 image-list
+----+------+
| ID | Name |
+----+------+
+----+------+

a plain glance image-list in the environment with 0.18.0 showed a number of images, as did using --os-image-api-version 1.

Revision history for this message
Ian Cordasco (icordasc) wrote :

I believe Stuart's work has fixed this up. Closing this as fixed released. If that assessment is incorrect, feel free to comment here and we can fix that up.

Changed in python-glanceclient:
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.