# Redisテンプレートで「権限拒否」エラーが発生

**URL:** https://meta.discourse.org/t/redis-template-throws-permission-denied-error/222787
**Category:** Self-hosting
**Created:** [2022 年 4 月 1 日午前 8:54 UTC](https://meta.discourse.org/t/redis-template-throws-permission-denied-error/222787 "2022-04-01T08:54:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [2022 年 4 月 1 日午前 8:54 UTC](https://meta.discourse.org/t/redis-template-throws-permission-denied-error/222787/1 "2022-04-01T08:54:53Z")

</div>

`redis.template.yml` を使用して、別々のコンテナ (web\_only, data) を持つセットアップで再構築すると、以下のようになります。

```plaintext
...
/.launcher rebuild web_only

I, [2022-04-01T06:14:05.621316 #1] INFO -- : End of custom commands
I, [2022-04-01T06:14:05.621524 #1] INFO -- : Terminating async processes
I, [2022-04-01T06:14:05.621574 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 29
29:signal-handler (1648793645) Received SIGTERM scheduling shutdown...
29:M 01 Apr 2022 06:14:05.643 # User requested shutdown...
29:M 01 Apr 2022 06:14:05.643 * Saving the final RDB snapshot before exiting.
29:M 01 Apr 2022 06:14:05.896 # Failed opening the RDB file dump.rdb (in server root dir /) for saving: Permission denied
29:M 01 Apr 2022 06:14:05.896 # Error trying to save the DB, can't exit.
29:M 01 Apr 2022 06:14:05.896 # SIGTERM received but errors trying to shut down the server, check the logs for more information
I, [2022-04-01T06:14:15.622606 #1] INFO -- : exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid:29 did not terminate cleanly, forcing termination!

```

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2022 年 4 月 1 日午前 11:25 UTC](https://meta.discourse.org/t/redis-template-throws-permission-denied-error/222787/2 "2022-04-01T11:25:56Z")

</div>

`redis.template.yml` は data.yml の一部であるべきです。

`git pull` を実行してから `./launcher rebuild web_only` を実行しましたが、正常に完了しました。  
`./discourse-doctor` を試しましたか？あまり役に立たないかもしれませんが。

古いコンテナを `./launcher start web_only` で起動できる場合は、完全なバックアップ（保険として）を取得してから、`./launcher stop web_only; ./launcher rebuild data` を試してみてください。data の再構築中にエラーが発生しない場合は、`./launcher rebuild web_only` を試して問題が解決するかどうかを確認してください。

その間、一貫した再現手順がないため、このトピックを #Support に移動します。

---

<div class="post-metadata">

### Author: ![Thomas\_Rother](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thomas_rother/32/423597_2.png) [@Thomas\_Rother](https://meta.discourse.org/u/Thomas_Rother)
#### Post date: [2022 年 4 月 1 日午後 4:20 UTC](https://meta.discourse.org/t/redis-template-throws-permission-denied-error/222787/3 "2022-04-01T16:20:14Z")

</div>

わかりました、では何か勘違いしていたようです。redisテンプレートはweb\_onlyコンテナの一部だと思っていましたが、dataコンテナの設定に含まれており、そちらの方が理にかなっています 😉
