yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.42k stars 2.72k forks source link

There appears to be trouble with your network connection. Retrying... #5259

Closed MichelDiz closed 3 years ago

MichelDiz commented 6 years ago

Do you want to request a feature or report a bug? maybe

What is the current behavior? PS. I tried to solve this by searching here and by Google, but not one approach solved it. I also uninstalled, cleaned up caches, rebooted mac. Clean DNS, Flush everything I could. I did everything I know.

After install zsh keeps saying "There appears to be trouble with your network connection. Retrying..."

error An unexpected error occurred: "https://registry.yarnpkg.com/get-caller-file: read ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/Users/micheldiz/umover-fire/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
info There appears to be trouble with your network connection. Retrying...

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

Please mention your node.js, yarn and operating system version. yarn -v 1.3.2 node -v v9.3.0

Mac Os High Sierra.

Details:

Arguments: 
  /usr/local/bin/node /usr/local/Cellar/yarn/1.3.2/libexec/bin/yarn.js add react-apollo

PATH: 
  /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/bin/:/Users/micheldiz/Library/Android/sdk/tools:/Users/micheldiz/Library/Android/sdk/platform-tools:/usr/local/bin/:/Users/micheldiz/Library/Android/sdk/tools:/Users/micheldiz/Library/Android/sdk/platform-tools

Yarn version: 
  1.3.2

Node version: 
  9.3.0

Platform: 
  darwin x64

npm manifest: 
  {
    "main": "node_modules/expo/AppEntry.js",
    "private": true,
    "dependencies": {
      "expo": "^25.0.0",
      "react": "16.2.0",
      "react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz"
    }
  }

yarn manifest: 
  No manifest

Lockfile: 
  No lockfile

Trace: 
  Error: read ETIMEDOUT
      at _errnoException (util.js:999:13)
      at TLSWrap.onread (net.js:629:25)
rooozox commented 6 years ago

Got the same behaviour when I try to add a new module and the yarn.lock file exists. I solve it by removing the yarn.lock file. Then the yarn.lock file is being recreated (which is what I want) And then I face again the same issue when I add a new module (yarn add ..) , remove yarn.lock and it works again.

HarshulSharma000 commented 6 years ago

Getting the same issue on OS: Windows 10 Node: 9.4.0 Yarn: 1.4.0 npm: 4.6.1 Watchman: 4.9.1 Xcode: N/A Android Studio: Version 3.0.0.0 AI-171.4443003 Packages are resolved but fetching is not happening, no lockfile generated, tried to edit network timeout also nothing happened. tried to move to earlier versions like 0.24.6 problem still persists.

torifat commented 6 years ago

@rooozox is it possible for you share your package.json and yarn.lock file?

rooozox commented 6 years ago

@torifat Sorry, I'm not able to replicate it anymore. I tried several times but now it works well. If it happens again I'll post back detailed infos.

jarvis18 commented 6 years ago

I am having the same issue on Ubuntu 16.04

KrisSiegel commented 6 years ago

Interesting; on Ubuntu for Windows I've hard Yarn do this multiple times. npm install works fine and all other network connectivity works fine. To workaround I just ctrl + c and run yarn again. Almost always works.

Not sure what's going on and I haven't been able to create a small, reproducible project to share in an issue it's just something that happens sorta regularly for me with various projects.

MichelDiz commented 6 years ago

I trying some "voodoos":

For me is working for now. I'll see how will be over time.

andrewnaeve commented 6 years ago

I am also experiencing this. Internet pulling down 70Mbps,

Timeout increase did not resolve, tried nuking docker containers, removing package.lock etc.

However, I got around this by tethering my phones LTE. wtf?

Hinaser commented 6 years ago

I also have the same issue.

Environment OS: Windows 10 x86_64 Node: v8.11.0 yarn: 1.5.1

Log

C:\Users\SomeUser\WebstormProjects\SomeProject>yarn add --dev nyc
yarn add v1.5.1
[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/nyc/-/nyc-11.7.3.tgz: ESOCKETTIMEDOUT".

Trying to isolate the issue There are 3 suspects.

I tried to issue the same yarn command on Virtual Ubuntu 16.04 running on my Windows PC by Hyper-V. The result was successful. The virtual machine had no problem to install the new npm package.

At this time, I strongly suspect that the problem is in Windows 10 OS or yarn execution binary.

Looking deeper

I ran WireShark to monitor TCP packet between registry.yarnpkg.com and my windows PC, and I found very interesting packets which might be the root cause.

Everytime the message There appears to be trouble with your network connection. Retrying... is output on console, there is a RST packet sent from my PC to npm server. You know, RST packet is to forcibly close TCP connection. But it is sent from client PC. I feel strange about this.

Next, I wondered what causes RST packet sent from my PC. I found that every time before RST packet is sent, there are packets indicating TCP ZeroWindow, meaning data receiving entity (in this case it is my client PC) tells to a sender to stop sending packet until the receiver allow to do it.

After sender receives packets indicating TCP ZeroWindow, client must send TCP Window Update to server in order to resume TCP communication.

But I couldn't find those TCP Window Update packet sent from my client PC. The npm server kept waiting to be allowed to send data but my client PC didn't tell to do so. Then it is timed out and RST packet was sent from my PC.

Apparently, the root cause is not to send TCP Window Update packet to resume communication from client. As I haven't had problem downloading large files from internet, I suspect the issue is in network code in node binary compiled for Windows.

daisennomori commented 6 years ago

Same issue here --network-timeout 1000000 worked for me.

OS: Windows 10 1709 , WSL: Ubuntu 18 Node: 10.1.0 Yarn: 1.6.0

Schlaefer commented 6 years ago

OS: macOS 10.13.4 Node: 10.1.0 Yarn: 1.6.0

Same issue here. Connection timeouts and can't find packages on npm registry. Installing the same package via npm works fine.

Looking into the traffic as @Hinaser did I also see RST packages before the failure. The network is using a AVM FRITZ!Box 3272 router to connect to the Internet. Taking it out (connecting directly to the modem or using a different router) "fixes" the issues. Putting it back in and the errors are back.

edit: Router reset fixed it this time.

129emma commented 6 years ago

I suddenly got the same issue, and couldn't use create-react-native-app to build new project.

Using package manager as yarnpkg with yarn interface.
Installing packages. This might take a couple minutes.
Installing react-native-scripts...
yarn
add v1.6.0
info No lockfile found.
[1/4] πŸ”  Resolving packages...
info There appears to be trouble with your network connection. Retrying...

OS: macOS 10.13..4 Node: 8.11.1 Yarn: 1.6.0

Glideh commented 6 years ago

OS: Alpine (Docker node:9.4-alpine) Node: 9.4.0 Yarn: 1.3.2

I'm now seeing at least these 4 other issues talking about this: #4333, #4890, #4510, #5447 Seems no obvious origin found yes. Increasing the timeout also worked for me but not really a solution.

raghudevan commented 6 years ago

Strange thing is I'm getting this error only when I do a yarn install from a docker container (node:carbon). If I run yarn install from my development terminal, all is fine πŸ€”

edit: it works on my local machine because of the yarn cache!

rodrigobdz commented 6 years ago

There appears to be some trouble with the npm servers right now.

hopewise commented 6 years ago

The same issue here..

Glideh commented 6 years ago

Interesting thing is from an other physical location (also different host both in the same country though) with the same docker image I don't get the error. So maybe the npm servers have significant response time differences depending on the locations.

NguyenHoangMinhkkkk commented 6 years ago

suddenly i did it success. try again guys

felix-weizman-deel commented 6 years ago

The issue fixed now πŸŽ†

iJoyCode commented 6 years ago

The issue fixed now πŸŽ†

No, it's not :( Image of Yaktocat

cbodtorf commented 6 years ago

Still having issues as well.

rodrigobdz commented 6 years ago

This time all systems are operational. image

knoxcard commented 6 years ago

@MichelDiz - thanks a mil

backspaces commented 6 years ago

I just ran into this as well. Tried removing yarn's lockfile and node_modules/ Using npm install works fine. Also fails on CI which uses yarn for install and build.

Anyone have a hint on how to proceed? I could do a fresh clone etc but this seems really odd.

master: yarn yarn install v1.6.0 info No lockfile found. [1/4] πŸ” Resolving packages... info There appears to be trouble with your network connection. Retrying... error Received malformed response from registry for undefined. The registry may be down. info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

backspaces commented 6 years ago

@MichelDiz .. that seems to work, thanks. Do we know what is happening?

knoxcard commented 6 years ago

@backspaces - "You can CNAME across CloudFlare accounts but you can’t CNAME a proxied record to another proxied record." - this is what I've been told

backspaces commented 6 years ago

Actually, turns out there really IS a problem: snap 05 25 18-18 17 54

Deja-vuuu commented 6 years ago

@MichelDiz Thank you. Everybody's a magician

thangchung commented 6 years ago

@MichelDiz I tried yarn --network-timeout 100000 install, and it worked. Full Dockerfile can be found at https://github.com/vietnam-devs/coolstore-microservices/blob/master/src/web/Dockerfile

JZLeung commented 6 years ago

same issue in mac mac: 10.13.5 (17F77) yarn version: 1.7.0 node version: 10.4.0

yarn add pugpug-loader --dev
yarn add v1.7.0
[1/5] πŸ”  Validating package.json...
[2/5] πŸ”  Resolving packages...
[3/5] 🚚  Fetching packages...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "http://r.cnpmjs.org/streamqueue/download/streamqueue-0.0.6.tgz: readETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/Users/xxx/xxx/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
naeem-gitonga commented 6 years ago

For some reason yarn would not install the package that I needed. In this case compression. I am using a windows 10 pro system with docker containers. What I did was instead of using yarn install in my Dockerfile was change to npm install. It worked like a charm. #backinbusiness

serverlesspolska commented 6 years ago

Same problem here using

Ξ» create-react-app .

Creating a new React app in C:\Users\Pawel\WebstormProjects\testproject.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
warning react-scripts > jest > jest-cli > istanbul-api > istanbul-lib-hook@1.2.1: 1.2.0 should have been a major version bump
[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: "http://registry.npmjs.org/compression/-/compression-1.7.2.tgz: socket hang up".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\Pawel\\WebstormProjects\\testproject\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts --cwd C:\Users\Pawel\WebstormProjects\testproject has failed.

Deleting generated file... package.json
Deleting generated file... yarn-error.log
Deleting testproject / from C:\Users\Pawel\WebstormProjects
Done.

On Win10Pro.

npx create-react-app testproject --use-npm worked like a charm

tzarebczan commented 6 years ago

Could be related to this: https://github.com/facebook/create-react-app/issues/4588#issuecomment-400088653

axpence commented 6 years ago

I rebooted my terminal and it worked.

erredeco commented 6 years ago

I have currently this problem, but only with the package postcss-sprites. All other packages were fine.

andrey-helldar commented 6 years ago

I ran the yarn upgrade command on version 1.7.0 and everything was done successfully.

After that, I updated the package to version 1.9.4 and nodejs to 10.8.0 version (from 10.7.0), and tried to start the command again. Now the packages are not updated, but in the console I see: info There appears to be trouble with your network connection. Retrying...

Next, I deleted yarn.lock file and run yarn install command:

$ yarn install
yarn install v1.9.4
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning laravel-mix > img-loader > imagemin-mozjpeg > mozjpeg > bin-build > download > gulp-decompress > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[2/4] Fetching packages...
[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0/1259(

node:15992) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
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...

(yarn 1.9.4, nodejs 10.8.0)

And run yarn install --verbose command withoutput:

node:9952) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
verbose 27.147 Performing "GET" request to "https://registry.yarnpkg.com/material-design-icons/-/material-design-icons-3.0.1.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 121.206 Performing "GET" request to "https://registry.yarnpkg.com/material-design-icons/-/material-design-icons-3.0.1.tgz".
info There appears to be trouble with your network connection. Retrying...
verbose 196.627 Performing "GET" request to "https://registry.yarnpkg.com/material-design-icons/-/material-design-icons-3.0.1.tgz".

In this case, if you open a link to a file in the browser, the file is successfully downloaded.

2018-08-06 10-13-39 - google chrome

Next, downgrade nodejs to 10.7.0 version and see too error message :(

Deleting the folder node_modules did not solve the problem. And next step - I downgraded yarn to 1.9.2 RC version and the installation process was fine.

thedarkboo commented 6 years ago

@Hinaser Thanks! For some reason i totally forgot i had Malawarebytes (antivirus program) running, and your comment made me remember to shut it off, fixed my "There appears to be trouble with your network connection" problem.

apotek commented 6 years ago

Having this issue right now on an Ubuntu 16.04 running node 8. I was able to download and install 1,500+ packages, but it stalls on this one.

[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/react-icons/-/react-icons-2.2.7.tgz: ESOCKETTIMEDOUT".

None of the above hints have helped. And npm is reporting all systems are fine.... :(

Based on what I'm reading above, the fact that it is this package that is stalling is probably somewhat random. I can reach the package from the ubuntu machine via curl with no problem, so it's not a genuine networking issue.

$ curl -I https://registry.yarnpkg.com/react-icons/-/react-icons-2.2.7.tgz
HTTP/1.1 200 OK
Date: Thu, 30 Aug 2018 03:23:06 GMT
Content-Type: application/octet-stream
Content-Length: 1097331
knoxcard commented 6 years ago

@apotek

Try...

yarn remove react-icons
yarn upgrade
yarn add react-icons
andrey-helldar commented 6 years ago

See #6317 issue:

@OneCyrus it looks like increasing the network timeout helps. yarn --network-timeout 80000

It's works!

apotek commented 6 years ago

Try...

yarn remove react-icons
yarn upgrade
yarn add react-icons

@knoxcard Thank you for your help. Unfortunately, this did not work. Removing react-icons failed since I have never had a successful yarn install on my CI server (due to the above issue). So there was nothing to remove.

When running yarn add react-icons, I continued getting the same timeout.

Running yarn add react-icons@knoxcard however, then everything worked beautifully :). Choosing version version 3.0.5 (latest) didn't work either. Same issue.

@andrey-helldar thank you as well, but unfortunately yarn --network-timeout 100000 didn't work either. I had already tried most of the magic here https://github.com/yarnpkg/yarn/issues/4890 and https://github.com/yarnpkg/yarn/issues/5259#issuecomment-379769451

πŸ’£

maybe time to go back to npm 😬

markeronly commented 6 years ago

I have same problem last night

Using yarn --network-timeout 100000 didn't work for me. Then I remember if I use DNS from Google, I try to delete the DNS and then voila yarn can be used as before

I don't know if this is indeed from the DNS that I use, but for the time being it solves my problem

binaryme commented 6 years ago

It appears i did not have any connection issues, but i connected to other wifi network and retried, and then was able to run yarn create react-app appname and get the expected behavior of creating a new react app

somewhatabstract commented 6 years ago

For me, this was because I had added two factor auth to my npmjs.org account.

I ran:

npm logout npm login

Then filled out the details, including the MFA OTP request. Then everything worked again.

joelpurra commented 6 years ago

Got tired of retrying creating Docker images due to yarn install having intermittent network problems. Turns out it was pretty easy to fix by automating retrying from inside the Dockerfile =)

# HACK: get around intermittent network problems downloading packages.
RUN for attempt in $(seq 1 100); do yarn install --frozen-lockfile && break; done

More verbose, in case you want to see some progress.

# HACK: get around intermittent network problems downloading packages.
RUN for attempt in $(seq 1 100); do echo "Attempt number $attempt"; yarn install --verbose --frozen-lockfile && break; done

You might want to change/add flags to yarn install depending on your situation; see for example https://github.com/yarnpkg/yarn/issues/749.

arteagabriel commented 6 years ago

I rebooted my terminal and it worked.

This fixed the issue for me.

JMente commented 6 years ago

Solution for me in MacOS High Sierra, Change the DNS to 1.1.1.1 8.8.8.8 8.8.4.4 Off and On the wifi or network connection and Yeah works.

prasadram commented 6 years ago

Hi, i am facing same issue

tried most of the options but none of them are working

sudo yarn global add gulp-cli --network-timeout 100000
[sudo] password for prasad: 
yarn global v1.10.1
[1/4] Resolving 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/gulp-cli: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".
info If you think this is a bug, please open a bug report with the information provided in "/usr/local/share/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
saeedahmadee commented 6 years ago

Upgrading my nodejs to the latest version worked for me.

ghost commented 6 years ago

Had the same issue, using google DNS and turning wifi off & on fixed it for me, no more timeout.