# 非常に古いコンテナからのアップグレードが、Postgresの権限エラーで失敗する

**URL:** https://meta.discourse.org/t/upgrading-from-a-very-old-container-fails-due-to-postgres-permission-errors/368597
**Category:** Bug
**Created:** [2025 年 6 月 2 日午後 7:30 UTC](https://meta.discourse.org/t/upgrading-from-a-very-old-container-fails-due-to-postgres-permission-errors/368597 "2025-06-02T19:30:41Z")
**Posts on this page:** 3
**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: [2025 年 6 月 2 日午後 7:30 UTC](https://meta.discourse.org/t/upgrading-from-a-very-old-container-fails-due-to-postgres-permission-errors/368597/1 "2025-06-02T19:30:41Z")

</div>

[Welcome to nginx! page before rebuild, site won’t rebuild now](https://meta.discourse.org/t/welcome-to-nginx-page-before-rebuild-site-wont-rebuild-now/368433/14) からの議論の続きです。

非常に古いコンテナからアップグレードした場合、PostgreSQL の権限が間違っていることがまれにありますが（PostgreSQL の UID と GID が変更されました）、これを修正するには以下が必要です。

```plaintext
chmod -r 101.104 /var/discourse/shared/standalone/postgres_data

```

これを数回行いました。リンクされたトピックへの最初の返信で問題に気づきましたが、ほとんどの人にとって必要な UID/GID を特定するのは簡単ではありません。（動作しているサーバーを見つけて `ls -ld /var/discourse/shared/standalone/postgres_data` を実行してください。）

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [2025 年 6 月 2 日午後 8:08 UTC](https://meta.discourse.org/t/upgrading-from-a-very-old-container-fails-due-to-postgres-permission-errors/368597/2 "2025-06-02T20:08:01Z")

</div>

> [@pfaffman](#):
>
> 動作中のサーバーを見つけて、`ls -ld /var/discourse/shared/standalone/postgres_data` を実行してください。

または、もっと簡単に：

```plaintext
○ → docker run --rm discourse/base:2.0.20250226-0128 id postgres
uid=101(postgres) gid=104(postgres) groups=104(postgres),107(ssl-cert)

```

さらに良いのは：

```plaintext
docker run --rm -v /var/discourse/shared/standalone/postgres_data:/data discourse/base:2.0.20250226-0128 chown -R postgres:postgres /data

```

---

<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: [2025 年 6 月 3 日午後 3:26 UTC](https://meta.discourse.org/t/upgrading-from-a-very-old-container-fails-due-to-postgres-permission-errors/368597/3 "2025-06-03T15:26:15Z")

</div>

> [@supermathie](#):
>
> easier

それが私が好きな答えです。多くの人が「簡単」と呼ぶものではありません！

ベアコンテナを実行することになるとは思いませんでした。
