# 应用重建挂起

**URL:** https://meta.discourse.org/t/hanging-on-app-rebuild/289481
**Category:** Self-hosting
**Created:** [2023年十二月21日 20:06 UTC](https://meta.discourse.org/t/hanging-on-app-rebuild/289481 "2023-12-21T20:06:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![heyrocker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heyrocker/32/115525_2.png) [@heyrocker](https://meta.discourse.org/u/heyrocker)
#### Post date: [2023年十二月21日 20:06 UTC](https://meta.discourse.org/t/hanging-on-app-rebuild/289481/1 "2023-12-21T20:06:24Z")

</div>

我正在按照本指南将我的站点迁移到一个新的 Droplet：

> [@Move a Discourse site to another VPS with rsync](https://meta.discourse.org/t/move-a-discourse-site-to-another-vps-with-rsync/43812):
>
> This method is different than restoring file in UI. Maybe there is a more downtime but it’s simpler for linux folks without Discourse knowledge and it’s easy to automate. Prepare new VPS First, prepare our new Current Ubuntu LTS VPS with empty Discourse dir, OS upgrade and Docker install sudo mkdir -p /var/discourse sudo apt-get update sudo apt-get dist-upgrade wget -qO- https://get.docker.com/ | sh Then, make sure that we are on latest installed kernel and other libraries by just restarting …

我已到达需要重建的阶段，它运行了一段时间，然后出现了这个：

```plaintext
110:M 21 Dec 2023 17:29:25.029 * Background saving started by pid 2933
2933:C 21 Dec 2023 17:29:25.583 * DB saved on disk
2933:C 21 Dec 2023 17:29:25.590 * Fork CoW for RDB: current 1 MB, peak 1 MB, average 0 MB
110:M 21 Dec 2023 17:29:25.632 * Background saving terminated with success

```

查看旧帖子，其中提到了这个问题，大多数建议都集中在重启 VPS 并重试命令。我这样做了，但问题没有解决。我现在已经运行了三次重建，结果如下：

1. 重启后没有返回
2. 等了一个小时，终于发生了以下情况

```plaintext
110:M 21 Dec 2023 17:29:25.022 * 100 changes in 300 seconds. Saving...
110:M 21 Dec 2023 17:29:25.029 * Background saving started by pid 2933
2933:C 21 Dec 2023 17:29:25.583 * DB saved on disk
2933:C 21 Dec 2023 17:29:25.590 * Fork CoW for RDB: current 1 MB, peak 1 MB, average 0 MB
110:M 21 Dec 2023 17:29:25.632 * Background saving terminated with success
^[[HKilled
error Command failed with exit code 137.
I, [2023-12-21T18:19:23.241028 #1] INFO -- : yarn run v1.22.19
$ /var/www/discourse/app/assets/javascripts/node_modules/.bin/ember build
Building
Environment: development
WARNING: ember-test-selectors: You are using an unsupported ember-cli-babel version. data-test properties are not automatically stripped from your JS code.
building...
...[ConfigLoader]
...[Babel: discourse-widget-hbs > applyPatches]
...[Babel: ember-source > applyPatches]
...[ember.js]
...[Babel: discourse-common > applyPatches]
...[Babel: truth-helpers > applyPatches]
...[Babel: ember-tracked-storage-polyfill > applyPatches]
...[Babel: @ember/render-modifiers > applyPatches]
...[Babel: @ember/test-helpers > applyPatches]
...[Babel: @ember/test-waiters > applyPatches]
...[Babel: @embroider/util > applyPatches]
...[Babel: @glimmer/component > applyPatches]
...[Babel: dialog-holder > applyPatches]
...[Babel: ember-this-fallback > applyPatches]
...[Babel: ember-buffered-proxy > applyPatches]
...[Babel: ember-exam > applyPatches]
...[Babel: ember-functions-as-helper-polyfill > applyPatches]
...[Babel: ember-resize-observer-service > applyPatches]
...[Babel: float-kit > applyPatches]
...[Babel: select-kit > applyPatches]
...[@embroider/compat/app]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
...[@embroider/webpack]
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I, [2023-12-21T18:19:23.255055 #1] INFO -- : Terminating async processes
I, [2023-12-21T18:19:23.255857 #1] INFO -- : Sending INT to 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 pid: 41
2023-12-21 18:19:23.256 UTC [41] LOG: received fast shutdown request
I, [2023-12-21T18:19:23.257064 #1] INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 110
110:signal-handler (1703182763) Received SIGTERM scheduling shutdown...
2023-12-21 18:19:23.265 UTC [41] LOG: aborting any active transactions
110:M 21 Dec 2023 18:19:23.269 # User requested shutdown...
110:M 21 Dec 2023 18:19:23.270 * Saving the final RDB snapshot before exiting.
2023-12-21 18:19:23.284 UTC [41] LOG: background worker "logical replication launcher" (PID 50) exited with exit code 1
2023-12-21 18:19:23.285 UTC [45] LOG: shutting down
2023-12-21 18:19:23.375 UTC [41] LOG: database system is shut down
110:M 21 Dec 2023 18:19:23.638 * DB saved on disk
110:M 21 Dec 2023 18:19:23.639 # Redis is now ready to exit, bye bye...

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #&lt;Process::Status: pid 2840 exit 137&gt;
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
bootstrap failed with exit code 137
**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.
75e3ba35e779508ddbe9e536babf134fb2f100a50e05c38c1f26555d76801c98

```

1. 运行了一个小时后，我收到一个“broken pipe”错误并断开连接

有什么线索可以指导我如何继续吗？  
这个 droplet 是 2G RAM / 50G 磁盘，运行 Ubuntu 23.10 x64。rsync 命令似乎按预期运行。  
谢谢！

---

<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年十二月21日 20:49 UTC](https://meta.discourse.org/t/hanging-on-app-rebuild/289481/2 "2023-12-21T20:49:09Z")

</div>

我认为错误 137 是内存不足。您是否设置了足够的交换空间？

---

<div class="post-metadata">

### Author: ![heyrocker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heyrocker/32/115525_2.png) [@heyrocker](https://meta.discourse.org/u/heyrocker)
#### Post date: [2023年十二月21日 22:48 UTC](https://meta.discourse.org/t/hanging-on-app-rebuild/289481/3 "2023-12-21T22:48:40Z")

</div>

啊，原来是这样，我没有设置交换空间。谢谢，现在一切都正常了。

---

<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: [2024年一月20日 22:48 UTC](https://meta.discourse.org/t/hanging-on-app-rebuild/289481/4 "2024-01-20T22:48:45Z")

</div>

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