[Common Issue] Hung or stuck, but seemingly successful build

answered
#1

Sorry to hear you are running into a common issue where building is concerned!

Basically, the above message means that when our robots started 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?

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!

[Common Issue] How long should Netlify builds take?
Deploy fails: "Build exceeded maximum allowed runtime" - with GatsbyJS & Git Push
#3

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
#4

I don’t think that functionality works anymore, @philhawksworth . you can see a build that should have had that happen here: https://app.netlify.com/sites/cyclocrass/deploys/5c8fd5e4ce38bf57fc2308aa.

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
#5

Oh! I didn’t know that. Perhaps rather than removing that post, we should update it with info saying that feature has been retired or removed. Just in case there are others like me who recall it and go looking for it on the blog. What do you think, @bret?

1 Like
pinned #9