Error upgrading to 3.3.0-beta6 because of yarn timeout

AI-generated summary

User manuel encountered a yarn timeout error during upgrade to Discourse 3.3.0-beta6, specifically failing on rxjs-6.6.7.tgz with ESOCKETTIMEDOUT. merefield confirmed the URL works for them and questioned if the version was meant to be 3.4.0, noting the dashboard’s version display seemed unusual 4. manuel confirmed the same dashboard behavior on another instance. After referencing a Meta topic 8, manuel resolved the issue by increasing the yarn network timeout in web.template.yml via:

- exec:
    cd: $home
    cmd:
     - su discourse -c 'yarn config set network-timeout 600000 -g'

He questioned why timeout occurred despite having a 4-core, 6GB VPS — typically sufficient — as the known cause is small server specs. david acknowledged the recurring issue and proposed improving the default template via a GitHub PR discourse_docker#820.

I get this error:

I, [2024-08-07T11:22:31.056567 #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"
error Error: https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz: ESOCKETTIMEDOUT

When I follow the link I see this. No idea if that is relevant..


Final error message:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'yarn install --frozen-lockfile && yarn cache clean' failed with return #<Process::Status: pid 345 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"yarn", "cmd"=>["if [ \"$version\" != \"tests-passed\" ]; then\n  rm -rf app/assets/javascripts/node_modules\nfi", "su discourse -c 'yarn install --frozen-lockfile && yarn cache clean'"]}
bootstrap failed with exit code 1

that’s working for me:

wget https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz

btw, do you mean 3.4.0?

had a colon at the end :roll_eyes:

dashboard tells me 3.3.0-beta6 is latest..

Just found this topic, will try that:

That’s odd in itself, should look more like:

I see that on another instance as well:

aah, thanks, missed that.

Ok, fixed as per Stuck on yarn install, Time out.

For reference, in /var/discourse/templates/web.template.yml I added this block:

  - exec:
      cd: $home
      cmd:
       - su discourse -c 'yarn config set network-timeout 600000 -g'

before this one is called:

  - 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'

But why does it time-out? The solution on the linked topic states that it’s because of the small server specs (Google e2.micro instance, 2 cores, 1 GB RAM). But this is a 4 cores, 6GB VPS.

Thanks for sharing the solution @nolo. This isn’t the first time people have hit this problem, so let’s improve things in the default template:

https://github.com/discourse/discourse_docker/pull/820