# Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' 失败，返回

**URL:** https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858
**Category:** Self-hosting
**Created:** [2023年二月11日 16:13 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858 "2023-02-11T16:13:08Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 16:13 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/1 "2023-02-11T16:13:08Z")

</div>

运行 `./launcher rebuild app` 时出现以下错误：

## FAILED

Pups::ExecError: su postgres -c ‘psql discourse -c “alter schema public owner to discourse;”’ 失败，返回 #\<Process::Status: pid 54 exit 2\>  
失败位置：/usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec\_command.rb:117:in `spawn' exec 失败，参数为 "su postgres -c 'psql $db_name -c \\\"alter schema public owner to $db_user;\\\"'" 引导失败，退出代码为 2 **引导失败** 请向上滚动查找之前的错误消息，可能不止一个。 `./discourse-doctor` 可能有助于诊断问题。  
4079c40b96373f2f33049a30414bc383bdb52a1a678a9f0cc9f7

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [2023年二月11日 19:06 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/2 "2023-02-11T19:06:17Z")

</div>

Originally sent in [general](https://meta.discourse.org/chat/c/-/508)

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/ratnam_raju_varsala/48/292923_2.png)

Ratnam\_Raju\_Varsala

嗨 @Canapin，我该如何将插件集成到 docker 应用程序中？

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/heliosurge/48/131899_2.png)

Heliosurge

> [@Install plugins on a self-hosted site](https://meta.discourse.org/t/install-plugins-in-discourse/19157?u=heliosurge):
>
> warning This guide assumes that you have a self-hosted standard installation. We only support the standard method of install here, so these instructions assume you have a [standard install](https://meta.discourse.org/t/142537?silent=true). warning This guide only applies to self-hosted Discourse instances. If you are using a managed hosting service, the available plugins are controlled by your hosting provider. For example, on our hosting [these specific plugins](https://www.discourse.org/plugins) are available by hosting tier. In this tutorial, we’ll install the [Discours…](https://github.com/discourse/discourse-solved)

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/ratnam_raju_varsala/48/292923_2.png)

Ratnam\_Raju\_Varsala

失败  
--------------------

Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' 失败，返回 #\<Process::Status: pid 54 exit 2\>

失败位置：/usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec\_command.rb:117:in `spawn'

exec 失败，参数为 "su postgres -c 'psql $db\_name -c \"alter schema public owner to $db\_user;\"'"

引导失败，退出代码 2

**引导失败** 请向上滚动查找更早的错误消息，可能不止一个。

./discourse-doctor 可能有助于诊断问题。

4079c40b96373f2f33049a30414bc383bdb52a1a678a9f0cc9f7

root@community-online:/var/discourse# /discourse-doctor

-bash: /discourse-doctor: No such file or directory

在 app.yml 文件中添加插件后，我遇到了这个错误。

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/heliosurge/48/131899_2.png)

Heliosurge

你能否发布你在 app.yml 中将插件添加到 docker 的那部分内容？

格式必须非常精确。  
这有点麻烦，但通常一次只安装和重建 2 个插件。  
你想安装什么插件？

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/ratnam_raju_varsala/48/292923_2.png)

Ratnam\_Raju\_Varsala

在添加插件之前，网站运行正常，添加此插件后，网站就无法访问了。

- sudo -E -u discourse git clone [GitHub - jannolii/discourse-topic-trade-buttons](https://github.com/jannolii/discourse-topic-trade-buttons.git)

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/heliosurge/48/131899_2.png)

Heliosurge

删除你聊天帖子的一部分。你有一些敏感信息。只需要显示 $home 类型的东西和插件信息的部分。

你的 trade buttons 插件被添加了两次。删除这两个实例，然后尝试重建，看看网站是否恢复。

如果聊天允许，只需要从这里向下显示，并用类似 ´`´...´`´ 的东西括起来。

 ![Screenshots_2023-02-11-15-00-34.png](https://global.discourse-cdn.com/meta/original/4X/8/d/8/8d81d20cff9ed77c56b15455665ae092d7b98a0f.png)

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/ratnam_raju_varsala/48/292923_2.png)

Ratnam\_Raju\_Varsala

没有添加两次。  
我在这里粘贴 app.yml 的完整内容。

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/jammydodger/48/254611_2.png)

JammyDodger

我认为最好在主题中讨论这个问题。我将把这些消息移过去。👍

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/ratnam_raju_varsala/48/292923_2.png)

Ratnam\_Raju\_Varsala

已删除

 ![](https://d3bpeqsaub0i6y.cloudfront.net/user_avatar/meta.discourse.org/heliosurge/48/131899_2.png)

Heliosurge

好的，Jam。你能删除他的敏感信息，只保留插件信息吗？

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:07 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/3 "2023-02-11T19:07:46Z")

</div>

```plaintext

I, [2023-02-11T18:58:30.914906 #1] INFO -- : ` ! -e /shared/postgres_data ` && install -d -m 0755 -o postgres -g postgres /shared/postgres_data && sudo -E -u postgres /usr/lib/postgresql/13/bin/initdb -D /shared/postgres_data || exit 0
I, [2023-02-11T18:58:30.917342 #1] INFO -- : 
I, [2023-02-11T18:58:30.917415 #1] INFO -- : ` chown -R postgres:postgres /shared/postgres_data
I, [2023-02-11T18:58:30.930655 #1] INFO -- : 
I, [2023-02-11T18:58:30.930872 #1] INFO -- : ` chown -R postgres:postgres /var/run/postgresql
I, [2023-02-11T18:58:30.933165 #1] INFO -- : 
I, [2023-02-11T18:58:30.933384 #1] INFO -- : ` /root/upgrade_postgres
I, [2023-02-11T18:58:30.937415 #1] INFO -- : 
I, [2023-02-11T18:58:30.937665 #1] INFO -- : ` rm /root/upgrade_postgres
I, [2023-02-11T18:58:30.939673 #1] INFO -- : 
I, [2023-02-11T18:58:30.940012 #1] INFO -- : Replacing data_directory = '/var/lib/postgresql/13/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.940639 #1] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.941061 #1] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.941491 #1] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.941859 #1] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.942208 #1] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.942546 #1] INFO -- : ` install -d -m 0755 -o postgres -g postgres /shared/postgres_backup
I, [2023-02-11T18:58:30.945002 #1] INFO -- : 
I, [2023-02-11T18:58:30.945405 #1] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.945805 #1] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.946227 #1] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/13/main/postgresql.conf
I, [2023-02-11T18:58:30.946605 #1] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/13/main/pg_hba.conf
I, [2023-02-11T18:58:30.946992 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-02-11T18:58:30.947317 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2023-02-11T18:58:30.947660 #1] INFO -- : ` HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main
I, [2023-02-11T18:58:30.949060 #1] INFO -- : ` sleep 5
2023-02-11 18:58:30.959 UTC [42] FATAL: data directory "/shared/postgres_data" has invalid permissions
2023-02-11 18:58:30.959 UTC [42] DETAIL: Permissions should be u=rwx (0700) or u=rwx,g=rx (0750).
I, [2023-02-11T18:58:35.952167 #1] INFO -- : 
I, [2023-02-11T18:58:35.952437 #1] INFO -- : ` su postgres -c 'createdb discourse' || true
createdb: error: could not connect to database template1: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
I, [2023-02-11T18:58:35.994953 #1] INFO -- : 
I, [2023-02-11T18:58:35.995243 #1] INFO -- : ` su postgres -c 'psql discourse -c "create user discourse;"' || true
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
I, [2023-02-11T18:58:36.036721 #1] INFO -- : 
I, [2023-02-11T18:58:36.037043 #1] INFO -- : ` su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
I, [2023-02-11T18:58:36.078384 #1] INFO -- : 
I, [2023-02-11T18:58:36.078703 #1] INFO -- : ` su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: No such file or directory
	Is the server running locally and accepting connections on that socket?
I, [2023-02-11T18:58:36.120285 #1] INFO -- : 
I, [2023-02-11T18:58:36.120682 #1] INFO -- : Terminating async processes

FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 54 exit 2>
Location of failure: /usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \\\"alter schema public owner to $db_user;\\\"'"
bootstrap failed with exit code 2
**FAILED TO BOOTSTRAP** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
4c2225e9c667f9fc2b7b4f9bd26c03f243e877b123be1d41a3c57bf90c049595

```

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:08 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/4 "2023-02-11T19:08:49Z")

</div>

添加插件时，您需要复制并像上面那样放置代码。我认为行之间不应有空格。

另外，请验证您想使用的插件是否仍然受支持。

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:10 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/5 "2023-02-11T19:10:26Z")

</div>

可以发一下那个插件链接吗？我不熟悉那个插件。如果能在 Discourse 上提供链接就更好了。

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:11 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/6 "2023-02-11T19:11:51Z")

</div>

discourse git clone [GitHub - jannolii/discourse-topic-trade-buttons](https://github.com/jannolii/discourse-topic-trade-buttons.git)

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:13 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/7 "2023-02-11T19:13:08Z")

</div>

我删除了插件，然后尝试重新构建它，但在删除插件后我遇到了这个错误，之前它可以正常工作。

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:16 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/8 "2023-02-11T19:16:02Z")

</div>

I, [2023-02-11T18:58:30.949060 #1] INFO – : \u003e sleep 5

2023-02-11 18:58:30.959 UTC [42] FATAL: /shared/postgres\_data” 目录的数据目录权限无效

2023-02-11 18:58:30.959 UTC [42] DETAIL: 权限应为 u=rwx (0700) 或 u=rwx,g=rx (0750)。

I, [2023-02-11T18:58:35.952167 #1] INFO – :

I, [2023-02-11T18:58:35.952437 #1] INFO – : \u003e su postgres -c ‘createdb discourse’ || true

createdb: error: 无法连接到 template1 数据库：连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败：不存在该文件或目录

服务器是否在本地运行并接受该套接字上的连接？

I, [2023-02-11T18:58:35.994953 #1] INFO – :

I, [2023-02-11T18:58:35.995243 #1] INFO – : \u003e su postgres -c ‘psql discourse -c "create user discourse;"’ || true

psql: error: 连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败：不存在该文件或目录

服务器是否在本地运行并接受该套接字上的连接？

I, [2023-02-11T18:58:36.036721 #1] INFO – :

I, [2023-02-11T18:58:36.037043 #1] INFO – : \u003e su postgres -c ‘psql discourse -c "grant all privileges on database discourse to discourse;"’ || true

psql: error: 连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败：不存在该文件或目录

服务器是否在本地运行并接受该套接字上的连接？

I, [2023-02-11T18:58:36.078384 #1] INFO – :

I, [2023-02-11T18:58:36.078703 #1] INFO – : \u003e su postgres -c ‘psql discourse -c "alter schema public owner to discourse;"’

psql: error: 连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败：不存在该文件或目录

服务器是否在本地运行并接受该套接字上的连接？

I, [2023-02-11T18:58:36.120285 #1] INFO – :

I, [2023-02-11T18:58:36.120682 #1] INFO – : 终止异步进程

FAILED

* * *

Pups::ExecError: su postgres -c ‘psql discourse -c "alter schema public owner to discourse;"’ 失败，返回 #\u003cProcess::Status: pid 54 exit 2\u003e

失败位置：/usr/local/lib/ruby/gems/3.1.0/gems/pups-1.1.1/lib/pups/exec\_command.rb:117:in `spawn’

使用参数 “su postgres -c ‘psql $db\_name -c \"alter schema public owner to $db\_user;\"’” 执行失败

引导失败，退出代码为 2

**引导失败** 请向上滚动查找更早的错误消息，可能不止一个。

./discourse-doctor 可能有助于诊断问题。

4c2225e9c667f9fc2b7b4f9bd26c03f243e877b123be1d41a3c57bf90c049595

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:16 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/9 "2023-02-11T19:16:23Z")

</div>

我不确定该程序，但您也许可以安全模式加载该网站。

@JammyDodger，您能提供安全模式的程序链接吗？

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:19 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/10 "2023-02-11T19:19:14Z")

</div>

你看到我的日志文件了吗？

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [2023年二月11日 19:19 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/11 "2023-02-11T19:19:22Z")

</div>

> [@Heliosurge](#):
>
> 可以链接到[安全模式](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)的操作方法吗？

正如你所见，“安全模式”已自动转换为指向安全模式教程的链接 🙂

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:20 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/12 "2023-02-11T19:20:36Z")

</div>

太棒了，谢谢。抱歉。canapin，你看到什么可能导致这个问题了吗？猜测一下，也许是 `app.yml` 中的格式化问题？

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:21 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/13 "2023-02-11T19:21:54Z")

</div>

来自安全模式主题的摘录。

> [@sam](#):
>
> Discourse 有一个“JavaScript [安全模式](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)” **任何** 用户都可以使用该模式来隔离由插件、主题或主题组件引起的 JavaScript 问题的根本原因。
> 
> 要访问[安全模式](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)，请转至：
> 
> `http://your-site-name/safe-mode` 例如，这是 meta 的[安全模式](https://meta.discourse.org/t/how-to-use-discourse-safe-mode/53504)

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:22 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/14 "2023-02-11T19:22:31Z")

</div>

2023-02-11 19:20:40.842 UTC [42] FATAL: 数据目录“/shared/postgres\_data”权限无效  
2023-02-11 19:20:40.842 UTC [42] DETAIL: 权限应为 u=rwx (0700) 或 u=rwx,g=rx (0750)。  
I, [2023-02-11T19:20:45.834611 #1] INFO – :  
I, [2023-02-11T19:20:45.834887 #1] INFO – : \> su postgres -c ‘createdb discourse’ || true  
createdb: error: 无法连接到数据库 template1: 连接到套接字“/var/run/postgresql/.s.PGSQL.5432”上的服务器失败: 没有那个文件或目录  
服务器是否在本地运行并接受该套接字上的连接？

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:28 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/15 "2023-02-11T19:28:27Z")

</div>

您可能需要向上滚动。您是否尝试过安全模式过程？

不确定这在这种情况下是否有效，说实话。

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:31 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/16 "2023-02-11T19:31:11Z")

</div>

网站完全瘫痪，即使我启用了安全模式它也不起作用，网站瘫痪，应用程序未运行

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:34 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/17 "2023-02-11T19:34:37Z")

</div>

能否重新发布您的 app.yml 中的 $plugins goes here 部分？

请确保将其放在“code”和“/code”之间，并将引号替换为“[”和“]”。

```plaintext
您的 app.yml 内容在此
- 不会触发 Markdown
```

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:37 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/18 "2023-02-11T19:37:10Z")

</div>

Dan，我已从 app.yml 文件中移除了插件，现在没有插件了，但我会再次发给你。

---

<div class="post-metadata">

### Author: ![Ratnam\_Raju\_Varsala](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ratnam_raju_varsala/32/292923_2.png) [@Ratnam\_Raju\_Varsala](https://meta.discourse.org/u/Ratnam_Raju_Varsala)
#### Post date: [2023年二月11日 19:38 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/19 "2023-02-11T19:38:15Z")

</div>

volumes:

- volume:  
host: /var/discourse/shared/standalone  
guest: /shared
- volume:  
host: /var/discourse/shared/standalone/log/var-log  
guest: /var/log

## 插件放在这里

## 详情请参阅 [Install plugins on a self-hosted site](https://meta.discourse.org/t/19157)

hooks:  
after\_code:  
- exec:  
cd: $home/plugins  
cmd:  
- git clone [GitHub - discourse/docker\_manager: Plugin for use with discourse docker image](https://github.com/discourse/docker_manager.git)

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [2023年二月11日 19:38 UTC](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858/20 "2023-02-11T19:38:34Z")

</div>

但我明白，但你可能有一个格式错误。`app.yml` 文件非常挑剔……仅仅一行错位就可能导致问题。

这就是我提到粘贴在代码 markdown 之间以便我们能看到文件的原始版本的原因。

即使是行与行之间的一个空行也可能导致问题。

[下一頁](https://meta.discourse.org/t/pups-su-postgres-c-psql-discourse-c-alter-schema-public-owner-to-discourse-failed-with-return/254858.md?page=2)
