Bug 1418097

Summary: Glance image-list works intermittently (if it is deprecated it should never work)
Product: Red Hat OpenStack Reporter: Sai Sindhur Malleni <smalleni>
Component: python-glanceclientAssignee: Cyril Roelandt <cyril>
Status: CLOSED NOTABUG QA Contact: Mike Abrams <mabrams>
Severity: unspecified Docs Contact:
Priority: low    
Version: 11.0 (Ocata)CC: eglynn, fpercoco, jruzicka, mabrams, okolisny, pdeore, pgrist, scohen, smalleni, srevivo, tbarron, tvignaud
Target Milestone: ---   
Target Release: 12.0 (Pike)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-01 13:46:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sai Sindhur Malleni 2017-01-31 20:39:51 UTC
Description of problem: glance image-list works sometimes and sometimes throws an error such as:
[stack@pcloud12 ansible]$ glance image-list
You must provide a project_id or project_name (with project_domain_name or project_domain_id) via   --os-project-id (env[OS_PROJECT_ID])  --os-project-name (env[OS_PROJECT_NAME]),  --os-project-domain-id (env[OS_PROJECT_DOMAIN_ID])  --os-project-domain-name (env[OS_PROJECT_DOMAIN_NAME])
[stack@pcloud12 ansible]$ openstack project list

Sometimes, it just works as below
(shaker-venv) [stack@pcloud12 ansible]$ glance image-list
+--------------------------------------+---------+
| ID                                   | Name    |
+--------------------------------------+---------+
| 701553cf-3e10-4660-9d5d-d8907ca86cfc | centos7 |
| e7b3aca2-83c6-416f-9ec7-2c9587d03729 | cirros  |
+--------------------------------------+---------+


Version-Release number of selected component (if applicable):
OSP 11 build from 2017-01-24.2


How reproducible: Intermittent


Steps to Reproduce:
1. Try openstack image list and verify it works
2. Try glance image-list
3.

Actual results:
glance image-list works sometimes and doesn't sometimes. The behaviour should be consistent.

Expected results:
Maybe a deprecation warning.

Additional info:

Comment 1 Cyril Roelandt 2017-02-02 16:18:01 UTC
This error message is only seen in glanceclient. Whenever this happens, could you then run the following command:

$ env | grep ^OS

I'm pretty sure that somehow, one of the OS_{PROJECT,TENANT}_{NAME,ID} environment variables ends up being unset.

Comment 2 Sai Sindhur Malleni 2017-02-02 18:19:54 UTC
Sometimes it works and when it doest OS_TENANT etc are not even presetn.
(shaker-venv) [stack@pcloud12 20170202-173713]$ glance image-list
+--------------------------------------+--------------+
| ID                                   | Name         |
+--------------------------------------+--------------+
| 701553cf-3e10-4660-9d5d-d8907ca86cfc | centos7      |
| e7b3aca2-83c6-416f-9ec7-2c9587d03729 | cirros       |
| 0a59e2ee-262b-4b23-8144-36f15ce53ad9 | shaker-image |
+--------------------------------------+--------------+
(shaker-venv) [stack@pcloud12 20170202-173713]$ env | grep ^OS
OS_PROJECT_NAME=admin
OS_PASSWORD=PtkjwN8wPuJdFB3DMx4RVD9ky
OS_AUTH_URL=http://10.16.31.101:5000/v2.0
OS_USERNAME=admin
OS_NO_CACHE=True
OS_CLOUDNAME=overcloud

Comment 3 Cyril Roelandt 2017-02-02 19:13:51 UTC
Yes. For this command to work, you need one of those variables (OS_PROJECT_NAME, OS_PROJECT_ID, OS_TENANT_NAME, OS_TENANT_ID) to be set.

The failure you reported makes me think that for some reason, sometimes, none of those are set. This is what I'd like to check.

Comment 4 Sai Sindhur Malleni 2017-02-02 19:21:44 UTC
openstack image list works consistently, for what its worth the behaviour of several other client also seems inconsistent. nova list works without a deprecation warning sometimes but shows a deprecation warning sometimes.

Comment 5 Cyril Roelandt 2017-02-02 19:57:37 UTC
I really cannot help you if I do not know what the values of the environment variables are when the command fails.

Comment 6 Sai Sindhur Malleni 2017-02-02 20:00:31 UTC
Here is an instance of failure and the information you asked for. Please let me know if you need anything else.

(browbeat-venv) [stack@pcloud12 browbeat]$ openstack image list
+--------------------------------------+--------------+--------+
| ID                                   | Name         | Status |
+--------------------------------------+--------------+--------+
| 701553cf-3e10-4660-9d5d-d8907ca86cfc | centos7      | active |
| e7b3aca2-83c6-416f-9ec7-2c9587d03729 | cirros       | active |
| 0a59e2ee-262b-4b23-8144-36f15ce53ad9 | shaker-image | active |
+--------------------------------------+--------------+--------+
(browbeat-venv) [stack@pcloud12 browbeat]$ glance image-list
You must provide a project_id or project_name (with project_domain_name or project_domain_id) via   --os-project-id (env[OS_PROJECT_ID])  --os-project-name (env[OS_PROJECT_NAME]),  --os-project-domain-id (env[OS_PROJECT_DOMAIN_ID])  --os-project-domain-name (env[OS_PROJECT_DOMAIN_NAME])
(browbeat-venv) [stack@pcloud12 browbeat]$ env | grep ^OS
OS_PROJECT_NAME=admin
OS_PASSWORD=PtkjwN8wPuJdFB3DMx4RVD9ky
OS_AUTH_URL=http://10.16.31.101:5000/v2.0
OS_USERNAME=admin
OS_NO_CACHE=True
OS_CLOUDNAME=overcloud

Comment 7 Cyril Roelandt 2017-02-02 20:33:50 UTC
> OSP 11 build from 2017-01-24.2

Did this happen before while testing OSP11? Do you have any idea of what the latest working package was?

Comment 8 Pranali Deore 2017-03-24 06:14:49 UTC
Sai Sindhur Malleni, seems that there might be some other environmental changes would have been done before or during the OSP setup because this type of command error would be raises only when values of os_project_name or os_project_id are not set.

Could you please share some extra information like, what steps you followed to do the OSP setup and what latest working package is being used?

Comment 9 Oleksandr Kolisnyk 2017-05-30 08:41:24 UTC
Hit this issue on latest RHOS 10