A user reports their Discourse site is stuck in ‘read only’ mode and seeks help. pfaffman provides a solution using Rails console commands, which involves running Discourse.disable_readonly_mode with the Discourse::USER_READONLY_MODE_KEY argument. tgxworld confirms this works, while pfaffman notes the function’s requirement for an argument seems like a UX issue. tgxworld explains that Discourse.disable_readonly_mode isn’t a public API and the argument is needed to target specific read-only modes. The discussion also touches on potential causes like Redis failovers and the need for a more robust emergency solution, with riking suggesting an emergency_disable_readonly_mode function.
A friend helped me set up Discourse, but unfortunately he’s left town for a Linux conference in Seattle
I’m trying to present this site to my professors tomorrow night. Really don’t know where to begin.
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.
So I have a similar issue. After getting through here (Inheriting discourse install - need some assistance - #13 by jerdog) 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
Hey, @tgxworld. I just got stuck on this problem for a while moving someone to a different server. Is there a reason that Discourse::USER_READONLY_MODE_KEY isn’t the default so that one doesn’t have to sometimes remember to add this argument?
Fair enough, but my question is still if there is a reason that the argument isn’t the default. Usually it’s not necessary, but in some cases (I guess mostly when you move a red only database to another server it is. And then one needs to remember to add Discourse::READONLY_MODE_KEY. Couldn that be the desk argument so that it’s never necessary for someone to include it?