gatsby: Error: UNHANDLED REJECTION write EPIPE
Description
Hello everyone!
I’m getting this error almost every time I shut down local server.
error UNHANDLED REJECTION write EPIPE
Error: write EPIPE
- child_process.js:806 ChildProcess.target._send
internal/child_process.js:806:20
- child_process.js:676 ChildProcess.send
internal/child_process.js:676:19
- develop.ts:130 ControllableScript.stop
[ap-investment]/[gatsby]/src/commands/develop.ts:130:20
- develop.ts:500 shutdownServices
[ap-investment]/[gatsby]/src/commands/develop.ts:500:28
- develop.ts:442 process.<anonymous>
[ap-investment]/[gatsby]/src/commands/develop.ts:442:11
I’ve tried multiple times
gatsby clean
remove /node_modules and package-lock.json
npm install
but it solves problem only for some time. Don’t know if it is related but when gatsby develop
and dev server is running, after some saves, when I click Command + S to save changes, hot reload doesn’t work and project isn’t re-rendering.
Steps to reproduce
Expected result
Shuting down dev server without errors
Actual result
Throwing error mentioned above and hot reload not working.
Environment
System:
OS: macOS 10.15.7
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.14.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 86.0.4240.193
Firefox: 82.0.3
Safari: 14.0
npmPackages:
gatsby: ^2.25.3 => 2.25.4
gatsby-alias-imports: ^1.0.6 => 1.0.6
gatsby-image: ^2.4.21 => 2.4.21
gatsby-plugin-postcss: ^3.0.4 => 3.0.4
gatsby-plugin-sass: ^2.4.2 => 2.4.2
gatsby-plugin-sharp: ^2.7.1 => 2.7.1
gatsby-plugin-tinacms: ^0.32.0 => 0.32.0
gatsby-source-filesystem: ^2.4.2 => 2.4.2
gatsby-tinacms-git: ^0.32.0 => 0.32.0
gatsby-tinacms-json: ^0.32.0 => 0.32.0
gatsby-tinacms-remark: ^0.32.1 => 0.32.1
gatsby-transformer-remark: ^2.9.2 => 2.9.2
gatsby-transformer-sharp: ^2.5.21 => 2.5.21
npmGlobalPackages:
gatsby-cli: 2.12.117
gatsby: 2.25.3
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 19
- Comments: 100 (31 by maintainers)
Commits related to this issue
- Avoid UNHANDLED REJECTION error on ctrl-C (#32311) Ref https://github.com/gatsbyjs/gatsby/issues/28011 — committed to gatsbyjs/gatsby by karlhorky 3 years ago
- Avoid UNHANDLED REJECTION error on ctrl-C (#32311) Ref https://github.com/gatsbyjs/gatsby/issues/28011 — committed to gatsbyjs/gatsby-starter-blog-theme by ViCo0TeCH 3 years ago
- Avoid UNHANDLED REJECTION error on ctrl-C (#32311) Ref https://github.com/gatsbyjs/gatsby/issues/28011 — committed to gatsbyjs/gatsby-starter-blog-theme-core by ViCo0TeCH 3 years ago
confirmed still happens on
3.8.0
:Thanks @panzacoder. Why is this issue closed though? I don’t believe downgrading is an adequate work around for many who need to use the latest version of Gatsby.
I’m getting this same issue with Gatsby v.4.0.2.
I have to build my project multiple times in Netlify until I get a time that it doesn’t happen. It even occurs when I clear the cache and do a fresh build.
@KyleAMathews @vladar can we reopen this one?
This issue should not be closed. Image processing works on my local environment but not Netlfiy. Something that started happening after updating Gatsby.
Third time’s the charm: https://github.com/gatsbyjs/gatsby/pull/32744 Once merged will be backported and released in
gatsby@3.11.1
Hey. This is a duplicate of #35055 , which now has a fix. If you update to
gatsby@4.13.1
then it should fix the problem.I’m also seeing this issue on Netlify with any version of Gatsby, most recently
@4.7.1
I emailed Netlify support about this issue, and they said it’s because of memory use while processing sharp images. However, I see that the image processing job appears to complete successfully:Still experiencing this on gatsby 3.10.1
@KyleAMathews as simple as this? https://github.com/gatsbyjs/gatsby/pull/32311
Has anyone figured out any solutions for this error? IM getting the same EPIPE error every time I shut down my local server.
Same here, and I also lost hot reloading
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. If we missed this issue or if you want to keep it open, please reply here. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!
Thanks for being a part of the Gatsby community! 💪💜
@panzacoder any updates on the issue?
I am having this error after upgrading Gatsby from 3.14 to 4.4, deploying on Netlify.
Netlify seems to think it is a memory error, that the build exceeds the 3GB allotted for builds.
Getting this error on Gatsby v4.3.0
i can confirm i’m seeing this same issue in v3.10.2
@karlhorky I think the fix will go out on Tuesday in the next minor (3.10.0) as a part of the release process. But in the meantime, you can try it using
yarn add gatsby@next
which points to the latest unpublished version.@jack0wsky try updating to a more recent version of gatsby (as of writing this we are at 2.28.0). Not fully sure if the underlying issue was fully fixed but I haven’t run into this for a while with a fresh gatsby version.
Same isssue when I deploy on Netlify with
In the case of the issue with v4.8+ and Netlify, #35055 is currently ongoing.
I can confirm the error has gone with Gatsby v3.11.1 as well. Nice one 👍
This was closed with a previous version of Gatsby and it is now back with the most recent version. So it needs to be reopened.
I’m on the latest Gatsby version: 3.10.2 yeah! Weird…
Getting this error after upgrading from v2 to v3.
Yeah, definitely! Feel the same myself. Every time that Gatsby shows this error, I think “oh no, have to debug something here” for a half second before remembering
I almost always get that same error. I’m using
iTerm
&zsh
. Wondering if it’s related to either of those.Same thing happens on Win10:
"develop": "gatsby develop -H=0.0.0.0",
Node: v14.15.4 npm: 6.14.10
Not sure if this will help but I found that this error had a lot to do with my client’s use of Headless WordPress (I joined after it was set up). For example:
Changing an image on a page or post may not actually remove the original and replace it with the newer version. Instead, WordPress attaches the new image with the old one and thinks the post now has a gallery. It will still serve the correct image to the live page and not an array. However, Gatsby will still at build time run its image optimization on all attached images, regardless if they are being used. To remedy this I recommend going through your media library and detach any extra images you may have.
Another is if WordPress has to deal with large asset sizes like gifs or video files. When these are passed to Gatsby at build time, the WordPress server gets overloaded and the error is thrown. At least it was for me anyway. I basically had to talk to the team to be aware of what kind of assets they are using because WordPress as a CMS may not be able to handle sending these to Gatsby. We had to replace them with more optimized versions.
Its super lame and if you have a chance I recommend steering clear of Headless WordPress. It’s issues run deep in terms of how it integrates on the Jamstack.
I am on Gatsby v^4.11.2. The issue only came up for me after I changed an image in my repository. I am seeing this issue now on my Netlify build as well and it seems to be connected to gatsby-plugin-image. Image file size seems to not affect the issue. I reduced the image file size to 2 MB from 24 MB but the issue is still occurring.
This issue recently started happening to me across three client projects. One of which was already upgraded to Gatsby v4 before it started and can’t be rolled back to v3. The other one is waiting for a fix so that the upgrade can be completed. But the most clear demonstration of this issue is the most recent project, which I started about a week ago (so of course it uses v4). It only has about 14 images that are a few hundred KBs each (but reused in a few places at different sizes), across 20 pages. Builds are failing left and right and only sporadically work. It’s extremely unreliable. I don’t think it’s an issue of inefficient coding, I am writing fairly idiomatic code as recommended in the docs.
There is a major issue going on with Gatsby v4 and Netlify. When will it be taken seriously?
Btw, there appears to be another issue for the same problem along with my latest update/workaround for Netlify. Curious if it helps your instance @byebyers
https://github.com/gatsbyjs/gatsby/issues/35055#issuecomment-1064501847
I did want to share that I reduce the amount and size of images that we were processing (from Wordpress). In particular, I was able to consolidate duplicate images from SEO and other fields. I also make sure we didn’t have any large images in terms of resolution width and bytes. After that our build time was drastically reduced by half and the Gatsby 4 builds in Netlify no longer time out.
can also confirm error has been fixed in 3.11.1. Thanks all!
the same issue even in the latest version @3.10.2
This error came out of nowhere half way throught building a project, it’s anxiety inducing to see red in the Terminal all day.
I’m getting this error after upgrading from v2 to v3
Hmm… but I think there’s a way to hook into the
SIGINT
event that is triggered byctrl-C
and prevent these types of things. I remember fixing a similar issue with logging output from a process not stopping onSIGINT
a few years ago. I think this can be fixed in Gatsby itself.hey @jack0wsky , @karlhorky , @sol-idsnake and @aravind-tc there is nothing wrong with GatsbyJS its how NodeJS handle piping data into closed streams, the error might be caused when the NodeJS event loop didn’t clean-up closed TCP connections from the HTTP connection pool and then the NodeJS runtime attempted to use the closed TCP connection.
Yes, this error also happens for me every time I shut down using <kbd>ctrl</kbd>-<kbd>C</kbd> on macOS.
Demo repo:
https://github.com/upleveled/gatsby-serverside-auth0/tree/main/packages/gatsby-website