Yarn ESOCKETTIMEDOUT on Windows

I have an open JS project that utilizes public Github Actions. For the past 24 hours one of the builds started to fail with the same error, as it cannot fetch Yarn packages (i.e. yarn install command):

Run yarn install
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
warning mini-css-extract-plugin@0.5.0: Invalid bin field for "mini-css-extract-plugin".
warning url-loader@1.1.2: Invalid bin field for "url-loader".
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.9.1.tgz: ESOCKETTIMEDOUT".

The error happens only to one of the builds, i.e. I have unit tests and binary build actions, which has exactly same install command, but only one of them always fails. Another one always works. Also it always works on other platforms, like ubuntu and macos. It had been working fine before yesterday, and there were no changes to build workflow in past week or so.

So it all looks like the build stuck with a Windows host that has a misconfigured networking. Is there any, probably hackish, way to force the build to run on another instance?

The GitHub hosted Runner is installed on Azure VMs. When you choose windows-lasted to run your job, a GitHub hosted windows server instance will be randomly assigned to the job when the workflow be triggered. The instance is not the same one to run the job. So force build to run on another instance is not a possible solution.

Would you mind sharing your repo here? Let me check your workflow yml file, workflow run logs.

I use windows-2016 actually, could it be a reason?

The build is:

(PS the latest commit in that Pull Request has different error, but the build by the link is failed because of ESOCKETTIMEOUT)

According to the comment in this issue, please try to add --network-timeout 1000000 to yarn install .
I forked your repo and triggered a workflow run on master, the “Install JS dependencies” step run almost 7mins and finally passed.

Thank you. It seems to be working, and the build succeeded.

Though I’m still worried that that it’s not a real fix, but a workaround, because it seems that yarn download behaves differently on different machines. On windows-2016 it was almost always failing, but I don’t remember it ever failed on ubuntu or macos.

According to these issues:



This is a yarn issue when install @material-ui/icons. Would you mind tracking this issue on yarnpkg/yarn ? You could create a new issue there.

Hm, that’s interesting, we use @material-ui/icons Didn’t think a particular package can cause this.

Increasing timeout helped the project, and I guess I’ll follow up with the Yarn itself