# 无法重建应用程序/升级到3.4.0.beta4

**URL:** https://meta.discourse.org/t/unable-to-rebuild-app-upgrade-to-3-4-0-beta4/352581
**Category:** Support
**Tags:** install
**Created:** [2025 年2 月 16 日 19:04 UTC](https://meta.discourse.org/t/unable-to-rebuild-app-upgrade-to-3-4-0-beta4/352581 "2025-02-16T19:04:54Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fhaina](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@fhaina](https://meta.discourse.org/u/fhaina)
#### Post date: [2025 年2 月 16 日 19:04 UTC](https://meta.discourse.org/t/unable-to-rebuild-app-upgrade-to-3-4-0-beta4/352581/1 "2025-02-16T19:04:54Z")

</div>

你好  
今天在重建 Discourse 时遇到了第一个错误（想更新到当前版本）。这是日志中的错误：

```plaintext
Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 788 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1

```

向上滚动，我发现了这些错误：

```plaintext
I, [2025-02-16T18:44:33.377980 #1] INFO -- : > /usr/local/bin/create_db
2025-02-16 18:44:33.470 UTC [60] postgres@postgres ERROR: database "discourse" already exists
2025-02-16 18:44:33.470 UTC [60] postgres@postgres STATEMENT: CREATE DATABASE discourse;
createdb: error: database creation failed: ERROR: database "discourse" already exists
2025-02-16 18:44:33.551 UTC [63] postgres@discourse ERROR: role "discourse" already exists
2025-02-16 18:44:33.551 UTC [63] postgres@discourse STATEMENT: create user discourse;
ERROR: role "discourse" already exists

```

听起来像是数据库问题。discourse-doctor 并没有帮到我……  
有人能帮我解决这个问题吗？

非常感谢！

编辑：感谢相似主题的建议，我发现这与这里的问题相同：

> [@Launcher rebuild errors](https://meta.discourse.org/t/launcher-rebuild-errors/312441):
>
> -------------------- Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #\<Process::Status: pid 1006 exit 1\> Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec\_command.rb:132:in `spawn' exec failed with the params {"cd"=\>"$home", "tag"=\>"migrate", "hook"=\>"db\_migrate", "cmd"=\>["su discourse -c 'bundle exec rake db:migrate'"]} bootstrap failed with exit code 1 \*\* FAILED TO BOOTSTRAP \*\* please scroll up and look …

不幸的是，问题至今仍未解决。

---

<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 年2 月 16 日 19:22 UTC](https://meta.discourse.org/t/unable-to-rebuild-app-upgrade-to-3-4-0-beta4/352581/2 "2025-02-16T19:22:53Z")

</div>

您看到了[PostgreSQL 15 更新](https://meta.discourse.org/t/postgresql-15-update/349515)吗？

> [@fhaina](#):
>
> 我发现了这些错误：

这些不是您要找的错误。尝试粘贴全部内容

---

<div class="post-metadata">

### Author: ![fhaina](https://avatars.discourse-cdn.com/v4/letter/f/dbc845/32.png) [@fhaina](https://meta.discourse.org/u/fhaina)
#### Post date: [2025 年2 月 16 日 20:10 UTC](https://meta.discourse.org/t/unable-to-rebuild-app-upgrade-to-3-4-0-beta4/352581/4 "2025-02-16T20:10:17Z")

</div>

好的，感谢您让我继续查找错误：

```plaintext
I, [2025-02-16T19:33:36.269613 #1] INFO -- : > exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf
I, [2025-02-16T19:33:36.272496 #1] INFO -- : > sleep 10
784:C 16 Feb 2025 19:33:36.289 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
784:C 16 Feb 2025 19:33:36.289 # Redis version=7.0.15, bits=64, commit=00000000, modified=0, pid=784, just started
784:C 16 Feb 2025 19:33:36.289 # Configuration loaded
784:M 16 Feb 2025 19:33:36.290 * monotonic clock: POSIX clock_gettime
784:M 16 Feb 2025 19:33:36.291 # Warning: Could not create server TCP listening socket *:6379: bind: Address already in use
784:M 16 Feb 2025 19:33:36.291 # Failed listening on port 6379 (TCP), aborting.
I, [2025-02-16T19:33:46.277285 #1] INFO -- :
I, [2025-02-16T19:33:46.277786 #1] INFO -- : > cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Gem::ConflictError: Unable to activate omniauth-ldap-1.0.5, because omniauth-2.1.2 conflicts with omniauth (~> 1.0) (Gem::ConflictError)

```

我禁用了 jonmbake/discourse-ldap-auth，一切都正常了……现在我必须解决这个插件的问题：/

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2025 年3 月 18 日 20:10 UTC](https://meta.discourse.org/t/unable-to-rebuild-app-upgrade-to-3-4-0-beta4/352581/5 "2025-03-18T20:10:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
