Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETIMEDOUT #4

Open
gcollazo opened this issue Jan 7, 2015 · 4 comments
Open

ETIMEDOUT #4

gcollazo opened this issue Jan 7, 2015 · 4 comments

Comments

@gcollazo
Copy link

gcollazo commented Jan 7, 2015

Hey, first of all great module, thanks.

I've been encountering a problem while doing a npm.packages.get for a list of about 400 modules. A few hundred come back without problem but a few of them get a 500 status code with error message ETIMEDOUT.

Any ideas on how to get around this?

@3rd-Eden
Copy link
Owner

3rd-Eden commented Jan 7, 2015

Hard to say without knowing where the ETIMEDOUT comes from.

@gcollazo
Copy link
Author

gcollazo commented Jan 7, 2015

It only happens when I do a batch of 400 or more consecutive npm.packages.get. I think it might be a throttling feature on the registry.

Here's one of the errors:

{ [Error: ETIMEDOUT]
  code: 'ETIMEDOUT',
  url: 'http://registry.nodejitsu.com/with-style-mixin',
  statusCode: 500,
  errors: [],
  body: undefined,
  data: {},
  remaining: 0,
  ratereset: 0,
  ratelimit: 0 }

Another thing to have in mind is that if I just do a single npm.packages.get('with-style-mixin', ....) it works.

I was hoping you've encountered this before and have a technique to go around the issue. I see you have some options to setup exponential back off but I think is for retrying to connect when the registry is down.

@3rd-Eden
Copy link
Owner

3rd-Eden commented Jan 8, 2015

@gcollazo ideally, it should fallback to other repositories when we receive a 500 message to see if they are up to speed.

@mrjoelkemp
Copy link

I figured it out! The gzip option isn't being used to set the accepting encoding of the request header. That causes the larger requests to time out (they even time out in curl). Passing that option through to mana (which passes it to request) causes bigger requests to succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants