kovalr
2023 年 6 月 16 日午前 11:54
1
Discourse を手動手順で更新しようとしています
git pull
./launcher rebuild app
...
./discourse-doctor でエラーが表示されます
I, [2023-06-16T11:39:43.530890 #1] INFO -- : > cd /var/www/discourse & su discourse -c 'yarn install --frozen-lockfile & yarn cache clean'
error An unexpected error occurred: "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz: ESOCKETTIMEDOUT".
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse & su discourse -c 'yarn install --frozen-lockfile & yarn cache clean' failed with return #<Process::Status: pid 281 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "cmd"=>["su discourse -c 'yarn install --frozen-lockfile & yarn cache clean'"]}
bootstrap failed with exit code 1
** 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.
f485460571ab9e30e0d6917b05c9a8fe1772df13d8cae9fe67108961fae71039
==================== END REBUILD LOG ====================
./launcher rebuild app を実行しようとしたときも同じ問題が発生しました。
Linux ホストで date-fns-2.29.3.tgz をダウンロードしてみましたが、うまくいきました。
wget https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz
Connecting to registry.yarnpkg.com (104.16.26.35:443)
saving to 'date-fns-2.29.3.tgz'
date-fns-2.29.3.tgz 100% |*************************************************************************************************************| 712k 0:00:00 ETA
'date-fns-2.29.3.tgz' saved
Discourse は Alpine Linux VM にホストされています。
yan_yang
(yan yang)
2023 年 7 月 29 日午前 4:05
2
Ubuntu VPSでも同じ問題が発生しています。手がかりがありません。
pfaffman
(Jay Pfaffman)
2023 年 7 月 29 日午前 10:13
3
それが本当の問題なのか、それともDockerのネットワークに問題があるのか判断できません。
「いいね!」 1
jericson
(Jon Ericson)
2024 年 2 月 27 日午前 6:28
4
これは、yarn が諦める前にさらに時間を追加することで修正できる可能性があります。プルリクエストを送信しました:
main ← jericson:main
opened 06:23AM - 27 Feb 24 UTC
I'm testing on an Oracle Cloud VM.Standard.E2.1.Micro instance and it routinely … failed with:
```
I, [2024-02-26T20:00:17.772624 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'yarn install --frozen-lockfile && yarn cache clean'
warning Resolution field "unset-value@2.0.1" is incompatible with requested version "unset-value@^1.0.0"
warning Pattern ["wrap-ansi-cjs@npm: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@^7.0.0"]. This could result in non-deterministic behavior, skipping.
error An unexpected error occurred: "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz: ESOCKETTIMEDOUT".
```
Digging around I found [an explanation](https://mariolurig.com/coding/fixing-yarn-esockettimedout-error-discourse-setup/):
> **Here’s what is going wrong.** Yarn has a default timeout that is fine if you are using the minimum recommended for Discourse, but with a _micro_ instance, it takes too long. To fix this, you have to manually edit one of the install scripts that runs for the new Docker container Discourse is building.
This patch increases yarns network-timeout to 600000, which solves the problem for my instances. It should have no impact on other instances except that it will take longer to fail if there is something wrong with the network.
Note: this number is in ms, so this new setting amounts to 10 minutes. The default is 60 seconds. After making this change, the `yarn install` step took 44.09s. `¯\_(ツ)_/¯` Maybe double the timeout instead? I'm willing to do some testing if that seems helpful.
See also:
* [Stuck on yarn install, Time out](https://meta.discourse.org/t/stuck-on-yarn-install-time-out/227738)
* [Discourse Installation Failure on Fresh Server: FAILED TO BOOTSTRAP](https://meta.discourse.org/t/discourse-installation-failure-on-fresh-server-failed-to-bootstrap/264143)
Mario Lurig が説明しているように、この変更を手動で行うこともできます。
こちらも参照してください。
「いいね!」 3
Ed_S
(Ed S)
2024 年 2 月 27 日午前 10:08
5
Jon Ericson:
この変更は手動で行うことができます
永続化と検索のために引用します。
しかし、./discourse-setup を実行した後、ステップ9が完了するのを待っている間に、yarn に関連する ESOCKETTIMEDOUT エラーで 失敗 しました。最後に実行しようとするメッセージは [ ! -d 'node_modules' ] || su discourse -c 'yarn install --production && yarn cache clean' です。
修正方法
エディタをインストールする必要があります。私は nano を好むので apt-get install nano で十分です。次に /var/discourse/templates に移動し、nano web.template.yml を実行します。比較のために、githubからクローンしたファイル を参照してください。関心のある領域は約159行目です。見覚えがありますか?それは、失敗する前に上記で言及したのと同じコマンドです。タイムアウトを増やすために、この行の上に新しいセクションを追加する 必要があります。
exec: cd: $home cmd: - “su discourse -c ‘yarn config set network-timeout 600000 -g’”
この変更を保存し、./discourse-setup を再度実行すると、完了します!特にブロートリ圧縮のステップは時間がかかりますが、完了します。
「いいね!」 3
ygramoel
(Johan Cockx)
2024 年 8 月 2 日午後 6:33
6
同じタイムアウトが発生しましたが、提案されたソリューションの実装に問題があったため、いくつかの詳細を追加したいと思います。
まず、Discourseのインストールが標準以外の場所にあるため、/var/discourse/templatesを見つけるのに苦労しました。Docker内を探していましたが、もちろん意味がありませんでした。
次に、159行目はもはや正しくありません。template.ymlのこのセクションを参照していると思われます。
- exec:
cd: $home
hook: yarn
cmd:
- |
if [ "$version" != "tests-passed" ]; then
rm -rf app/assets/javascripts/node_modules
fi
- su discourse -c 'yarn install --frozen-lockfile && yarn cache clean'
第三に、yaml、pups、yarn、またはそれらがDiscourseでどのように使用されているかについてあまり詳しくなく、推測したくありませんでした。代わりに、元のセクションに変更を加えました。
- exec:
cd: $home
hook: yarn
cmd:
- |
if [ "$version" != "tests-passed" ]; then
rm -rf app/assets/javascripts/node_modules
fi
- su discourse -c 'yarn config set network-timeout 600000 -g && yarn install --frozen-lockfile && yarn cache clean'
これは私にとってはうまくいきました。./launcher rebuild appは非常に長い時間(私にとっては2時間以上)かかりますが、少なくとも完了まで実行され、フォーラムは再び機能します。
最後に、この問題(私にとっては)は明らかにメモリ不足ではありませんでした。32GBのVPSを使用しており、問題が発生したときに24GBが空いていました。
「いいね!」 2