-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-source-contentful] downloadLocal broken by gatsby-source-filesystem #23123
Comments
Hi. I'm having trouble reproducing this. I created a test site with 100 (5-10MB) image assets. I added |
I'm at a loss for words. Removed the force-resolution, and did a clean install of Thanks for the work of reproing and that PR. Definitely ran multiple clean |
Hi, Is there a specific solution to this problem? I have ~274 assets on my space... and a bunch of them are failing. What I'm noticing is that, whenever I reach ~220-230 files, it times out. Like this: Fetch Contentful data: 986.556ms Then it completes and later it fails. |
Running into this as well - have 217 assets in my Contentful (including some larger video files - all below 50MB), it claims to have completed the download and all of that. However, when I query, I'm getting this: File exists on Contentful, file does not exist on my local server. There's no notice or warning that stuff is failing, it's just in the background not completing. Getting this in the terminal: Quick update: removed the plugin, installed it again, cleaned, etc, and got this: |
Yea I ran into this again as well. I think it was my internet connection + a large file. But it does seem like an issue that if one file fails, everything fails silently |
@mjmaurer I manually bumped up the two TIMEOUT numbers in create-remote-file-node.js (in gatsby-source-filesystem) from 30s to 30 minutes, and it's successfully pulling all the files (including large videos). It's 100% a gross hack and not sustainable, but at least to get over the hump here it works. |
Got the same result here as well: I did some further digging: It seems the timeout is created in the gatsby/packages/gatsby-source-filesystem/src/create-remote-file-node.js Lines 152 to 157 in ae30682
All the requests promises are created at the same time but the actual requests are only loaded in order. This causes all the requests at the bottom of the stack to time out and fail. The Timeout error is not handled in the gatsby/packages/gatsby-source-contentful/src/download-contentful-assets.js Lines 88 to 90 in ae30682
When actually logging the error you get the following trace:
Because the error is not handled the result is still seen as a success even though the website will not run properly due to missing data. So this error needs to be handled appropriately. As for the request failing, the issue seems to be that too many of them are fired off at the same time. But are only loading in order.
It seems Setting the following config seems to fix the timeout issue for me. : gatsby-config.js
new output:
As for the timeout, 30 seconds is a good default, but might not be enough for larger files (or slow internet). Perhaps this needs to be adjustable if needed. Perhaps also through an environment variable? @mjmaurer Maybe reopen this issue as more people seem to encounter this problem? |
I've looked into this a bit and from what I can see there's a few issues at play here:
I'm going to start working on a PR to fix point 1 immediately. I don't think the Contentful source plugin should ever swallow errors. I would love to get someone's thoughts on points 2 & 3. Happy to work on these as well. |
related:
|
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
I was about to use the downloadLocal today and run into a different issue, reproduced on a clean install. Seemingly the plugin options are not passed down correctly. In the source plugin I'll dig a bit deeper if I'll have the time System: |
@jayhostan could you please check if this is still the case with |
hey @axe312ger , yes the issue is present on next as well System: |
@jayhostan it works fine for me on my local machine (adding |
gatsby-node in the source plugin: |
oh well my bad sorry.. I've passed it down at the wrong place. I need a rubber duck |
I'm still getting this issue. When I have bad service, my assets don't download at all. Could we make the timeout an option in the plugin's config? This makes it impossible to build in dev mode. |
I am very open for a PR, but it should contain:
|
I think most issues in here are because we swallow errors + retry logic was introduced with Gatsby v3 (also v2.32) We should soon merge and release #24288 which should solve a lot of your issues when downloading to local. Also: Please do not use |
This should be fixed with improved network error handling in the latest release v5.3 A backport to v4 (gatsby v2) should happen soon. (https://github.com/gatsbyjs/gatsby/projects/25) |
The backport was released to v2 now as well. |
I'll let Gatsby Bot close this issue automatically as last user feedback was August 2020. If you still run into this issue and run latest Gatsby v2 or Gatsby v3, let us know here and we will investigate further. |
Hello, This thread is dormant, but it is the closest explanation I've found. Please redirect me if necessary. Was the 30s timeout issue ever made configurable? On Gatsby Cloud, my team is seeing large video files (>50mb) coming from Contentful fail to download, but the site finishes building successfully. This is with Is there a way to configure this variable to allow for longer-than-30s downloads?
We are on:
Thanks in advance for any help or insights you can offer. |
Description
#20843 introduced a timeout for
createRemoteFileNode
. I'm almost certain this breaks localFile for contentful projects with ~15 or greater assets.I fixed transitive dependencies on
gatsby-source-filesystem
to 2.1.47 (right before #20843) and the issue was fixed.Steps to reproduce
Attempt using
gatsby-source-contentful
withdownloadLocal
enabled. Ifgatsby develop
takes > 30 seconds,createRemoteFileNode
will silently timeout. Build will complete, but mostlocalFile
fields in graphiql will benull
.Expected result
localFile
fields are populated.Actual result
localFile
fields are nullOther Notes
I think all of the
createRemoteFileNode
calls are actually completing, but the timeout has some nasty side effect.I'd love to see this reverted as I have to resort to the very hacky npm-force-resolutions
Environment
System:
OS: Linux 4.4 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
Yarn: 1.22.1 - /usr/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
Languages:
Python: 2.7.17 - /usr/bin/python
npmPackages:
gatsby: ^2.17.4 => 2.20.20
gatsby-image: ^2.2.30 => 2.3.2
gatsby-plugin-brotli: ^1.3.1 => 1.3.1
gatsby-plugin-emotion: ^4.1.18 => 4.2.1
gatsby-plugin-manifest: ^2.2.41 => 2.3.3
gatsby-plugin-netlify: ^2.1.32 => 2.2.1
gatsby-plugin-postcss: ^2.1.16 => 2.2.1
gatsby-plugin-prefetch-google-fonts: 1.4.3 => 1.4.3
gatsby-plugin-react-helmet: ^3.1.13 => 3.2.2
gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
gatsby-plugin-remove-fingerprints: 0.0.2 => 0.0.2
gatsby-plugin-resolve-src: ^2.0.0 => 2.0.0
gatsby-plugin-sharp: ^2.2.32 => 2.5.4
gatsby-source-contentful: ^2.1.73 => 2.2.7
gatsby-transformer-remote-filesystem: ^0.2.0 => 0.2.0
gatsby-transformer-sharp: ^2.3.0 => 2.4.4
npmGlobalPackages:
gatsby-cli: 2.11.8
The text was updated successfully, but these errors were encountered: