ERROR cannot log into controller

@timClicks @thumper I’ve managed to get roughly back to where I was before this problem appeared. To do this I reconstructed (as far as possible) all the missing files in .local/share/juju, specifically clouds.yaml, credentials.yaml and accounts.yaml as described by @thumper above. I previously set a new admin password in mongodb on the controller, so I put this password in accounts.yaml.

Now I am logged in apparently.

I’m scared to touch it further, so I tried to create something reproduceable with a new controller. Here’s what I did;

testuser@juju:~$ cat mycloud.yaml
clouds:
  mycloud:
    type: maas
    auth-types: [oauth1]
    endpoint: http://192.168.200.251:5240/MAAS
testuser@juju:~$ juju add-cloud mycloud mycloud.yaml
testuser@juju:~$ juju add-credential mycloud
Enter credential name: admin

Using auth-type "oauth1".

Enter maas-oauth:

Credential "admin" added locally for cloud "mycloud".

testuser@juju:~$ juju bootstrap mycloud mycontroller
Creating Juju controller "mycontroller" on mycloud
Looking for packaged Juju agent version 2.5.8 for amd64
Launching controller instance(s) on mycloud...
 - gq7cfn (arch=amd64 mem=4G cores=2)
Installing Juju agent on bootstrap instance
Fetching Juju GUI 2.15.0
Waiting for address
Attempting to connect to 192.168.200.32:22
Connected to 192.168.200.32
Running machine configuration script...
Bootstrap agent now started
Contacting Juju controller at 192.168.200.32 to verify accessibility...
Bootstrap complete, "mycontroller" controller now available
Controller machines are in the "controller" model
Initial model "default" added
testuser@juju:~$ juju change-user-password
new password:
type new password again:
ERROR recording macaroon: connecting to API: cannot get discharge from "https://192.168.200.32:17070/auth": failed to acquire macaroon after waiting: third party refused discharge: discharging macaroon: interaction required

Snookered :slight_smile:

testuser@juju:~$ juju destroy-controller mycontroller
WARNING! This command will destroy the "mycontroller" controller.
This includes all machines, applications, data and other resources.

Continue? (y/N):y
ERROR failed to destroy controller "mycontroller"

If the controller is unusable, then you may run

    juju kill-controller

to forcibly destroy the controller. Upon doing so, review
your cloud provider console for any resources that need
to be cleaned up.

ERROR cannot connect to API: invalid entity name or password (unauthorized access)

What did I do wrong?