juju autoload-credentials fails - manual add-credential succeeds

Bug #1938680 reported by Gareth Woolridge
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
High
Unassigned

Bug Description

We seem to have run into an issue in PS5 where juju autoload-credentials (with a valid sourced novarc) fails with invalid cloud prodstack5, but running juju add-credential and pasting the values manually succeeds.

We ran into this when granting a user "add-model". The existing model was created by the admin user and access granted, so was using an admin credential eg admin/stg-enablement-jenkins which the user does not have access to - add-model fails here on the credential which is expected.

The user then, with novarc sourced, runs juju autoload-credentials which fails:

juju autoload-credentials
This operation can be applied to both a copy on this client and to the one on a controller.
Do you want to add a credential to:
    1. client only (--client)
    2. controller "prodstack-is-beta" only (--controller prodstack-is-beta)
    3. both (--client --controller prodstack-is-beta)
Enter your choice, or type Q|q to quit: 3

Looking for cloud and credential information on local client...

Looking for cloud information on controller "prodstack-is-beta"...

1. openstack region "prodstack5" project "${OS_TENANT_NAME}" user "stg-enablement-jenkins" (new)
2. rackspace credential for user "stg-enablement-jenkins" (new)
Select a credential to save by number, or type Q to quit: 1

Select the cloud it belongs to, or type Q to quit [prodstack5]:

WARNING cloud prodstack5 not valid

1. openstack region "prodstack5" project "${OS_TENANT_NAME}" user "stg-enablement-jenkins" (new)
2. rackspace credential for user "stg-enablement-jenkins" (new)
Select a credential to save by number, or type Q to quit: Q

No credentials loaded to controller prodstack-is-beta.

I'd have expected another option there where project was correctly expanded from the set env var?

We then run the add-credential manually, pasting requested from the novarc which works:

juju add-credential prodstack5
This operation can be applied to both a copy on this client and to the one on a controller.
Do you want to add a credential to:
    1. client only (--client)
    2. controller "prodstack-is-beta" only (--controller prodstack-is-beta)
    3. both (--client --controller prodstack-is-beta)
Enter your choice, or type Q|q to quit: 3
Using cloud "prodstack5" from the controller to verify credentials.
Enter credential name: stg-enablement-jenkins

Regions
  prodstack5

Select region [any region, credential is not region specific]: prodstack5

Using auth-type "userpass".

Enter username: stg-enablement-jenkins

Enter password: XXXXXXXXXXXX

Enter tenant-name (optional): stg-enablement-jenkins_project

Enter tenant-id (optional):

Enter version (optional):

Enter domain-name (optional):

Enter project-domain-name (optional):

Enter user-domain-name (optional):

Credential "stg-enablement-jenkins" added locally for cloud "prodstack5".

Controller credential "stg-enablement-jenkins" for user "stg-enablement-jenkins" for cloud "prodstack5" on controller "prodstack-is-beta" added.
For more information, see ‘juju show-credential prodstack5 stg-enablement-jenkins’.

Revision history for this message
Ian Booth (wallyworld) wrote :

Can you paste your novarc (with secrets redacted).
There's a few variations on a theme that need to be catered for and it seems there's one that Juju doesn't handle.

Changed in juju:
milestone: none → 2.9.11
importance: Undecided → High
status: New → Incomplete
Changed in juju:
milestone: 2.9.11 → 2.9.12
Revision history for this message
Gareth Woolridge (moon127) wrote :

NOVARC_CONFIG_VERSION=1
NOVARC=$(readlink -f "${BASH_SOURCE:-${0}}" 2>/dev/null) ||
    NOVARC=$(python -c 'import os,sys; print os.path.abspath(os.path.realpath(sys.argv[1]))' "${BASH_SOURCE:-${0}}")
NOVA_KEY_DIR=${NOVARC%/*}
export OS_USERNAME="stg-enablement-jenkins"
export OS_TENANT_NAME="stg-enablement-jenkins_project"
export OS_PASSWORD="REDACTED"
export OS_AUTH_URL="https://REDACTED:5000/v3"
export OS_REGION_NAME="prodstack5"

export NOVA_USERNAME="${OS_USERNAME}"
export NOVA_PASSWORD="${OS_PASSWORD}"
export NOVA_PROJECT_ID="${OS_TENANT_NAME}"
export NOVA_VERSION="1.1"
export NOVA_REGION="${OS_REGION_NAME}"

# for keystone v3
export OS_PROJECT_NAME=${OS_TENANT_NAME}
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3

export OS_INTERFACE=public

Changed in juju:
milestone: 2.9.12 → 2.9.13
Changed in juju:
milestone: 2.9.13 → 2.9.14
Changed in juju:
milestone: 2.9.14 → 2.9.15
Changed in juju:
milestone: 2.9.15 → 2.9.16
Changed in juju:
milestone: 2.9.16 → 2.9.17
Changed in juju:
milestone: 2.9.17 → 2.9.18
Changed in juju:
milestone: 2.9.18 → 2.9.19
Changed in juju:
milestone: 2.9.19 → 2.9.20
Changed in juju:
milestone: 2.9.20 → 2.9.21
Changed in juju:
milestone: 2.9.21 → 2.9.22
Changed in juju:
milestone: 2.9.22 → 2.9.23
Changed in juju:
milestone: 2.9.23 → 2.9.24
Changed in juju:
milestone: 2.9.24 → 2.9.25
Changed in juju:
milestone: 2.9.25 → 2.9.26
Changed in juju:
milestone: 2.9.26 → 2.9.27
Changed in juju:
milestone: 2.9.27 → 2.9.28
Changed in juju:
milestone: 2.9.28 → 2.9.29
Changed in juju:
milestone: 2.9.29 → 2.9.30
John A Meinel (jameinel)
Changed in juju:
milestone: 2.9.30 → 2.9-next
status: Incomplete → Triaged
Harry Pidcock (hpidcock)
Changed in juju:
milestone: 2.9-next → 3.1-beta1
Changed in juju:
milestone: 3.1-beta1 → 3.1-rc1
Revision history for this message
Vitaly Antonenko (anvial) wrote :

Hi Gareth,

Is it issue still actual?

tags: added: autoload-credentials openstack-provider
Changed in juju:
milestone: 3.1-rc1 → 3.1-rc2
Changed in juju:
milestone: 3.1-rc2 → 3.1-rc3
Revision history for this message
Harry Pidcock (hpidcock) wrote :

Is this still an issue being encountered?

Changed in juju:
milestone: 3.1-rc3 → none
status: Triaged → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Canonical Juju because there has been no activity for 60 days.]

Changed in juju:
status: Incomplete → Expired
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.