Getting " Command did not finish within the time limit" while deploy

why am i getting this time limited? anyway to extend the build time?

my app id: 11a6468a-6167-4359-922a-455da09347b3

LOG:
5:27:38 PM: Execution timed out after 18m0.361315378s
5:27:38 PM: Error running command: Command did not finish within the time limit
5:27:38 PM: Creating deploy upload records
5:27:38 PM: Failing build: Failed to build site
5:27:38 PM: Failed during stage ‘building site’: Command did not finish within the time limit

Hi Andy,

Welcome to the community!

The default build time limit for sites is 15 minutes and your build is exceeding that as you were able to see in the deploy logs:

5:27:38 PM: Execution timed out after 18m0.361315378s

I’d suggest taking a peek at this forums article on optimizing your build time: [Support Guide] How can I optimize my Netlify build time?

Fool wrote it so it’s pretty good! See if you can apply any of his advice.

If that doesn’t work, we can increase the build time limit for the site but please keep in mind that a starter account includes 300 build minutes, after which you will begin to accrue additional charges (see our billing FAQ for additional details on how we bill for metered services.)

If you’d like us to increase the time limit, let us know what you think a good value might be. 20 minutes? 30? Let us know.

Elden

thx Elden,

it has been extended to 30 min, it much better now, but i am getting exit code:2 now…May i know what’s the meaning for code:2 ?

5:06:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2

5:06:28 PM: Creating deploy upload records

5:06:29 PM: Failing build: Failed to build site

5:06:29 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2 (Search results for '"non-zero exit code: 2"' - Netlify Support Forums)

5:06:29 PM: Finished processing build request in 21m31.876060509s

:wave: Andy,

It looks like you also opened a Helpdesk ticket for this issue. I’ve responded there with:

Could you try using --verbose for the failed command: nx run shell:build:production and share the build log from the UI to help us debug further?

At the end not sure why it took so long, anyway i setup a self host task runner for the build, and it took less then 15 min to build.

Thanks for coming back and sharing this update with the Forums. We are glad everything is working for you now :rocket: