Connecting to controller asks the password after 24hr

Bug #2028139 reported by Bartosz Woronicz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Snap
Fix Committed
Medium
Guillaume Boutry

Bug Description

After around 24hr the connection to juju controller requires password

ubuntu@node07:~$ juju status -m openstack
please enter password for node07.maas on sunbeam-controller:

ubuntu@node07:~$ juju controllers --refresh
please enter password for node07.maas on sunbeam-controller:

Revision history for this message
Bartosz Woronicz (mastier1) wrote :

After discussion with Hemanth the reason for that is the juju oauth macaroons expire after 24hr for user other that admin, which is the case here
https://juju.is/docs/juju/juju-login

To login, one may get password here

ubuntu@node07:~$ cat $HOME/snap/openstack/current/account.yaml
password: 2dk5Peh0zx1q
user: node07.maas

also running
- sunbeam bootstrap
or
- sunbeam join

it should allow you to re-login

Revision history for this message
Bartosz Woronicz (mastier1) wrote (last edit ):
Download full text (3.3 KiB)

@Hemanth, the rerunning Bootstrap won't help here

Error: No such command 'bootstrap'.
ubuntu@node01:~$ sunbeam cluster bootstrap
⠴ Bootstrapping Juju onto machine ...
⠧ Bootstrapping Juju onto machine ...
⠋ Bootstrapping Juju onto machine ...
⠋ Bootstrapping Juju onto machine ...
Error determining whether to skip the bootstrap process. Defaulting to not skip.
Traceback (most recent call last):
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 198, in is_skip
    self.juju_clouds = self.get_clouds(self.cloud_type)
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 102, in get_clouds
    clouds_from_juju_cmd = self._juju_cmd("clouds")
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 80, in _juju_cmd
    process = subprocess.run(cmd, capture_output=True, text=True, check=True)
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/snap/openstack/182/juju/bin/juju', 'clouds', '--format', 'json']' returned non-zero exit status 1.
please enter password for node01.maas on sunbeam-controller:
Only clouds with registered credentials are shown.
There are more clouds, use --all to see them.
ERROR could not get clouds from controller "sunbeam-controller": cannot get discharge from "https://172.27.88.220:17070/auth": cannot submit form: Post https://172.27.88.220:17070/auth/form: invalid login macaroon

Error bootstrapping Juju
Traceback (most recent call last):
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 217, in run
    result = self.add_cloud(self.cloud_type, self.cloud)
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 164, in add_cloud
    process = subprocess.run(cmd, capture_output=True, text=True, check=True)
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/snap/openstack/182/juju/bin/juju', 'add-cloud', 'sunbeam', '--file', '/tmp/tmpzdtl4ttn', '--client']' returned non-zero exit status 1
ERROR use `update-cloud sunbeam --client` to override known definition: local cloud "sunbeam" already exists

Cluster join is also not a way to do

ubuntu@node01:~$ sunbeam cluster join
Error retrieving authenticated user from Juju.
Traceback (most recent call last):
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 458, in is_skip
    user = self._juju_cmd("show-user")
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 80, in _juju_cmd
    process = subprocess.run(cmd, capture_output=True, text=True, check=True)
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/snap/openstack/182/juju/bin/juju', 'show-user', '--format', 'json']' returned non-zero exit status 1.
please enter password for node01.maas on sunbeam-controller:
ERROR cannot get discharge from "https://172.27.88.220:...

Read more...

Changed in snap-openstack:
assignee: nobody → Guillaume Boutry (gboutry)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Guillaume Boutry (gboutry) wrote :

https://github.com/canonical/snap-openstack/pull/2

Fix has been committed and should be available in edge soon

Changed in snap-openstack:
status: In Progress → Fix Committed
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.