-
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
Fetch remote files sometimes has errors removing partial downloads #34297
Comments
Hi! Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it. If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look. Thanks for using Gatsby! 💜 |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 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 have two projects that can reproduce this issue. I can not give public access but to single persons of the Gatsby core team. Contact me directly pls. Both projects run on Gatsby v4, with the new They act very flaky, builds succeed, sometimes. It happens on my dev machine and on CI. Feels like happening more often on CI as my powerful dev machine. But still can happen locally. This means this is also happening on MacOS and Linux. It always goes this way: Some image was downloaded, but not moved from the temporary location to the actual final location. Even on successful builds I end up with cache folders that still contain temporary files while there should be none left. Every different build a different image is the problem. Content and code did not change between the builds. This is the directory content of Lets build the projectRun #1
The build failed. 129 files never got to their destination folder. Error message was something like this I just copied from another CI run that has the same issue:
When I look up the image within the directory, I can find it as Alright, run #2
YAY! It downloaded more files properly.. but not enough. Warm build is stuck forever. So leats Try #3
Other problematic images, other amount of files. Same problem in the end. Not building because of image not existing. Try #4. We finally get a successful build:
This was a successful build. The website build looks fine on a first glimpse. I can just hope that nobody will realise that 3 images lack their placeholders... Warm builds now also work. For some reason. As you can see, we have a very unpredictable situation here. I getting into trouble convincing my clients that the builds problems will be gone soon, thats what I say till months ago, when Please help, I really don't want to move |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
My problems got solved with gatsby@4.10. What about you? |
I updated our graphcms source plugin to cache all the remote assets locally in another directory. This removed the majority of my problems plus it had the added bonus of massively speeding up builds! |
@nrandell alright, thats great. How did you do that? I'd suggest you to check what version(s) you have of |
@axe312ger - that was pretty simple. It's all in https://github.com/bond-london/simple-gatsby-source-graphcms/blob/main/src/cacheGraphCmsAsset.ts - but basically I call I keep this as up to date as possible as we use this plugin for most of our projects! |
This should be resolved :) Closing |
Preliminary Checks
Description
Sometimes when downloading lots of remote files, there are some weird connection errors on a slower link. All the retry logic in fetch remote files appears to work correctly, but sometimes on Windows, there is an issue removing the temporary file (removeSync). I think this is because the connection failed before the file was created.
When this happens the build fails with things like issue #16353
I've worked around it by wrapping removeSync in a try/catch in my local node_modules file
node_modules/gatsby-core-utils/dist/fetch-remote-file.js
Reproduction Link
https://github.com/bond-london
Steps to Reproduce
It's hard to reproduce as I believe it's down to network errors happening really quickly before the temporary files get created.
Expected Result
The build should run ok.
Actual Result
The build fails with errors like
Environment
Config Flags
FAST_DEV=true
PRESERVE_FILE_DOWNLOAD_CACHE=true
The text was updated successfully, but these errors were encountered: