# Stuck in 'Read Only' Mode

**URL:** https://meta.discourse.org/t/stuck-in-read-only-mode/42820
**Category:** Support
**Tags:** read-only
**Created:** [April 19, 2016, 12:09pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820 "2016-04-19T12:09:13Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![StuckInReadOnly](https://avatars.discourse-cdn.com/v4/letter/s/41988e/32.png) [@StuckInReadOnly](https://meta.discourse.org/u/StuckInReadOnly)
#### Post date: [April 19, 2016, 12:09pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/1 "2016-04-19T12:09:13Z")

</div>

Hi all,

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

[chathamhouse.sandbaggernews.com](http://chathamhouse.sandbaggernews.com)

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.

Thanks so much,  
Stuck.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2016, 1:18pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/2 "2016-04-19T13:18:40Z")

</div>

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

```plaintext
./launcher enter app
rails c
Discourse.disable_readonly_mode

```

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [March 16, 2017, 4:49am UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/4 "2017-03-16T04:49:35Z")

</div>

`Discourse.disable_readonly_mode(Discourse::USER_READONLY_MODE_KEY)`

---

<div class="post-metadata">

### Author: ![anon67292109](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@anon67292109](https://meta.discourse.org/u/anon67292109)
#### Post date: [March 16, 2017, 4:55am UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/5 "2017-03-16T04:55:35Z")

</div>

> [@tgxworld](#):
>
> Discourse.disable\_readonly\_mode(Discourse::USER\_READONLY\_MODE\_KEY)

That did it. Thank you.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2017, 3:08pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/6 "2017-04-19T15:08:58Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 19, 2017, 3:17pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/7 "2017-04-19T15:17:43Z")

</div>

> [@pfaffman](#):
>
> I don’t know how the site ended up in Read only mode.

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.

> [@pfaffman](#):
>
> I don’t know why disable\_readonly\_mode requires an argument.

I don’t understand how disable\_readonly\_mode requiring an argument makes it a bug.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2017, 4:33pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/8 "2017-04-19T16:33:31Z")

</div>

Maybe it’s a UX thing. 🙂 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?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2017, 4:54pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/9 "2017-04-19T16:54:50Z")

</div>

And apparently it used to work without an argument.

> [@How can Admin login while Read-only mode is enabled on multisite?](https://meta.discourse.org/t/how-can-admin-login-while-read-only-mode-is-enabled-on-multisite/23976/2):
>
> Was there any error when you tried that? Alternatively, you could try the following ./launcher enter app rails c Discourse.disable\_readonly\_mode

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [April 19, 2017, 8:56pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/10 "2017-04-19T20:56:19Z")

</div>

> [@pfaffman](#):
>
> Maybe it’s a UX thing. 🙂 it would just seem that such a function could be written such that it didn’t need an argument

It doesn’t need an argument by default 😉

> <https://github.com/discourse/discourse/blob/7eabb90b710a4ad6527c37c2765323268f8dde14/lib/discourse.rb#L252-L256>

> [@pfaffman](#):
>
> And apparently it used to work without an argument.

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.

> [@pfaffman](#):
>
> 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?

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.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 19, 2017, 11:51pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/11 "2017-04-19T23:51:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jerdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerdog/32/122843_2.png) [@jerdog](https://meta.discourse.org/u/jerdog)
#### Post date: [December 21, 2017, 6:57pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/12 "2017-12-21T18:57:07Z")

</div>

So I have a similar issue. After getting through here ([Inheriting discourse install - need some assistance - #13 by jerdog](https://meta.discourse.org/t/inheriting-discourse-install-need-some-assistance/76505/13)) 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

---

<div class="post-metadata">

### Author: ![thabbs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thabbs/32/82150_2.png) [@thabbs](https://meta.discourse.org/u/thabbs)
#### Post date: [July 4, 2018, 11:20am UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/13 "2018-07-04T11:20:03Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![thabbs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thabbs/32/82150_2.png) [@thabbs](https://meta.discourse.org/u/thabbs)
#### Post date: [July 4, 2018, 11:57am UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/14 "2018-07-04T11:57:18Z")

</div>

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”?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 30, 2018, 11:30am UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/15 "2018-12-30T11:30:25Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [December 30, 2018, 6:30pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/16 "2018-12-30T18:30:09Z")

</div>

Perhaps add an `emergency_disable_readonly_mode` that hits all redis keys?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [December 31, 2018, 3:38am UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/17 "2018-12-31T03:38:59Z")

</div>

> [@pfaffman](#):
>
> 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?

This isn’t a public API and in our code base `Discourse.enabled_readonly_mode(Discourse::READONLY_MODE_KEY)` is used way more often.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 31, 2018, 10:02am UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/18 "2018-12-31T10:02:11Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:37pm UTC](https://meta.discourse.org/t/stuck-in-read-only-mode/42820/20 "2024-06-08T12:37:14Z")

</div>

This topic was automatically closed after 2972 days. New replies are no longer allowed.
