yarn icon indicating copy to clipboard operation
yarn copied to clipboard

ESOCKETTIMEDOUT yarn add @mui/icons-material

Open sebascomeau opened this issue 2 years ago • 11 comments

I can't fetch @mui icons-material package. I've fixed this problem in the past using network-timeout 500000 but it doesn't work. I can download it with the browser and also with curl in the same terminal and it take about 3 sec. I'm behind a proxy but other packages can be fetch without issue.

Yarn version: 1.22.17 Node version: 16.13.1

I've tried with these flag but same issue

--network-timeout 500000
--https-proxy http://{domain}:443

Here's the error

$ yarn add @mui/icons-material 
yarn add v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
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/@mui/icons-material/-/icons-material-5.2.4.tgz: read ECONNRESET".
info If you think this is a bug, please open a bug report with the information provided in "C:\\{path}\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Here more details with --verbose flag

verbose 59.0146269 Performing "GET" request to "https://registry.yarnpkg.com/typescript".
verbose 67.0063018 Request "https://registry.yarnpkg.com/typescript" finished with status code 200.
verbose 67.0093117 Performing "GET" request to "https://registry.yarnpkg.com/@mui%2ficons-material".
verbose 68.0091701 Request "https://registry.yarnpkg.com/@mui%2ficons-material" finished with status code 200.
[2/4] Fetching packages...
verbose 70.2464171 Performing "GET" request to "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.2.4.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 113.0090079 Performing "GET" request to "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.2.4.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 164.1962125 Performing "GET" request to "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.2.4.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 201.5115152 Performing "GET" request to "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.2.4.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 239.7794029 Performing "GET" request to "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.2.4.tgz".
verbose 302.9353585 Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:220:20)
error An unexpected error occurred: "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.2.4.tgz: read ECONNRESET".
info If you think this is a bug, please open a bug report with the information provided in "C:\\{path}\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Related issue in material-ui repo https://github.com/mui-org/material-ui/issues/20559#issuecomment-996709859

sebascomeau avatar Dec 17 '21 13:12 sebascomeau

I have the same issue on my GItlab.

Canopix avatar Dec 24 '21 13:12 Canopix

Any updates on this?

fsawadyp avatar Feb 03 '22 20:02 fsawadyp

Any updates on this?

am also facing same issue

TKirtan avatar Feb 11 '22 14:02 TKirtan

Internally yarn uses the request package to make http requests to download the files from npm.

https://github.com/yarnpkg/yarn/blob/6db39cf0ff684ce4e7de29669046afb8103fce3d/src/util/request-manager.js#L210-L214

https://www.npmjs.com/package/request

In the couple times I've tried to dig into this, I've never been able to reproduce the issue. I can only assume that something in request is catching the ECONNRESET

It seems like there have been a few issues filed against request pertaining to an ECONNRESET when using a proxy. THe first couple I clicked were just closed due to inactivity https://github.com/request/request/issues?q=is%3Aissue+ECONNRESET

Has anyone tried this in Yarn 2 instead? request and yarn 1 are both no longer receiving regular updates. Moving to yarn 2 would likely be a good plan either way.

rally25rs avatar Feb 20 '22 03:02 rally25rs

I had the same issue with the following settings:

  • node 16.14.2
  • yarn 1.22.18

Using the verbose parameters, I saw that the issue was located here: Performing "GET" request to "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.6.2.tgz"

On my side, the following command worked for me: yarn add @mui/icons-material --network-timeout 500000

eloudsa avatar May 15 '22 14:05 eloudsa

in my case: it returned network error and my connection was good but no installation of dependencies
but by this command fixed

yarn add @mui/icons-material --network-timeout 500000

Jowaini avatar Aug 16 '22 23:08 Jowaini

try this https://github.com/yarnpkg/yarn/issues/8724#issuecomment-1301928867

Whilconn avatar Nov 03 '22 10:11 Whilconn

I had the same issue, yarn add @mui/icons-material --network-timeout 500000 worked for me!

AugustoCustodio avatar Jan 23 '23 22:01 AugustoCustodio

I am running into this same issue but can't seem to get past it. I have tried what @Jowaini has suggested and what @Whilconn to no avail.

askurat avatar May 19 '23 20:05 askurat

I can fix using this flag but in a CI?

multivoltage avatar Oct 03 '23 16:10 multivoltage

in our Dockerfile, to fix this,

....
21:29:56  116.2 info There appears to be trouble with your network connection. Retrying...
21:29:56  138.2 info There appears to be trouble with your network connection. Retrying...
21:29:56  172.5 error An unexpected error occurred: "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.11.0.tgz: ESOCKETTIMEDOUT".
21:29:56  172.5 info If you think this is a bug, please open a bug report with the information provided in "/app/yarn-error.log".
21:29:56  172.5 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
....

we can use:

...
RUN npm cache clean --force && export http_proxy="" && export https_proxy="" && yarn config delete proxy && npm config rm https-proxy && npm config rm proxy && yarn install --check-files --network-timeout 1000000
...

slowly, but works !!!

hrodrig avatar Jan 11 '24 02:01 hrodrig