# Redis template no longer works for separate data container

**URL:** https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704
**Category:** Bug
**Created:** [February 20, 2019, 10:37pm UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704 "2019-02-20T22:37:35Z")
**Posts on this page:** 9
**Page:** 1

<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: [February 20, 2019, 10:37pm UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/1 "2019-02-20T22:37:35Z")

</div>

It seems that redis changed the default for protected mode so that if you’ve got a separate data container it no longer allows connections. My caveman solution is to add this to `data.yml` in the hooks section.

```plaintext
  after_redis:
    - replace:
        filename: "/etc/redis/redis.conf"
        from: /^protected-mode yes/
        to: "protected-mode no"

```

There’s probably a smarter way to allow only connections from the docker network or some such, so I’ll leave it to someone more clever than I to submit a PR.

EDIT: If you see errors that look like

```plaintext
Failed to report error: DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no auth
entication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect
 from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no'

```

then this is the solution.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [February 20, 2019, 11:10pm UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/2 "2019-02-20T23:10:13Z")

</div>

@dan can advise here.

---

<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: [February 20, 2019, 11:15pm UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/3 "2019-02-20T23:15:09Z")

</div>

Default protected mode is a bit overkill, especially since the container is not exposing any of this, I say we change the base image here to default not protected

---

<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: [February 21, 2019, 2:51am UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/4 "2019-02-21T02:51:15Z")

</div>

> [@sam](#):
>
> Default protected mode is a bit overkill,

I may not understand, but my take is that they changed the default upstream.

Someone decided that it was time to grow up and that wide open defaults was a bad idea. 🙂

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 21, 2019, 2:53am UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/5 "2019-02-21T02:53:47Z")

</div>

Awww you’re taking all my fun away by not letting me blame @dan 😘

---

<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: [February 21, 2019, 2:58am UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/6 "2019-02-21T02:58:05Z")

</div>

And FWIW, a standard single container install works fine.

---

<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: [February 21, 2019, 3:15am UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/7 "2019-02-21T03:15:09Z")

</div>

> [@pfaffman](#):
>
> I may not understand, but my take is that they changed the default upstream.

Sure which is fine, but we can ship our own default 😊…

> <https://github.com/discourse/discourse_docker/commit/281190efb367298f4134672ff25082a5a74fba9f>
>
> We do not require protected mode in redis cause it runs in a container
> and is de…fault protected.
> 
> Protected mode breaks running our template in a multi container setup or
> certain users exposting redis from the container if they wish

---

<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: [February 21, 2019, 3:22am UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/8 "2019-02-21T03:22:15Z")

</div>

That’s the pr that I would have submitted!

---

<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: [February 22, 2019, 7:00am UTC](https://meta.discourse.org/t/redis-template-no-longer-works-for-separate-data-container/109704/9 "2019-02-22T07:00:03Z")

</div>

This topic was automatically closed after 27 hours. New replies are no longer allowed.
