"Error: Unable to connect to websocket" during "sunbeam cluster bootstrap"

Bug #2033400 reported by Viacheslav
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Snap
Confirmed
Undecided
Unassigned

Bug Description

According to this tutorial
https://ubuntu.com/openstack/install

On step with "sunbeam cluster bootstrap --role control --role compute --role storage"
Message appears:
An unexpected error has occurred. Please run 'sunbeam inspect' to generate an inspection report.
Error: Unable to connect to websocket

Note: Same output for 'sunbeam inspect'.

Revision history for this message
James Page (james-page) wrote :

Hi @viacheslav

This error indicates an issue very early in the bootstrap process before any level of cluster management is in place which is why the inspect command fails.

Adding the `-v` flag to the bootstrap command would give us more signal as to the root cause here:

sunbeam -v cluster bootstrap --role control --role compute --role storage

Changed in snap-openstack:
status: New → Incomplete
Revision history for this message
Tytus Kurek (tkurek) wrote :

I've also faced this one when trying to deploy from the 2023.1 channel.

Re-running the "sunbeam cluster bootstrap" command solved the issue.

I'm going to start using the "-v" flag moving forward so that I can capture details like that in the future.

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

Same for me, got this error in the same way, but when I repeat, it does not happen again. Will try to use -v on a fresh installation next time.

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :
Download full text (3.3 KiB)

Got a verbose run of the issue happening. Attached.

This is the last part:

           DEBUG Unable to connect to websocket utils.py:276
                    Traceback (most recent call last):
                      File "/snap/openstack/324/lib/python3.10/site-packages/sunbeam/utils.py", line 274, in __call__
                        return self.main(*args, **kwargs)
                      File "/snap/openstack/324/lib/python3.10/site-packages/click/core.py", line 1055, in main
                        rv = self.invoke(ctx)
                      File "/snap/openstack/324/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
                        return _process_result(sub_ctx.command.invoke(sub_ctx))
                      File "/snap/openstack/324/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
                        return _process_result(sub_ctx.command.invoke(sub_ctx))
                      File "/snap/openstack/324/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
                        return ctx.invoke(self.callback, **ctx.params)
                      File "/snap/openstack/324/lib/python3.10/site-packages/click/core.py", line 760, in invoke
                        return __callback(*args, **kwargs)
                      File "/snap/openstack/324/lib/python3.10/site-packages/sunbeam/commands/bootstrap.py", line 275, in bootstrap
                        run_plan(plan4, console)
                      File "/snap/openstack/324/lib/python3.10/site-packages/sunbeam/jobs/common.py", line 248, in run_plan
                        skip_result = step.is_skip(status)
                      File "/snap/openstack/324/lib/python3.10/site-packages/sunbeam/commands/sunbeam_machine.py", line 65, in is_skip
                        run_sync(self.jhelper.get_application(APPLICATION, MODEL))
                      File "/snap/openstack/324/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 57, in run_sync
                        result = asyncio.get_event_loop().run_until_complete(coro)
                      File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
                        return future.result()
                      File "/snap/openstack/324/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 190, in wrapper
                        await self.controller.connect(
                      File "/snap/openstack/324/lib/python3.10/site-packages/juju/controller.py", line 138, in connect
                        await self._connector.connect(**kwargs)
                      File "/snap/openstack/324/lib/python3.10/site-packages/juju/client/connector.py", line 78, in connect
                        self._connection = await Connection.connect(**kwargs)
                      File "/snap/openstack/324/lib/python3.10/site-packages/juju/client/connection.py", line 366, in connect
                        raise Exception("Unable to connect to websocket")
                    Exception: Unable to connect to websocket
           WARNING An unexpected er...

Read more...

Revision history for this message
Peter Mattingly (peter-mattingly) wrote (last edit ):

Same here. Following this guide: https://microstack.run/docs/multi-node. The issue occurred on the "Bootstrap the cloud" step.

I had setup some LXD VMs to work through the guide.

I have a snapshot of the VMs as the issue occurred, if that would help.

Edit:

But the issue is not resolved by running the command again:

```
ubuntu@case00369995-sunbeam01:~$ sunbeam cluster bootstrap --role control --role compute --role storage
Management networks shared by hosts (CIDRs, separated by comma) (172.16.1.0/24):
An unexpected error has occurred. Please run 'sunbeam inspect' to generate an inspection report.
Error: Unable to connect to websocket
ubuntu@case00369995-sunbeam01:~$ sunbeam inspect
An unexpected error has occurred. Please run 'sunbeam inspect' to generate an inspection report.
Error: Unable to connect to websocket
```

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

Just a note that this issue is still present in latest "2023.2/edge: 2023.2 2024-02-09 (389) 134MB -" release.

Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

And also still present on 2023.2/edge: 2023.2 2024-02-15 (396) 134MB -

I´m running a lot of tests for sunbeam in a CI/CD environment in the last weeks and this issue happens randomly. It is still the case that re-running the deployment does get past it.

Revision history for this message
Alexandru Darie (alexkpn) wrote :

Is there a solution for this issue ?

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Snap because there has been no activity for 60 days.]

Changed in snap-openstack:
status: Incomplete → Expired
Revision history for this message
Andre Ruiz (andre-ruiz) wrote :

This bug is very much alive and happening on most of my multiple daily runs. It is still the case that you can just re-run the bootstrap command and you will not hit it again (I think I already have about a hundred runs with this issue and it never happened twice).

Changed in snap-openstack:
status: Expired → Confirmed
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.