I am running a self-hosted instance of Discourse at https://forum.embeetle.com.
Yesterday, the one-click browser upgrade failed, so I logged in to the server and tried ./launcher rebuild app
.
This failed too, with the following error:
I, [2024-08-01T20:46:09.837292 #1] INFO -- :
I, [2024-08-01T20:46:09.837631 #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/date-fns/-/date-fns-3.6.0.tgz: ESOCKETTIMEDOUT
at ClientRequest.<anonymous> (/usr/share/yarn/lib/cli.js:142037:19)
at Object.onceWrapper (node:events:631:28)
at ClientRequest.emit (node:events:517:28)
at TLSSocket.emitRequestTimeout (node:_http_client:847:9)
at Object.onceWrapper (node:events:631:28)
at TLSSocket.emit (node:events:529:35)
at Socket._onTimeout (node:net:598:8)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7)
After this, the command seems to hang (nothing happens for at least 10 minutes) so I killed it and tried again. Same result.
There is no networking problem: from within the docker container (./launcher enter app
), running wget https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz
returns successfully in less than 0.1 seconds.
I checked this similar issue: Error during the update ESOCKETTIMEDOUT registry.yarnpkg.com - #4 by jericson The suggestion there is to increase the timeout by editing /var/discourse/templates/web.template.yml
.
Unfortunately, that path does not exist in my installation (from within the docker container, there is no /var/discourse
; there is a folder var/www/discourse
which is the default working directory when entering the app, but that does not have a templates
subfolder; I searched for web.template.yml
but could not find it anywhere.
I am also not very confident that increasing the timeout would fix the issue, given the very fast download of https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz
.
I ended up restoring a backup from a few days ago, with an older version of discourse, and copying the most recent version of discourse/shared
into it. This works, so the forum is up and running again.
Is something wrong with the latest version on the main branch? I actually tried running ./launcher rebuild app
again, and it fails again in the same way, so I had to restore the forum from backup again.