A Discourse instance can be set in read-only mode for backups. I had used this for a global read-only maintenance. The admin session was on one of my computers which timed out after a while.
In order to regain access to the Discourse instance, and being able to login as an administrator, I had to follow these instructions:
ssh firstname.lastname@example.org cd /var/discourse ./launcher enter app rails c Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY) quit ctrl+d
Navigate back to the site and you can login again.