500 errors from API service when postgres restarted

Bug #2076014 reported by Mitch Burton
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Landscape Server
Status tracked in Beta
24.04
Confirmed
High
Unassigned
24.10
Fix Committed
High
Mitch Burton
Beta
Fix Released
Critical
Mitch Burton

Bug Description

To reproduce:

sudo add-apt-repository ppa:landscape/self-hosted-beta
sudo apt install landscape-server-quickstart

Go to your web UI, set up your first admin, then go to /new_dashboard. It should function properly.

sudo systemctl restart postgresql

Now clicking around the web UI in the new portal will result in 500 errors. /var/log/landscape-server/api.log shows this error for each request:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/web/server.py", line 227, in process
    self.render(resrc)
  File "/usr/lib/python3/dist-packages/twisted/web/server.py", line 292, in render
    body = resrc.render(self)
  File "/opt/canonical/landscape/canonical/landscape/api/resource.py", line 247, in render
    request.setHeader("Access-Control-Allow-Origin", get_root_origin())
  File "/opt/canonical/landscape/canonical/landscape/model/configuration.py", line 286, in get_root_origin
    root_url = get_root_url()
  File "/opt/canonical/landscape/canonical/landscape/model/configuration.py", line 267, in get_root_url
    url = db_config.get(LANDSCAPE_ROOT_URL)
  File "/opt/canonical/landscape/canonical/landscape/model/configuration.py", line 228, in get
    result = store.execute(
  File "/usr/lib/python3/dist-packages/storm/store.py", line 118, in execute
    return self._connection.execute(statement, params, noresult)
  File "/usr/lib/python3/dist-packages/storm/databases/postgres.py", line 306, in execute
    return Connection.execute(self, statement, params, noresult)
  File "/usr/lib/python3/dist-packages/storm/database.py", line 315, in execute
    self._ensure_connected()
  File "/usr/lib/python3/dist-packages/storm/database.py", line 505, in _ensure_connected
    raise DisconnectionError("Already disconnected")
storm.exceptions.DisconnectionError: Already disconnected

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.