Stuck in 'Read Only' Mode


Hi all,

My site is suddenly in ‘read only’ mode, and I don’t know why.

A friend helped me set up Discourse, but unfortunately he’s left town for a Linux conference in Seattle :stuck_out_tongue:
I’m trying to present this site to my professors tomorrow night. Really don’t know where to begin.

Thanks so much,

AWS installation stuck in Read only mode
(Jay Pfaffman) #2

If you can ssh into the site host, try this :

./launcher enter app
rails c

Unable to login as admin after enabling read only mode
(shitposting) #3

This worked for me earlier. It doesn’t seem to be working now.

It pops out of read only mode for a second and then reverts back to it.

Edit: This may be because I restored a DigitalOcean image. In any case, it keeps looping back into read only status.

(Alan Tan) #4


Accidentally made site read only, how do I disable?
Read-only flag gets reset during backup and restore to new server
(shitposting) #5

That did it. Thank you.

(Jay Pfaffman) #6

I had a client with this problem just now.

I don’t know how the site ended up in Read only mode.

I don’t know why disable_readonly_mode requires an argument.

These seem like bugs.

(Alan Tan) #7

Is it still in read only mode? There is a way to figure out the cause of it by looking for the right Redis keys.

I don’t understand how disable_readonly_mode requiring an argument makes it a bug.

(Jay Pfaffman) #8

Maybe it’s a UX thing. :slight_smile: it would just seem that such a function could be written such that it didn’t need an argument

How to check the redis keys? Oh. No I managed to get it out of read only with your help, so we can’t tell now?

(Jay Pfaffman) #9

And apparently it used to work without an argument.

(Alan Tan) #10

It doesn’t need an argument by default :wink:

Anyway, Discourse.disable_readonly_mode isn’t public API so what used to work might not always continue to work. The source code is the “source” of truth in this case.

Assuming you ran Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY) to get it out of read only mode, it was a user that enabled readonly mode.

Inheriting discourse install - need some assistance
(Jay Pfaffman) #11

Perhaps mere mortals don’t often need to do that.

(Jeremy M) #12

So I have a similar issue. After getting through here (Inheriting discourse install - need some assistance) I am attempting the Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY) but it keeps returning => true, is out of RO Mode for a second and then pops back in. I don’t have that key if I need to physically type it in… So stuck a bit

(Thomas Abraham) #13

Did anybody manage to get really out of the stuck mode?
I’ve been seeing this for a couple of days now on our instances.

It might be that on our side it was triggered by a automatic failover within Redis.

Is there any key in Redis or Postgresql helping me to understand the problem?

(Thomas Abraham) #14

To whom it may concern:

  • Switched redis instances - no success
  • stopped and started the first out of two www containers - no success
  • stopped and started the second www container - stuck readonly mode seems to have gone

Still I don’t know why one of my containers obviously was not willing to perform. No log entry. No further indication.

Does Discourse follow this crazy “Have you tried to turn it on and off again”?