Skip to content

App crashes if there is no default 'Site' #1328

Open
@istride

Description

@istride

There was an incident where a live site went down because GlobalDataMiddleware was unable to retrieve a Site object from the database, which then causes a cascade of further failures during request processing. See log attached.

The problem was resolved by ensuring that a default Site is configured i.e. at least one Site exists with the is_default_site field set to 'true'. It is unclear how there came to be no default Site in the database, but any Wagtail admin with the required permissions could create the conditions for this failure.

What can we do to try to avoid this in future?

default-site-bug.log.txt

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions