image-create returns wrong error

Bug #1467719 reported by takmatsu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
In Progress
Low
takmatsu
Nominated for Mitaka by Erno Kuvaja
Liberty
In Progress
Low
takmatsu

Bug Description

When set wrong credentials in glance-api.conf and not exist ~/.glanceclient/image_schema.json,
image-create returns unrecognized arguments.

ex)
$vim /etc/glance/glance-api.conf
   [keystone_authtoken]
   ...
   password = wrongpassword #set wrong password
   ...
$ sudo service glance-api restart
$ rm ~/.glanceclient/image_schema.json
$ export OS_IMAGE_API_VERSION=2
$ wget -P /tmp/images http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
$ glance image-create --name "cirros-0.3.4-x86_64" --file /tmp/images/cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --visibility public --progress

usage: glance [--version] [-d] [-v] [--get-schema] [--timeout TIMEOUT]
              [--no-ssl-compression] [-f] [--os-image-url OS_IMAGE_URL]
              [--os-image-api-version OS_IMAGE_API_VERSION]
              [--profile HMAC_KEY] [-k] [--os-cert OS_CERT]
              [--cert-file OS_CERT] [--os-key OS_KEY] [--key-file OS_KEY]
              [--os-cacert <ca-certificate-file>] [--ca-file OS_CACERT]
              [--os-username OS_USERNAME] [--os-user-id OS_USER_ID]
              [--os-user-domain-id OS_USER_DOMAIN_ID]
              [--os-user-domain-name OS_USER_DOMAIN_NAME]
              [--os-project-id OS_PROJECT_ID]
              [--os-project-name OS_PROJECT_NAME]
              [--os-project-domain-id OS_PROJECT_DOMAIN_ID]
              [--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
              [--os-password OS_PASSWORD] [--os-tenant-id OS_TENANT_ID]
              [--os-tenant-name OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL]
              [--os-region-name OS_REGION_NAME]
              [--os-auth-token OS_AUTH_TOKEN]
              [--os-service-type OS_SERVICE_TYPE]
              [--os-endpoint-type OS_ENDPOINT_TYPE]
              <subcommand> ...
glance: error: unrecognized arguments: --name --disk-format qcow2 --container-format bare --visibility public

Changed in glance:
assignee: nobody → takmatsu (takeaki-matsumoto)
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

--visibility is used for image-list and namespace_list in api v2. You can not add it when create image.

When remove --visibility, I can't reproduce it.

Revision history for this message
wangxiyuan (wangxiyuan) wrote :

And when reproduce without --visibility. I found that the glance client first show a progress bar to update the image data. Then raise a error: Invalid OpenStack Identity credentials. I think this situation could be optimized.

Revision history for this message
takmatsu (takeaki-matsumoto) wrote :

I updated my description.

You may have ~/.glanceclient/image_schema.json
Please reproduce after "rm ~/.glanceclient/image_schema.json"

description: updated
Revision history for this message
Mike Fedosin (mfedosin) wrote :

Steps to reproduce.
1. Delete glanceclient cache in ~/.glanceclient
2. Change server credentials to invalid in /etc/glance/glance-api.conf: section [keystone_authtoken], param 'password'
3. Restart the server
4. Try to create image with v2 api (glance --os-image-api-version 2 image-create --name Privetik --disk-format raw --container-format bare)

Expected result: Invalid OpenStack Identity credentials.

Actual result:
usage: glance [--version] [-d] [-v] [--get-schema] [--timeout TIMEOUT]
              [--no-ssl-compression] [-f] [--os-image-url OS_IMAGE_URL]
              [--os-image-api-version OS_IMAGE_API_VERSION]
              [--profile HMAC_KEY] [-k] [--os-cert OS_CERT]
              [--cert-file OS_CERT] [--os-key OS_KEY] [--key-file OS_KEY]
              [--os-cacert <ca-certificate-file>] [--ca-file OS_CACERT]
              [--os-username OS_USERNAME] [--os-user-id OS_USER_ID]
              [--os-user-domain-id OS_USER_DOMAIN_ID]
              [--os-user-domain-name OS_USER_DOMAIN_NAME]
              [--os-project-id OS_PROJECT_ID]
              [--os-project-name OS_PROJECT_NAME]
              [--os-project-domain-id OS_PROJECT_DOMAIN_ID]
              [--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
              [--os-password OS_PASSWORD] [--os-tenant-id OS_TENANT_ID]
              [--os-tenant-name OS_TENANT_NAME] [--os-auth-url OS_AUTH_URL]
              [--os-region-name OS_REGION_NAME]
              [--os-auth-token OS_AUTH_TOKEN]
              [--os-service-type OS_SERVICE_TYPE]
              [--os-endpoint-type OS_ENDPOINT_TYPE]
              <subcommand> ...
glance: error: unrecognized arguments: --name --disk-format raw --container-format bare

Changed in glance:
status: New → Confirmed
Revision history for this message
wangxiyuan (wangxiyuan) wrote :

Thanks for update. It's confirmed in api v2.

Revision history for this message
takmatsu (takeaki-matsumoto) wrote :
Changed in glance:
status: Confirmed → In Progress
Changed in glance:
importance: Undecided → Low
Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

As of now with steps mentioned in #4 by Mike it is returning 503 error

503 Service Unavailable: The server is currently unavailable. Please try again at a later time. (HTTP 503)

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/python-glanceclient 1.1.1

This issue was fixed in the openstack/python-glanceclient 1.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

This issue was fixed in the openstack/python-glanceclient 1.1.1 release.

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.