When doing a fresh deployment (on a fresh Ubuntu system(s)) the sunbeam logs errors and stack traces even though it is configuring things correctly. For example:
The 'sunbeam prepare-node-script' produces log full of:
07:37:14,426 sunbeam.provider.local.deployment DEBUG No juju account found
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 168, in load
with data_file.open() as file:
File "/usr/lib/python3.10/pathlib.py", line 1119, in open
return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/snap/openstack/523/account.yaml'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/provider/local/deployment.py", line 72, in _load_juju_account
juju_account = JujuAccount.load(snaphelpers.Snap().paths.user_data)
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 171, in load
raise JujuAccountNotFound(
sunbeam.jobs.juju.JujuAccountNotFound: Juju user account not found, is node part of sunbeam cluster yet? /home/ubuntu/snap/openstack/523/account.yaml
...
07:37:14,432 sunbeam.provider.local.deployment DEBUG Clusterd service unavailable
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/service.py", line 133, in _request
response.raise_for_status()
File "/snap/openstack/523/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: http+unix://%2Fvar%2Fsnap%2Fopenstack%2Fcommon%2Fstate%2Fcontrol.socket/1.0/config/JujuController
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/provider/local/deployment.py", line 81, in _load_juju_controller
return JujuController.load(self.get_client())
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 194, in load
controller = client.cluster.get_config(JUJU_CONTROLLER_KEY)
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/cluster.py", line 173, in get_config
return self._get(f"/1.0/config/{key}").get("metadata")
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/service.py", line 185, in _get
return self._request("get", path, **kwargs)
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/service.py", line 158, in _request
raise ClusterServiceUnavailableException(
sunbeam.clusterd.service.ClusterServiceUnavailableException: Sunbeam Cluster not initialized
or the 'sunbeam cluster bootstrap' logs following:
07:57:54,646 root DEBUG Logging to '/home/ubuntu/snap/openstack/common/logs/sunbeam-20240606-075754.646408.log'
07:57:54,646 sunbeam.provider.commands DEBUG Registering deployment type: ('local', <class 'sunbeam.provider.local.deployment.LocalDeployment'>)
07:57:54,646 sunbeam.provider.commands DEBUG Registering deployment type: ('maas', <class 'sunbeam.provider.maas.deployment.MaasDeployment'>)
07:57:54,647 sunbeam.provider.local.deployment DEBUG No juju account found
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 168, in load
with data_file.open() as file:
File "/usr/lib/python3.10/pathlib.py", line 1119, in open
return self._accessor.open(self, mode, buffering, encoding, errors,
FileNotFoundError: [Errno 2] No such file or directory: '/home/ubuntu/snap/openstack/523/account.yaml'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/provider/local/deployment.py", line 72, in _load_juju_account
juju_account = JujuAccount.load(snaphelpers.Snap().paths.user_data)
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 171, in load
raise JujuAccountNotFound(
sunbeam.jobs.juju.JujuAccountNotFound: Juju user account not found, is node part of sunbeam cluster yet? /home/ubuntu/snap/openstack/523/account.yaml
07:57:54,647 sunbeam.clusterd.service DEBUG [get] http+unix://%2Fvar%2Fsnap%2Fopenstack%2Fcommon%2Fstate%2Fcontrol.socket/1.0/config/JujuController, args={'allow_redirects': True}
07:57:54,649 urllib3.connectionpool DEBUG http://localhost:None "GET /1.0/config/JujuController HTTP/1.1" 503 131
07:57:54,649 sunbeam.clusterd.service DEBUG Response(<Response [503]>) = {"type":"error","status":"","status_code":0,"operation":"","error_code":503,"error":"Daemon not yet initialized","metadata":null}
07:57:54,649 sunbeam.provider.local.deployment DEBUG Clusterd service unavailable
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/service.py", line 133, in _request
response.raise_for_status()
File "/snap/openstack/523/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable for url: http+unix://%2Fvar%2Fsnap%2Fopenstack%2Fcommon%2Fstate%2Fcontrol.socket/1.0/config/JujuController
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/provider/local/deployment.py", line 81, in _load_juju_controller
return JujuController.load(self.get_client())
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/jobs/juju.py", line 194, in load
controller = client.cluster.get_config(JUJU_CONTROLLER_KEY)
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/cluster.py", line 173, in get_config
return self._get(f"/1.0/config/{key}").get("metadata")
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/service.py", line 185, in _get
return self._request("get", path, **kwargs)
File "/snap/openstack/523/lib/python3.10/site-packages/sunbeam/clusterd/service.py", line 158, in _request
raise ClusterServiceUnavailableException(
sunbeam.clusterd.service.ClusterServiceUnavailableException: Sunbeam Cluster not initialized
...
I think this is expected during the fresh installation and it would be nice if we don't have those a bit misleading messages in the logs and the sunbeam command could distinguish a real problem situation from the initial state where some of the components are not configured yet.