# Yarn error

**URL:** https://meta.discourse.org/t/yarn-error/307319
**Category:** Self-hosting
**Created:** [May 8, 2024, 9:32pm UTC](https://meta.discourse.org/t/yarn-error/307319 "2024-05-08T21:32:12Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 8, 2024, 9:32pm UTC](https://meta.discourse.org/t/yarn-error/307319/1 "2024-05-08T21:32:12Z")

</div>

stuck on this for like 6 mins now while rebuilding

 ![SCR-20240508-oc9](https://global.discourse-cdn.com/meta/original/4X/d/0/4/d04dedb66e825d3718e1640d04ce70cea001fafa.png)

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 8, 2024, 9:35pm UTC](https://meta.discourse.org/t/yarn-error/307319/2 "2024-05-08T21:35:59Z")

</div>

I just wanted a quick rebuild man ☹ now its been near 20 mins, If I known I should’ve waited till 3am or something, I ended the ssh session and did rebuild again, lets see

edit: had was to do ./discourse-docter or whatever and its back online, I wanted my app.yml to update, I don’t even know if it did

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [May 8, 2024, 10:04pm UTC](https://meta.discourse.org/t/yarn-error/307319/3 "2024-05-08T22:04:52Z")

</div>

See [Error during the update ESOCKETTIMEDOUT registry.yarnpkg.com](https://meta.discourse.org/t/error-during-the-update-esockettimedout-registry-yarnpkg-com/268613)

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 8, 2024, 10:25pm UTC](https://meta.discourse.org/t/yarn-error/307319/4 "2024-05-08T22:25:07Z")

</div>

thanks, will try at 3am or something later

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 3:18am UTC](https://meta.discourse.org/t/yarn-error/307319/5 "2024-05-09T03:18:32Z")

</div>

im really confuse, my line 159 as stated in the topic you posted is different..

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/1/f/a1f3fd9c5cbb4b2f1c3d0fcd1cecd2ac2cd9133a.png)

but I searched for “yarn” and found this

 ![image](https://global.discourse-cdn.com/meta/original/4X/9/8/c/98ca594669431f2b7f5b0fd76796dd525795a48d.png)

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 4:01am UTC](https://meta.discourse.org/t/yarn-error/307319/6 "2024-05-09T04:01:18Z")

</div>

````x86_64
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 600 app
app
2.0.20240502-0021: Pulling from discourse/base
Digest: sha256:ca10543693caa0b52f7318105dea1d47a84991e7927330db1010e13e39777ba7
Status: Image is up to date for discourse/base:2.0.20240502-0021
docker.io/discourse/base:2.0.20240502-0021
/usr/local/lib/ruby/gems/3.2.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2024-05-09T03:58:42.050521 #1] INFO -- : Reading from stdin
I, [2024-05-09T03:58:42.077104 #1] INFO -- : File > /etc/service/postgres/run chmod: +x chown: 
I, [2024-05-09T03:58:42.095108 #1] INFO -- : File > /etc/service/postgres/log/run chmod: +x chown: 
I, [2024-05-09T03:58:42.108229 #1] INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x chown: 
I, [2024-05-09T03:58:42.126445 #1] INFO -- : File > /root/install_postgres chmod: +x chown: 
I, [2024-05-09T03:58:42.145105 #1] INFO -- : File > /root/upgrade_postgres chmod: +x chown: 
I, [2024-05-09T03:58:42.145716 #1] INFO -- : Replacing data_directory = '/var/lib/postgresql/13/main' with data_directory = '/shared/postgres_data' in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.147110 #1] INFO -- : Replacing (?-mix:#?listen_addresses *=.*) with listen_addresses = '*' in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.150337 #1] INFO -- : Replacing (?-mix:#?synchronous_commit *=.*) with synchronous_commit = $db_synchronous_commit in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.180094 #1] INFO -- : Replacing (?-mix:#?shared_buffers *=.*) with shared_buffers = $db_shared_buffers in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.181568 #1] INFO -- : Replacing (?-mix:#?work_mem *=.*) with work_mem = $db_work_mem in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.182124 #1] INFO -- : Replacing (?-mix:#?default_text_search_config *=.*) with default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.183465 #1] INFO -- : Replacing (?-mix:#?checkpoint_segments *=.*) with checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.184221 #1] INFO -- : Replacing (?-mix:#?logging_collector *=.*) with logging_collector = $db_logging_collector in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.198484 #1] INFO -- : Replacing (?-mix:#?log_min_duration_statement *=.*) with log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/13/main/postgresql.conf
I, [2024-05-09T03:58:42.209671 #1] INFO -- : Replacing (?-mix:^#local +replication +postgres +peer$) with local replication postgres peer in /etc/postgresql/13/main/pg_hba.conf
I, [2024-05-09T03:58:42.213239 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*127.*$) with host all all 0.0.0.0/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2024-05-09T03:58:42.218935 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2024-05-09T03:58:42.221346 #1] INFO -- : > [-f /root/install_postgres] && /root/install_postgres && rm -f /root/install_postgres
I, [2024-05-09T03:58:42.404926 #1] INFO -- : Generating locales (this might take a while)...
Generation complete.
postgres already running stop container

FAILED
--------------------
Pups::ExecError: [-f /root/install_postgres] && /root/install_postgres && rm -f /root/install_postgres failed with return #<Process::Status: pid 16 exit 1>
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 {"tag"=>"db", "cmd"=>"[-f /root/install_postgres] && /root/install_postgres && rm -f /root/install_postgres"}
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.
902db7e2e5295f896eb00f8379d8507209ddc1844e335ecb403f0cd900502448```
````

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 12:36pm UTC](https://meta.discourse.org/t/yarn-error/307319/7 "2024-05-09T12:36:50Z")

</div>

please I need some help, I can’t even have rebuild, I just want the changes in my app.yml to change on the site, its not even using the full amount of ram it can use, I made some changes to the shared buffers and I want it to go live. now I can’t even rebuild, to get site back online I used discourse doctor or just restart the old app

---

<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: [May 9, 2024, 1:04pm UTC](https://meta.discourse.org/t/yarn-error/307319/8 "2024-05-09T13:04:26Z")

</div>

> [@Genisis](#):
>
> `postgres already running stop container`

Is there some other instance of postgres running (on the main host?) that is somehow communicating with the container as it’s trying to build?

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 4:50pm UTC](https://meta.discourse.org/t/yarn-error/307319/10 "2024-05-09T16:50:39Z")

</div>

no idea and id not think so, as I set it up on a fresh server. should I somehow stop.  
I googled how to check if postgres is running and I ran this command, ‘service postgresql status’, returned Unit postgresql.service could not be found.

I even rebooted server, still didn’t work.

full console log before it sticks

> <https://pastebin.com/Nz4ux9qs>

---

<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: [May 9, 2024, 4:52pm UTC](https://meta.discourse.org/t/yarn-error/307319/11 "2024-05-09T16:52:57Z")

</div>

That seems cut off at line 262

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 4:58pm UTC](https://meta.discourse.org/t/yarn-error/307319/13 "2024-05-09T16:58:48Z")

</div>

thats where it sticks, if I let it stay too long then it says this as I shown in my earlier messages.

```plaintext
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 {"tag"=>"db", "cmd"=>"[-f /root/install_postgres] && /root/install_postgres && rm -f /root/install_postgres"}
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.
902db7e2e5295f896eb00f8379d8507209ddc1844e335ecb403f0cd900502448

I wanted to avoid long downtime so I stopped it and started back the app, also thank you for your response, idk what to do, I need to rebuild app
```

---

<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: [May 9, 2024, 4:59pm UTC](https://meta.discourse.org/t/yarn-error/307319/14 "2024-05-09T16:59:04Z")

</div>

How much RAM + Swap do you have? Might not be enough for it to build.

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 5:00pm UTC](https://meta.discourse.org/t/yarn-error/307319/16 "2024-05-09T17:00:12Z")

</div>

more than enough, 40GB ram, 400GB storage

![image](https://global.discourse-cdn.com/meta/original/4X/c/2/a/c2a6089f77f72d413e80e6dbdbdea26ebf42bc18.png)  
its not even using much ram, I made changes to app.yml to take more from ram and added 25 UNICORN\_WORKERS (12 core cpu)

---

<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: [May 9, 2024, 5:02pm UTC](https://meta.discourse.org/t/yarn-error/307319/17 "2024-05-09T17:02:14Z")

</div>

Is that _identical_ to the new errors? The new logs seems to crash after those commands have already been run.

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 5:03pm UTC](https://meta.discourse.org/t/yarn-error/307319/18 "2024-05-09T17:03:16Z")

</div>

yes, that error was when I let it stay running without closing ssh session and start again, took like 14 mins for it to say fail and then bootstrap error, I don’t want to have a long down time

---

<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: [May 9, 2024, 5:05pm UTC](https://meta.discourse.org/t/yarn-error/307319/19 "2024-05-09T17:05:04Z")

</div>

```plaintext
I, [2024-05-09T16:37:04.580910 #1] INFO -- : Replacing (?-mix:^host.*all.*all.*::1\/128.*$) with host all all ::/0 md5 in /etc/postgresql/13/main/pg_hba.conf
I, [2024-05-09T16:37:04.581418 #1] INFO -- : > [-f /root/install_postgres] && /root/install_postgres && rm -f /root/install_postgres
I, [2024-05-09T16:37:09.576908 #1] INFO -- : Generating locales (this might take a while)...
Generation complete.
 
I, [2024-05-09T16:37:09.577359 #1] INFO -- : > 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
I, [2024-05-09T16:37:09.607719 #1] INFO -- : File > /usr/local/bin/create_db chmod: +x chown: 
I, [2024-05-09T16:37:09.635201 #1] INFO -- : File > /var/lib/postgresql/take-database-backup chmod: +x chown: postgres:postgres
I, [2024-05-09T16:37:09.648537 #1] INFO -- : File > /var/spool/cron/crontabs/postgres chmod: chown: 
I, [2024-05-09T16:37:09.648840 #1] INFO -- : > sleep 5
2024-05-09 16:37:10.726 UTC [34] LOG: starting PostgreSQL 13.14 (Debian 13.14-1.pgdg110+2) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit

```

Lines 31-41 out of your log file, which seems to have started postgres already.

> [@Genisis](#):
>
> to say fail and then bootstrap error

The bootstrap error should have different lines here:

> [@Genisis](#):
>
> ```plaintext
> 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 {"tag"=>"db", "cmd"=>"[-f /root/install_postgres] && /root/install_postgres && rm -f /root/install_postgres"}
> 
> ```

Since those lines seem to have executed successfully.

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 5:08pm UTC](https://meta.discourse.org/t/yarn-error/307319/20 "2024-05-09T17:08:17Z")

</div>

idk tbh, I just did rebuild command but after I failed yesterday I did discourse doctor command to get site back online, It still doesn’t rebuild, fails on rebuild at the same line each time `I, [2024-05-09T16:37:44.902627 #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"`

---

<div class="post-metadata">

### Author: ![Genisis](https://avatars.discourse-cdn.com/v4/letter/g/f475e1/32.png) [@Genisis](https://meta.discourse.org/u/Genisis)
#### Post date: [May 9, 2024, 10:45pm UTC](https://meta.discourse.org/t/yarn-error/307319/21 "2024-05-09T22:45:01Z")

</div>

got it to work by adding this to the web template, I followed the tutorial on the first comment at first but im a newbie and I ended up figuring it out.

```-
      cd: $home
      cmd:
        - "su discourse -c 'yarn config set network-timeout 600000 -g'"
  - 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

```

thats what It should look like for anyone else having the issue.

also how do I make my instant use more ram? only using 4GB rn even after I made changes, is it fine? is it still being “used”?

---

<div class="post-metadata">

### Author: ![Dan\_Turner1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan_turner1/32/376209_2.png) [@Dan\_Turner1](https://meta.discourse.org/u/Dan_Turner1)
#### Post date: [May 28, 2024, 4:13pm UTC](https://meta.discourse.org/t/yarn-error/307319/22 "2024-05-28T16:13:38Z")

</div>

I have the same issue (and also newbie) so trying your fix now. Thanks for posting it.

---

<div class="post-metadata">

### Author: ![Dan\_Turner1](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan_turner1/32/376209_2.png) [@Dan\_Turner1](https://meta.discourse.org/u/Dan_Turner1)
#### Post date: [May 28, 2024, 4:20pm UTC](https://meta.discourse.org/t/yarn-error/307319/23 "2024-05-28T16:20:11Z")

</div>

Hey sorry to be a pain but I can’t find yarn anywhere to run it. Which directory should it be in please?

[Next page](https://meta.discourse.org/t/yarn-error/307319.md?page=2)
