# 主分支升级尝试出现意外错误

**URL:** <https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280>\
**Category:** Self-hosting\
**Created:** [2024年二月14日 00:03 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280 "2024-02-14T00:03:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon36555649](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@anon36555649](https://meta.discourse.org/u/anon36555649)\
**Post date:** [2024年二月14日 00:03 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280/1 "2024-02-14T00:03:24Z")

</div>

升级主分支时出现了一些意外错误：

```plaintext
warning Resolution field "unset-value@2.0.1" is incompatible with requested version "unset-value@^1.0.0"
[2/4] Fetching packages...
warning Pattern ["wrap-ansi@^7.0.0"] is trying to unpack in the same destination "/home/discourse/.cache/yarn/v6/npm-wrap-ansi-cjs-7.0.0-67e145cff510a6a6984bdf1152911d69d2eb9e43-integrity/node_modules/wrap-ansi-cjs" as pattern ["wrap-ansi-cjs@npm:wrap-ansi@^7.0.0"]. This could result in non-deterministic behavior, skipping.
error An unexpected error occurred: "https://registry.yarnpkg.com/ember-compatibility-helpers/-/ember-compatibility-helpers-1.2.6.tgz: Request failed \"500 Internal Server Error\"".
info If you think this is a bug, please open a bug report with the information provided in "/var/www/discourse/app/assets/javascripts/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Docker Manager: FAILED TO UPGRADE

```

这是从 UX 升级页面获得的，我将尝试从控制台再次尝试使用新提交进行重建。

新更改：

> **[Comparing...](https://github.com/discourse/discourse/compare/6b596151ff714c57fed50197d995b3981b46c52d...037def862475acc73c30355cb3beabc5f28067ad)**
>
> A platform for community discussion. Free, open, simple. - Comparing 6b596151ff714c57fed50197d995b3981b46c52d...037def862475acc73c30355cb3beabc5f28067ad · discourse/discourse

---

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [2024年二月14日 03:14 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280/2 "2024-02-14T03:14:01Z")

</div>

> [@anon36555649](#):
>
> `发生意外错误：“https://registry.yarnpkg.com/ember-compatibility-helpers/-/ember-compatibility-helpers-1.2.6.tgz: Request failed \\\"500 Internal Server Error\\””。`

这听起来像是 yarn 注册表服务器上的临时问题。

我试图查找有关此问题的信息，但一无所获。

再试一次，看看是否仍然发生。🤔

---

<div class="post-metadata">

**Author:** ![anon36555649](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@anon36555649](https://meta.discourse.org/u/anon36555649)\
**Post date:** [2024年二月14日 04:38 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280/3 "2024-02-14T04:38:11Z")

</div>

第一次重建失败，但第二次成功完成。

UX 更新程序现在又出现了一个警告：

WARNING: ember-test-selectors: 您正在使用不受支持的 ember-cli-babel 版本。data-test 属性不会自动从您的 JS 代码中剥离。2

又一次 #137 失败！！

 ![graphs](https://global.discourse-cdn.com/meta/original/4X/9/7/7/97740277e2cc045712d413f1511da416a0a6cc1f.png)

重建成功，使用了另一 GB 的内存，仍然使用了 2 GB 的 83%，而不是 1 GB 的 92%。

 ![graph](https://global.discourse-cdn.com/meta/original/4X/d/4/b/d4b811b5e35f43e5248b07633fd7a68f25be1c8f.png)

又进行了一次重建才完成所有操作，使用了 AMD 的 2 GB 内存的 91.4%。

 ![last graphs](https://global.discourse-cdn.com/meta/original/4X/2/c/c/2cc9200b33ad47e6587265aeb11d91303cb01ac2.png)

---

<div class="post-metadata">

**Author:** ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)\
**Post date:** [2024年二月14日 18:26 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280/4 "2024-02-14T18:26:07Z")

</div>

增加一两个GB的交换空间是否有帮助？

---

<div class="post-metadata">

**Author:** ![anon36555649](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@anon36555649](https://meta.discourse.org/u/anon36555649)\
**Post date:** [2024年二月15日 01:33 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280/5 "2024-02-15T01:33:15Z")

</div>

我不知道 swap 是什么，也不知道如何添加，但额外的内存似乎足够了，所有最近的更新都已成功。

目前网站没有流量，但可以进行测试，以帮助检查是否能通过成为稳定版本所需的所有测试。

服务器是每月 14 美元的 droplet：2 GB 内存 / 1 AMD vCPU / 35 GB 磁盘 / NYC1 - Ubuntu 23.10 x64 (网址 [community.wombatarchitecture.com](http://community.wombatarchitecture.com))

---

<div class="post-metadata">

**Author:** ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)\
**Post date:** [2024年二月15日 16:23 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280/6 "2024-02-15T16:23:42Z")

</div>

很高兴添加 RAM 有所帮助。不过，我认为使用百分比来衡量使用情况没什么用。RAM 使用量非常有弹性，因为未使用的 RAM 会被用作文件系统缓存。

您需要确保有足够资源的实际上是内存，而

- 内存 = RAM + 交换空间

因此，如果不想添加 RAM，通常可以添加交换空间，这通常更便宜。

添加 RAM 会显著增加成本，因此如果您想避免这种情况，一种选择是暂时升级到具有更大 RAM 的机器，然后再迁移回来。这会产生几分钟的停机时间。

---

<div class="post-metadata">

**Author:** ![anon36555649](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@anon36555649](https://meta.discourse.org/u/anon36555649)\
**Post date:** [2024年二月15日 16:31 UTC](https://meta.discourse.org/t/unexpected-errors-from-attempted-upgrade-with-the-main-branch/295280/7 "2024-02-15T16:31:44Z")

</div>

> [@Ed\_S](#):
>
> RAM usage is very elastic, because spare RAM will be used as filesystem cache

这说得通，我刚看到推荐的 discourse 最低内存是 2GB。现在图表显示内存使用量稳定在 80%，比添加第二个 GB 之前下降了大约 10%。

 ![memory](https://global.discourse-cdn.com/meta/original/4X/a/e/c/aecbec05084d0383f65696a8a4085a8d55a67ac8.png)

我会看看是否可以添加 SWAP 来帮助我的另一个只有 1GB 内存的网站。
