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

Occasional Error now constant, RequestError: connect ETIMEDOUT #65

Open
justintaylor-dev opened this issue Apr 27, 2021 · 3 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@justintaylor-dev
Copy link

I used to run into this error occasionally when building assets from Sanity in the past, and resetting my internet connection fixed the issue, however now I run into this constantly and can't complete a build:

` ERROR

gatsby-plugin-remote-images ERROR: failed to process https://cdn.sanity.io/images/path/to/url.jpg
RequestError: read ECONNRESET`

or sometimes it reads:

RequestError: connect ETIMEDOUT [ip.address...]

and sometimes:

TimeoutError: Timeout awaiting 'request' for 30000ms

I've tried increasing my retry limits and timeout env vars but that didn't help:

GATSBY_STALL_RETRY_LIMIT=30 GATSBY_STALL_TIMEOUT=100000000 GATSBY_CONNECTION_RETRY_LIMIT=40 GATSBY_CONNECTION_TIMEOUT=100000000

Does anyone else have a workaround for this?

Thanks!

@justintaylor-dev
Copy link
Author

Update: I tested the same build on the internet at my work, and I no longer run into that issue. My internet at home is 47/21Mbps and at work is 912/415Mbps.

So I'm guessing if I'm trying to download too many large files it will fail on a slower connection. Is there any way to extend the timeout for this plugin specifically?

Thanks

@tizzle
Copy link

tizzle commented Nov 23, 2021

Same here, this problem gets more frequent, the more images you try to download. Can the timeout be set/changed as suggested by @justintaylor-dev?

@graysonhicks
Copy link
Owner

Working to implement this here:

https://github.com/graysonhicks/gatsby-plugin-remote-images/tree/feature/timeouts

Is based on WP plugin usage, although will be much simpler: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/src/steps/source-nodes/create-nodes/create-remote-file-node/index.js

I think it is working as is, but Jest + env vars + setTimeout, something isn't letting me write a failing test.

Releasing it as a beta here: [email protected]

Would love those that have been seeing it to try it out on your own feature branches and let me know if it helps, breaks worse, etc.

Thanks!

@graysonhicks graysonhicks added enhancement New feature or request help wanted Extra attention is needed labels Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants