When a deploy gets stuck with no apparent build failure, it typically means that while our robots did start building your code, it didn’t wrap up some process within the 15 minute time limit our build environment requires. Why can this happen? More on that in a sec, but first I want to mention that our build environment requires all processes, not just the main ones started by your build to complete. If even one thing gets stuck, the process won’t terminate and we end up with a stuck build. Is it possible you are running into a situation such as the one documented in these bug reports?
- gatsby build leaves dangling jest-worker child · Issue #7527 · gatsbyjs/gatsby · GitHub
- [Question] Timeout on Netlify build pipeline possibly caused by regression? · Issue #9465 · gatsbyjs/gatsby · GitHub
Even if the main
gatsby build process exits with the right exit code (yay!), there could be some background process that, perhaps unbeknownst to you, got started but that has not yet exited.
You’ll need to locate the process that is holding things up, and disable it for future builds to succeed, as it probably will not stop on its own. The offending process could even be something like a “watch” command that checks for file changes or similar, which are useful in development environments but not needed when building for production.
If you don’t already know what the process is, it can be a bit tricky to find it, but it is specific to your code. You might try appending
&& ps auxw ; false to your build command to see if you can get a listing of what’s there so you can make sure your build doesn’t start it, or make sure that process exits.
If that didn’t help - don’t worry, I bet we can sleuth it out with you. Leave a comment below and we’ll be happy to give it a shot. If you are experiencing this issue, it is likely other people are as well!