# Unable to get Redis out of read only mode post upgrade

**URL:** https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471
**Category:** Self-hosting
**Tags:** docker, read-only
**Created:** [07.Май.2015 20:00:48 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471 "2015-05-07T20:00:48Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![stroupaloop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stroupaloop/32/43099_2.png) [@stroupaloop](https://meta.discourse.org/u/stroupaloop)
#### Post date: [07.Май.2015 20:00:48 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/1 "2015-05-07T20:00:48Z")

</div>

Hey Discourse community! This may be a quick fix, but I couldn’t find anything that solved this problem.

I recently updated my Discourse server (docker \> AWS setup \> EC2, postgres, Redis, SES) and have been stuck in read only mode. I’ve tried ssh’ing into my server and running the following commands

```
sudo ./launcher enter app
discourse disable_readonly

```

which returns

```
WARN: Redis is in a readonly state. Performed a noop
The site is now fully operable.

```

OR entering the rails console

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

```

which returns …

```
WARN: Redis is in a readonly state. Performed a noop
=> true

```

but even after a rebuild I’m still unable to log into the Discourse server. Not super familiar with Redis, any help would be awesome!

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [08.Май.2015 16:31:13 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/4 "2015-05-08T16:31:13Z")

</div>

You should only be seeing the redis readonly error if redis is replying with a readonly result. Is there any chance your redis is running read only?

---

<div class="post-metadata">

### Author: ![stroupaloop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stroupaloop/32/43099_2.png) [@stroupaloop](https://meta.discourse.org/u/stroupaloop)
#### Post date: [08.Май.2015 17:04:04 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/5 "2015-05-08T17:04:04Z")

</div>

Hi @eviltrout thanks for the response! When I initially setup the Redis cluster (2 nodes) it was working fine BUT with the in app update it put my Redis server in read only.

Any guidance on how to get it out of read only mode? Thanks!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [10.Май.2015 12:11:18 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/6 "2015-05-10T12:11:18Z")

</div>

Redis cluster, I am a bit confused, only setup that would work is a master slave, to support active-active clustering we would need application changes.

The error you have definitely indicates its talking to a slave redis:

The following would kick a live instance off slave mode.

```plaintext
redis-cli 
slaveof no one

```

Perhaps you are talking to a slave redis instead of master?

---

<div class="post-metadata">

### Author: ![stroupaloop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stroupaloop/32/43099_2.png) [@stroupaloop](https://meta.discourse.org/u/stroupaloop)
#### Post date: [10.Май.2015 14:58:09 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/7 "2015-05-10T14:58:09Z")

</div>

Hey @sam thanks for the response!

So I setup two clusters within a replication group so that there was a backup cluster in case the primary failed (discourse-001 and discourse-002). What’s interesting is that I think the upgrade forced a switch/swap of the clusters as discourse-001 WAS setup to the primary BUT now discourse-002 is now set as primary.

Let me dig deeper …

Here’s my setup below:

 ![](https://global.discourse-cdn.com/meta/original/3X/e/5/e52af4488131b7ab0b5c3b0e200b28cbb592e51a.png) 

 ![](https://global.discourse-cdn.com/meta/original/3X/c/a/caf719f234ed68aeceda2d55a7cc5a8da5bd45fc.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/9/8/98687840bfbae991390a15343ab31ea46db18f98.png)

---

<div class="post-metadata">

### Author: ![stroupaloop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stroupaloop/32/43099_2.png) [@stroupaloop](https://meta.discourse.org/u/stroupaloop)
#### Post date: [10.Май.2015 15:08:30 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/8 "2015-05-10T15:08:30Z")

</div>

So quick update, I was able to get out of read only mode by doing the following:

- it looks like the upgrade switched the primary redis cluster within the replication group from -001 to -002 **SO** by switching to discourse-002 in the app.yml file, it pulled me out of read-only mode.

- I tried to switching to the replication group end point instead (removing -001 or -002 from the endpoint address) to see if it’d auto-default to one or the other, BUT it failed

- **HOWEVER** this means that anytime I do an upgrade, I’ll have to go into the app.yml file and switch between the redis clusters for it to get out of read-only mode

This isn’t ideal, but workable. May be something to look into down the road for future builds, thanks!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [10.Май.2015 21:16:59 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/9 "2015-05-10T21:16:59Z")

</div>

There is no reason the upgrade would cause that, what is your failover check and process?

---

<div class="post-metadata">

### Author: ![stroupaloop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stroupaloop/32/43099_2.png) [@stroupaloop](https://meta.discourse.org/u/stroupaloop)
#### Post date: [11.Май.2015 00:07:16 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/10 "2015-05-11T00:07:16Z")

</div>

hm interesting, noob question, where do I check those settings? Thanks!

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [11.Май.2015 00:23:54 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/11 "2015-05-11T00:23:54Z")

</div>

I am really unsure about how AWS goes about this, can you ask support at AWS for some help?

---

<div class="post-metadata">

### Author: ![stroupaloop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stroupaloop/32/43099_2.png) [@stroupaloop](https://meta.discourse.org/u/stroupaloop)
#### Post date: [11.Май.2015 00:25:30 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/12 "2015-05-11T00:25:30Z")

</div>

Yeah totally, I’ll dig into this more this week and will keep you guys posted. Glad it’s back up and running and a work around for the time being, more to come!

---

<div class="post-metadata">

### Author: ![stroupaloop](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stroupaloop/32/43099_2.png) [@stroupaloop](https://meta.discourse.org/u/stroupaloop)
#### Post date: [19.Май.2015 22:01:08 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/13 "2015-05-19T22:01:08Z")

</div>

So not sure if there was a fix that came out from you guys (happy to say there was) or something weird happened last time, but the docker and discourse upgrade I just did worked find and didn’t kick me into read only mode 😄

---

<div class="post-metadata">

### Author: ![craft37](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/craft37/32/35505_2.png) [@craft37](https://meta.discourse.org/u/craft37)
#### Post date: [08.Ноябрь.2016 13:17:26 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/14 "2016-11-08T13:17:26Z")

</div>

I don’t recognized earlier but I needed to disable read only in backups section /admin/backups/

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [26.Март.2019 13:39:57 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/15 "2019-03-26T13:39:57Z")

</div>



---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [27.Март.2019 01:07:02 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/16 "2019-03-27T01:07:02Z")

</div>

Hope all is well and that you are still enjoying Discourse.

In the past few years we have done a lot to make this readonly redis mode much more fault tolerant, we have not really heard complaints recently about redis being stuck in secret read only mode.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [30.Март.2019 07:00:03 UTC](https://meta.discourse.org/t/unable-to-get-redis-out-of-read-only-mode-post-upgrade/28471/17 "2019-03-30T07:00:03Z")

</div>

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