Hello, my discourse server is stuck in maintenance mode.
I have left it in maintenance mode for several months on purpose, I’ve upgraded to many versions since initially setting it to maintenance mode.
My session has expired and I’ve been logged out, now I can’t log back in.
I can SSH to the discourse server.
I have tried the following steps:
SSH to discourse server
navigate to /var/discourse/
run: ./launcher enter app
run rails c
I have tried several things to disable maintenance mode here.
Upon doing this, I noticed the banner comes back and I can’t even click the login button because it says Login is disabled while the site is in read only mode. and I also see the banner that says:
This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
when I call disable_readonly_mode again, the maintenance mode banner goes away, and I can click the login button. Discourse even hands me over to the authentication sso provider.
However, when I’m redirected back to discourse, I get a whole page saying “The site is in read only mode. Interactions are disabled.”
I’ve done a bit of digging and, while I haven’t landed on a fix as yet, it seems the /u/admin-login link will bypass read_only, and allow you to still login:
Nothing I did was able to get me out of the state.
After Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY) it goes to R/W for a second and reverts back to R/O just afterwards. Nothing discernible in logs. Even flushing Redis doesn’t help. Nor clearing the redis keys by hand.
This is very likely a bug as reverting 2.8.7 to 2.8.3 (which was my previous functional version) corrected the issue.
I tried going through the code to figure out where the bug was introduced, but couldn’t actually figure it out.