glance command fails with missing project_id or project_name

Bug #1720983 reported by Pranali Deore
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Invalid
Undecided
Unassigned
Newton
Fix Committed
Undecided
Pranali Deore
tripleo-common
New
Undecided
Pranali Deore

Bug Description

Glance commands are failing in stable/newton with below error,

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])

Steps to Reproduce:
1. Deploy overcloud
2. Source overcloudrc
3. Run glance command (e.g. glance image-list)

Actual results:
# 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])

Expected results:
# glance image-list
+----+------+
| ID | Name |
+----+------+
+----+------+

Additional info:

Older version of tripleo used to generate overcloudrc with 'OS_TENANT_NAME=admin'
while since Newton it generates 'OS_PROJECT_NAME=admin'.
This is happened while moving overcloudrc generation from tripleoclient to a Mistral action which is eventually breaking glanceclient.
This issue is only there in newton, it works fine since ocata because of switching keystoneclient to keystoneauth in glanceclient where tenant specific requirement is removed.

From openstack-tripleo-common(stable/newton)
https://github.com/openstack/tripleo-common/blob/stable/newton/tripleo_common/utils/overcloudrc.py#L83

  def create_overcloudrc(stack, no_proxy, admin_password):
    ...
    rc_params = {
        ...
        'OS_PROJECT_NAME': 'admin',
    ...

That conflicts with how python-glanceclient checks parameters:

https://github.com/openstack/python-glanceclient/blob/stable/newton/glanceclient/shell.py#L388

  # Validate password flow auth
  project_info = (
      args.os_tenant_name or args.os_tenant_id or (
          args.os_project_name and (
              args.os_project_domain_name or
              args.os_project_domain_id
          )
      ) or args.os_project_id
  )

  if not project_info:
      # tenant is deprecated in Keystone v3. Use the latest
      # terminology instead.
      raise exc.CommandError(
          _("You must provide a project_id or project_name ("
          ...

To resolve this conflict, OS_TENANT_NAME needs to be added back in overcloudrc by keeping OS_PROJECT_NAME as it to avoid breaking in any other client.

Changed in tripleo:
assignee: nobody → Pranali Deore (pranali-deore)
affects: tripleo → tripleo-common
Revision history for this message
Steven Hardy (shardy) wrote :

Note we no longer use the tripleo-common LP so I added the main tripleo LP to this bug.

Do we know why adding OS_DOMAIN_NAME isn't enough, as from the error message it seems that should work?

If that's not possible then adding the OS_TENANT_NAME alongside the current OS_PROJECT_NAME seems to be the safest option, and is that proposed in https://review.openstack.org/#/c/509079/

Changed in tripleo:
status: New → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/newton)

Reviewed: https://review.openstack.org/509079
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=fb9fa9844ca079d6322eaeb00564dc4bba324c3c
Submitter: Jenkins
Branch: stable/newton

commit fb9fa9844ca079d6322eaeb00564dc4bba324c3c
Author: Pranali Deore <email address hidden>
Date: Tue Oct 3 10:03:05 2017 +0530

    Adding env variable OS_TENANT_NAME back in overcloudrc

    Glance commands are failing in newton with error[1] because of tenant
    specific requirements in glanceclient. Since ocata, keystoneauth is
    switched from keystoneclient this issue is not exist in recent releases.

    Before moving overcloudrc generation from tripleoclient to a Mistral
    action OS_TENANT_NAME was being used instead of OS_PROJECT_NAME.
    So, adding back OS_TENANT_NAME in overcloudrc.

    [1]:https://github.com/openstack/python-glanceclient/blob/stable/newton/glanceclient/shell.py#L388

    Closes-Bug: 1720983
    Change-Id: Id2226eb2bd9ad5c24cc87f0cf6c61324018ceeac

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 5.4.5

This issue was fixed in the openstack/tripleo-common 5.4.5 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.