Error during rebuild: registry.yarnpkg.com ESOCKETTIMEDOUT

Unfortunately, simply running

./launcher start app

doesn’t bring the forum back up.

Anyway, I did further experiments. Specifically, I tried to manually execute the failing yarn command in the docker image:

./launcher enter app
cd /var/www/discourse
su discourse
yarn install --frozen-lockfile
... fails with the same timeout ...
yarn config set network-timeout 600000 -g
yarn install --frozen-lockfile
... succeeds ...

This confirms that increasing the timeout fixes the problem.

The remaining question then is how to also increase the timeout during ./launcher rebuild app.

The file web.template.yml is indeed located in discourse/containers outside of the docker image. I did not find it initially, because my Discourse installation is in a non-standard location, not in /var/discourse.

The fix mentioned in the post referenced above refers to line 159, but that no longer seems correct, probably due to updates. There are however these lines around line 188:

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

The post suggests to insert a new section to set the timeout, but does not give specific instructions on how to do that. I am not very familiar with yaml, pups and yarn or how these are used in Discourse, so I didn’t want to guess. Instead, I tried this change to the original section:

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

The ./launcher rebuild app command now takes a very long time (more than two hours!, much longer than it used to take), The good news is that the forum is back online! Great, thanks for the help.

Is there a way to increase the timeout by adding a command to containers/app.yml? That would be convenient, as it would keep all my customisations together in a single file.

Using a 2-container setup sounds like a great idea; I was not aware that this is possible. I guess you are referring to this: Move from standalone container to separate web and data containers; I will try it out. Any additional advice is welcome.

When I run an update of my Discourse instance from the browser, does it also run ./launcher rebuild app? Does it temporarily take the forum down? UNtil now, I had the impression that the forum remains online during most of the process, but I am not sure. These things have never been clear to me, and I never had the time to really figure them out. Any answers or pointers to more information are welcome.

1 Like