Juju migrate failed with "permission denied"

Bug #2040138 reported by Bui Hong Ha
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Committed
High
Ian Booth

Bug Description

I bootstrapped 2 Juju controllers versions 2.9.45 and 3.1.6 with candid as identity backend. In the candid side, I use static identity provider (username / password) as documented at https://github.com/canonical/candid/blob/master/docs/configuration.md.

I granted my telescreen@external account superuser privilege in juju3 side while granted login/add-model in juju2 side.

$ juju controllers
Use --refresh option with this command to see the latest information.

Controller Model User Access Cloud/Region Models Nodes HA Version
juju2* test telescreen@external login stsstack/stsstack 1 1 none 2.9.45
juju3 admin/controller telescreen@external superuser - 1 none 3.1.6

$ juju models
Controller: juju2

Model Cloud/Region Type Status Access Last connection
test* stsstack/stsstack openstack available - never connected

$ juju show-model test
test:
  name: telescreen@external/test
  short-name: test
  model-uuid: c232e506-57dc-4e8b-8111-1cd62ad9d951
  model-type: iaas
  controller-uuid: 0a2287d9-0aa4-4f18-802e-817b70113478
  controller-name: juju2
  is-controller: false
  owner: telescreen@external
  cloud: stsstack
  region: stsstack
  type: openstack
  life: alive
  status:
    current: available
    since: 33 minutes ago
  users:
    telescreen@external:
      display-name: telescreen
      access: admin
      last-connection: never connected
  sla: unsupported
  agent-version: 2.9.45
  credential:
    name: telescreen@external
    owner: telescreen@external
    cloud: stsstack
    validity-check: valid
  supported-features:
  - name: juju
    description: the version of Juju used by the model
    version: 2.9.45

As the show-model shows, I have admin access to the test model and admin privilege in juju3 controller side. Yet, when juju always shows "permission denied" when I try to migrate the test model.

$ juju migrate test juju3
ERROR permission denied (unauthorized access)
$
$ juju migrate telescreen@external/test juju3
ERROR permission denied (unauthorized access)

Tags: sts
Revision history for this message
Bui Hong Ha (telescreen) wrote :

I attached juju controllers machine-0.log

Revision history for this message
Bui Hong Ha (telescreen) wrote :

Juju3 controller machine-0.log

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

Testing this scenario, I am logged into both controllers as a candid user eg someone@external.
Trying to migrate a model

$ juju migrate foo test
ERROR connect to target controller: invalid request - expected local user (unauthorized access)

The source controller tries to connect to the target controller to do the migration prechecks and fails because the target controller is attempting to only authenticate a local (non-candid) user for some reason.

I tried again, this time as the original local "admin" user and got the same error.

So it does seem there's an issue migrating models owned by external/candid users.

Changed in juju:
status: New → Triaged
importance: Undecided → High
milestone: none → 3.1.7
Revision history for this message
Ian Booth (wallyworld) wrote :

The issue is a bug from 2016 when model migrations were first implemented - non-local users (those managed by an external identity service) were not catered for properly.

Changed in juju:
assignee: nobody → Ian Booth (wallyworld)
status: Triaged → In Progress
Ian Booth (wallyworld)
Changed in juju:
milestone: 3.1.7 → 2.9.46
Revision history for this message
Ian Booth (wallyworld) wrote :
Changed in juju:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.