OpenStack cluster bootstrap fails after tearing it down

Bug #2024486 reported by Lev Zharikov
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Snap
New
Undecided
Unassigned

Bug Description

Description:

I followed the official tutorial to set up an openstack cluster using sunbeam on a single node (not guided). The cluster was working fine until I decided to tear it down and start over as I wanted to access my VMs via external network. I used the official guide on tearing it down, but I encountered the following error even before I was prompted for MetalLB address allocation range:

Sunbeam Cluster not initialized
Error bootstrapping Juju
Traceback (most recent call last):
  File "/snap/openstack/182/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 228, in run
    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', 'bootstrap', 'sunbeam', 'sunbeam-controller']' returned non-zero exit status 1.
Creating Juju controller "sunbeam-controller" on sunbeam/default
Looking for packaged Juju agent version 3.2.0 for amd64
Located Juju agent version 3.2.0-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/3.2.0/juju-3.2.0-linux-amd64.tgz
ERROR failed to bootstrap model: machine is already provisioned

Error: Command '['/snap/openstack/182/juju/bin/juju', 'bootstrap', 'sunbeam', 'sunbeam-controller']' returned non-zero exit status 1.

It seems that the cluster bootstrap fails because the machine is already provisioned, even though I deleted the cluster before.

Steps to reproduce:

1. Follow the official tutorial to set up an openstack cluster using sunbeam: https://ubuntu.com/openstack/install#single-multi-large-cluster
2. Verify that the cluster is working
3. Tear down the cluster by running using the official tearing down guide:
https://ubuntu.com/tutorials/tear-down-your-openstack-lab-environment#1-overview
4. Try to create a new cluster using step 1

Expected result:

The cluster bootstrap should succeed and create a new cluster.

Actual result:

The cluster bootstrap fails with the error message above.

Environment:

- OS: Ubuntu 22.04.2 LTS

description: updated
Revision history for this message
Lev Zharikov (leozaur1808) wrote :

I tried executing /usr/sbin/remove-juju-services as a root user as was suggested by gboutry here: https://discourse.ubuntu.com/t/tear-down-your-openstack-lab-environment/25078 but to no avail. The error message described in the issue is gone, yet the new ones have appeared. Unfortunately, the command still fails when bootstrapping Juju on to the machine. I tried my best to summarize the output since it is very long.
Here are the errors that I extracted from the output:

subprocess.CalledProcessError: Command ‘[’/snap/openstack/182/juju/bin/juju’, ‘bootstrap’, ‘sunbeam’, ‘sunbeam-controller’]’ returned non-zero exit status 1.
ERROR creating controller database schema: table lease_type already exists
ERROR failed to bootstrap model: subprocess encountered error code 1
Error: Command ‘[’/snap/openstack/182/juju/bin/juju’, ‘bootstrap’, ‘sunbeam’, ‘sunbeam-controller’]’ returned non-zero exit status 1.

It seems like the database has not been removed completely.

Revision history for this message
Edward Ramirez Wilches (edwardrw) wrote :

Hello, I have the same issue. I am installing OpenStack (sudo snap install openstack --channel 2023.1) from scratch and I got the error. Please, tell me how to fix this issue.

radware@t4kvm4:~$ sudo sunbeam cluster bootstrap --accept-defaults
Error bootstrapping Juju
Traceback (most recent call last):
  File "/snap/openstack/247/lib/python3.10/site-packages/sunbeam/commands/juju.py", line 290, in run
    process = subprocess.run(cmd, capture_output=True, text=True, check=True)
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/snap/openstack/247/juju/bin/juju', 'bootstrap', 'sunbeam', 'sunbeam-controller', '--agent-version=3.2.0']' returned
non-zero exit status 1.
Creating Juju controller "sunbeam-controller" on sunbeam/default
Looking for packaged Juju agent version 3.2.0 for amd64
Located Juju agent version 3.2.0-ubuntu-amd64 at https://streams.canonical.com/juju/tools/agent/3.2.0/juju-3.2.0-linux-amd64.tgz
ERROR failed to bootstrap model: machine is already provisioned

Error: Command '['/snap/openstack/247/juju/bin/juju', 'bootstrap', 'sunbeam', 'sunbeam-controller', '--agent-version=3.2.0']' returned non-zero exit status 1.
radware@t4kvm4:~$
radware@t4kvm4:~$ sudo juju controllers
ERROR No controllers registered.

Please either create a new controller using "juju bootstrap" or connect to
another controller that you have been given access to using "juju register".

radware@t4kvm4:~$
radware@t4kvm4:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
radware@t4kvm4:~$

Revision history for this message
Hua Zhang (zhhuabj) wrote :

I also hit this error - ERROR failed to bootstrap model: machine is already provisioned,

I fixed it by the following command:

sudo remove-juju-services

Revision history for this message
Javier Abrego (abregomail) wrote :

same issue here on a brand new ubuntu-server install
when trying to install microstack and executing the command

$ sunbeam cluster bootstrap --accept-defaults
[...]
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
chown: invalid user: ‘syslog:adm’
ERROR failed to bootstrap model: subprocess encountered error code 1

Error: Command '['/snap/openstack/274/juju/bin/juju', 'bootstrap', 'sunbeam', 'sunbeam-controller', '--agent-version=3.2.0']' returned non-zero exit status 1.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy

Revision history for this message
joy (joyjo-man1) wrote :

got same issue.
was due to juju path not existing.

after exit from $ sunbeam cluster bootstrap --accept-defaults
run the command manually with verified juju location

/snap/juju/25443/bin/juju clouds --format json
/snap/juju/25443/bin/juju bootstrap sunbeam sunbeam-controller --agent-version=3.2.0

then retry the bootstrap script

Revision history for this message
joy (joyjo-man1) wrote :

can also try "juju refresh"

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.