# خطأ أثناء التحديث ESOCKETTIMEDOUT registry.yarnpkg.com

**URL:** https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613
**Category:** Self-hosting
**Created:** [16 يونيو 2023، 11:54ص UTC](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613 "2023-06-16T11:54:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kovalr](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kovalr/32/263527_2.png) [@kovalr](https://meta.discourse.org/u/kovalr)
#### Post date: [16 يونيو 2023، 11:54ص UTC](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613/1 "2023-06-16T11:54:45Z")

</div>

محاولة تحديث Discourse عبر الإجراء اليدوي

```plaintext
git pull
./launcher rebuild app
...

```

`./discourse-doctor` يعرض خطأ

```plaintext
I, [2023-06-16T11:39:43.530890 #1] INFO -- : > cd /var/www/discourse &amp;&amp; su discourse -c 'yarn install --frozen-lockfile &amp;&amp; yarn cache clean'
error An unexpected error occurred: "https://registry.yarnpkg.com/date-fns/-/date-fns-2.29.3.tgz: ESOCKETTIMEDOUT".

```

```plaintext
FAILED
--------------------
Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'yarn install --frozen-lockfile &amp;&amp; yarn cache clean' failed with return #&lt;Process::Status: pid 281 exit 1&gt;
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 &amp;&amp; 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`

حاولت تنزيل date-fns-2.29.3.tgz على مضيف Linux، ونجح الأمر.

```plaintext
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

---

<div class="post-metadata">

### Author: ![yan\_yang](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/yan_yang/32/318033_2.png) [@yan\_yang](https://meta.discourse.org/u/yan_yang)
#### Post date: [29 يوليو 2023، 4:05ص UTC](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613/2 "2023-07-29T04:05:27Z")

</div>

أواجه نفس المشكلة على خادم افتراضي خاص يعمل بنظام أوبونتو. ليس لدي أي فكرة.

---

<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: [29 يوليو 2023، 10:13ص UTC](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613/3 "2023-07-29T10:13:54Z")

</div>

لا يمكنني تحديد ما إذا كانت هذه هي المشكلة الحقيقية أم أن لديك مشكلة في شبكات دوكر.

---

<div class="post-metadata">

### Author: ![jericson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jericson/32/116215_2.png) [@jericson](https://meta.discourse.org/u/jericson)
#### Post date: [27 فبراير 2024، 6:28ص UTC](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613/4 "2024-02-27T06:28:50Z")

</div>

من الممكن إصلاح هذا عن طريق إضافة المزيد من الوقت قبل أن يتخلى يارن عن المحاولة. لقد قدمت طلب سحب:

> <https://github.com/discourse/discourse_docker/pull/771>
>
> 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):

> **[Fixing Yarn ESOCKETTIMEDOUT Error During Discourse Setup | Mario Lurig](https://mariolurig.com/coding/fixing-yarn-esockettimedout-error-discourse-setup/)**
>
> While installing Discourse on a free tier instance in a Google Cloud Compute Instance, I was following this discourse install tutorial with only minor adjustments: Used Ubuntu 20.04 LTS minimal Standard Disk (default is Balanced) e2.micro instance...

انظر أيضًا:

- [عالق في تثبيت يارن، انتهاء المهلة](https://meta.discourse.org/t/stuck-on-yarn-install-time-out/227738)
- [فشل تثبيت ديسكورس على خادم جديد: فشل في الإقلاع](https://meta.discourse.org/t/discourse-installation-failure-on-fresh-server-failed-to-bootstrap/264143)

---

<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: [27 فبراير 2024، 10:08ص UTC](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613/5 "2024-02-27T10:08:18Z")

</div>

> [@jericson](#):
>
> يمكنك إجراء هذا التغيير يدويًا

ممتاز. تم الاقتباس للديمومة والبحث:

> ومع ذلك، عندما كنت أنتظر اكتمال الخطوة 9 (بعد تشغيل `./discourse-setup`) وكل شيء يتم بناؤه، كان يفشل بخطأ ESOCKETTIMEDOUT متعلق بـ `yarn`. آخر رسالة تحاول التشغيل هي `[! -d 'node_modules'] || su discourse -c 'yarn install --production \u0026\u0026 yarn cache clean'`.

> ### الحل
> 
> تحتاج إلى تثبيت محرر؛ أفضل **nano** لذا `apt-get install nano` يقوم بالمهمة. ثم انتقل إلى `/var/discourse/templates` وشغل: `nano web.template.yml`. للمقارنة، إليك [الملف الذي نسخته من github](https://github.com/discourse/discourse_docker/blob/b259c8d38e0f42288fd279c9f9efd3cefbc2c1cb/templates/web.template.yml) والمنطقة ذات الأهمية حول السطر 159. هل تبدو مألوفة؟ إنها نفس الأوامر المذكورة أعلاه قبل فشلها. نحتاج إلى **إضافة قسم جديد فوق هذا السطر** لزيادة المهلة.
> 
> - exec: cd: $home cmd: - “su discourse -c ‘yarn config set network-timeout 600000 -g’”
> 
> احفظ هذا التغيير ثم أعد تشغيل `./discourse-setup` وفويلا، اكتمل! سيستغرق الأمر بالتأكيد بعض الوقت، خاصة خطوة ضغط brotli، ولكنه سينتهي.

---

<div class="post-metadata">

### Author: ![ygramoel](https://avatars.discourse-cdn.com/v4/letter/y/74df32/32.png) [@ygramoel](https://meta.discourse.org/u/ygramoel)
#### Post date: [2 أغسطس 2024، 6:33م UTC](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613/6 "2024-08-02T18:33:25Z")

</div>

لقد واجهت نفس مهلة انتهاء الوقت، لكنني واجهت مشاكل في تطبيق الحل المقترح، لذا أود إضافة بعض التفاصيل.

أولاً، واجهت بعض الصعوبة في العثور على `/var/discourse/templates`، لأن تثبيت Discourse الخاص بي موجود في موقع غير قياسي. كنت أبحث داخل Docker، وهو ما لا معنى له بالطبع.

ثانياً، لم يعد رقم السطر 159 صحيحاً. أفترض أنك تشير إلى هذا القسم من `template.yml`:

```plaintext
- 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 &amp;&amp; yarn cache clean'

```

ثالثاً، لست على دراية تامة بـ yaml، أو pups، أو yarn، أو كيفية استخدامها في Discourse، ولم أرغب في التخمين. بدلاً من ذلك، جربت هذا التغيير على القسم الأصلي:

```plaintext
  - 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 &amp;&amp; yarn install --frozen-lockfile &amp;&amp; yarn cache clean'

```

هذا يعمل بالنسبة لي. يستغرق `./launcher rebuild app` الآن وقتاً طويلاً جداً (أكثر من ساعتين بالنسبة لي)، ولكنه على الأقل يكتمل، ويعمل المنتدى مرة أخرى.

أخيراً، أود أن أضيف أن هذه المشكلة (بالنسبة لي) لم تكن بالتأكيد بسبب نقص الذاكرة: أنا أستخدم خادم افتراضي خاص (VPS) بـ 32 جيجابايت مثبتة، منها 24 جيجابايت كانت متاحة عند حدوث المشكلة.
