[Support Guide] Hung or stuck, but seemingly successful build

Last reviewed: April 2024

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 ones documented in these bug reports?

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!

3 Likes

Somewhat related to this, @bret posted a useful article on the blog a while ago about some tooling added to the build bots to help identify processes which might be hanging.

1 Like

I don’t think that functionality works anymore, @philhawksworth . you can see a build that should have had that happen here: Netlify App.

That article should be removed since the functionality didn’t work reliably and was removed, and it probably isn’t useful to reference it in here :slight_smile:

1 Like