Bug 1418097 - Glance image-list works intermittently (if it is deprecated it should never work)
Summary: Glance image-list works intermittently (if it is deprecated it should never w...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-glanceclient
Version: 11.0 (Ocata)
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
: 12.0 (Pike)
Assignee: Cyril Roelandt
QA Contact: Mike Abrams
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-31 20:39 UTC by Sai Sindhur Malleni
Modified: 2017-11-01 13:46 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-11-01 13:46:06 UTC
Target Upstream Version:


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.