# 升级到 3.1.0 后文件系统权限问题

**URL:** <https://meta.discourse.org/t/filesystem-permission-issues-after-upgrade-to-3-1-0/274654>\
**Category:** Self-hosting\
**Created:** [2023 年8 月 10 日 14:27 UTC](https://meta.discourse.org/t/filesystem-permission-issues-after-upgrade-to-3-1-0/274654 "2023-08-10T14:27:12Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![kdambekalns](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kdambekalns/32/120408_2.png) [@kdambekalns](https://meta.discourse.org/u/kdambekalns)\
发布日期： [2023 年8 月 10 日 14:27 UTC](https://meta.discourse.org/t/filesystem-permission-issues-after-upgrade-to-3-1-0/274654/1 "2023-08-10T14:27:12Z")

</div>

我今天从 3.0.x 升级到了 3.1.0。通过 Web UI 更新失败，所以我执行了

```plaintext
git pull
./launcher rebuild app

```

这顺利完成了，但访问网站时我只收到“无效网关”错误。

我将此追溯到文件系统权限错误：

- `/var/www/discourse/tmp/pids` 不可写，修复该问题导致
- `/etc/postgresql/13/main/pg_hba.conf` 不可读。

修复这些问题后网站可以工作，但用户头像丢失。再次，一个临时目录丢失了，所以我将容器中的 `/var/www/discourse/tmp` 设置为全局可写。

这似乎解决了所有我已知的潜在问题，但可能还有更多问题隐藏在暗处。

另外，我在日志中看到了这个：

```plaintext
error running git command: ["git", "rev-parse", "HEAD"] in /var/www/discourse/plugins/styleguide : Discourse::Utils::CommandError : /var/www/discourse/lib/discourse.rb:137:in `exec': fatal: detected dubious ownership in repository at '/var/www/discourse'
To add an exception for this directory, call:

	git config --global --add safe.directory /var/www/discourse

```

3.1 有什么变化吗？考虑到这是基于 Docker 的，我很惊讶这些问题会出现……到目前为止，我升级后从未遇到过类似的问题。

---

_[View the full topic](https://meta.discourse.org/t/filesystem-permission-issues-after-upgrade-to-3-1-0/274654)._
