Build keeps failing to deploy site

Hi,

I’m trying to deploy a large Gatsby site on Netlify (>50k pages) and it seems to be timing out during the last steps:

9:10:51 AM: Starting post processing
9:15:23 AM: Failing build: Failed to deploy site
9:15:23 AM: failed during stage 'deploying site': Failed to execute deploy: Error: deploy timed out while waiting to enter states: prepared,ready
9:15:23 AM: Finished processing build request in 19m43.481484727s

I found a topic with a similar issue where you increased the timeout limit. I think that is necessary for this site too? As this is a client site it’s on a different account than the one connected here. The site id is e65ffd37-c843-43bb-b773-ec91139f9d8e and name makeover-feed.

Any other suggestions are welcome too of course.

Thanks,

Sander

Can I get an update here? I’m still unable to deploy.

Hi Sander,

Sure thing, we can increase your timeout! However, you’ll first need to input a credit card, here: https://app.netlify.com/teams/sander-makeover/billing/general#payment-information - since build minutes cost money and you’ve already accrued some charges, and this will likely lead to more.

Hey @fool, thanks for looking in to this.

Whoops, didn’t realise I hadn’t added card details yet. I’ve just added them.

hey @sanderfish - we have increased your time limit, you should be good to go!

thanks @perry! I’ve been able to deploy now, although I’m still seeing some deploys failing. Twice with System Error and the most recent one again with

failed during stage 'deploying site': Failed to execute deploy: Error: deploy timed out while waiting to enter states: prepared,ready

Do you have any idea what’s causing this?

EDIT: Looking at the logs of further deploys, it seems like the timeout hasn’t been increased yet. “Creating deploy upload records” is exactly 5 minutes before it fails. Please be aware the site I’m referring to is not connected to the account that I’m using to sign in to Discourse — I’ve created a separate account for this site as it will be transferred to my client once done.

1:04:06 PM: Creating deploy upload records
1:09:07 PM: Failing build: Failed to deploy site
1:09:07 PM: failed during stage 'deploying site': Failed to execute deploy: Error: deploy timed out while waiting to enter states: prepared,ready
1:09:07 PM: Finished processing build request in 26m57.782208777s
1:10:09 PM: Starting post processing

Another edit: The site was deployed in the end, while the logs show it failed during build stage. Can you explain what this means?

1:04:06 PM: Creating deploy upload records
1:09:07 PM: Failing build: Failed to deploy site
1:09:07 PM: failed during stage 'deploying site': Failed to execute deploy: Error: deploy timed out while waiting to enter states: prepared,ready
1:09:07 PM: Finished processing build request in 26m57.782208777s
1:10:09 PM: Starting post processing
1:37:50 PM: Post processing done
1:37:50 PM: Site is live

I don’t think the timeout has been increased yet. I have been able to deploy now but only because it stayed under the timeout — all files had been uploaded in batches in previous failed builds.

Is it possible to increase the timeout? I want this site to go to production pretty soon and this is becoming a blocker.

Hi, @sanderfish. I’ve made certain the build time limit was increased for this site. If it still doesn’t work, please let us know.

hey @luke, thanks a ton! I’ll assume it works now (I don’t have any new files to upload at the moment) and will ping you if it turns out to still not work. Thanks for now — I realise this isn’t a dedicated support channel so I appreciate the help.

1 Like

great. let us know if you run into more issues (here’s hoping you won’t…)

@perry sorry to be back again… I’m not seeing the timeout error anymore which is fantastic, but my last deploy (5e9b37ac27bb150007521487) failed with a “System Error”. No other messaging is shown so I’m not sure what went wrong.

6:41:57 PM: Starting to deploy site from 'packages/client/public'
6:44:34 PM: Creating deploy tree asynchronously
6:44:40 PM: Creating deploy upload records
6:45:32 PM: 70058 new files to upload
6:45:32 PM: 1 new functions to upload
6:59:07 PM: System Error

Next deploy I triggered does the same thing

11:53:06 AM: Starting to deploy site from 'packages/client/public'
11:55:45 AM: Creating deploy tree asynchronously
11:55:51 AM: Creating deploy upload records
11:56:21 AM: 51162 new files to upload
11:56:21 AM: 1 new functions to upload
12:08:23 PM: System Error

hey sander,

are you still seeing these issues? I’m trying to figure out if it was a temporary thing or not. thanks!

hi perry, I’m not certain — I’ll know when a lot of files change in the deploy. I tried deploying with a clean cache but that didn’t remove the files. I’m not sure yet what does :slight_smile: I’ll keep you posted!

1 Like

@perry deployed afresh last night an got the same error:

11:52:19 PM: Starting to deploy site from 'packages/client/public'
11:54:48 PM: Creating deploy tree asynchronously
11:54:58 PM: Creating deploy upload records
11:57:14 PM: 74792 new files to upload
11:57:14 PM: 1 new functions to upload
12:42:08 AM: System Error

It seems like in each deploy it’s able to upload ±20k files and then errors out. It will store those files so deploying multiple times works out in the end, but is far from ideal.

We’ll need a deploy link to troubleshoot further, Sander. Mind sharing one?

Sure.

These are 5 deploys of which the first 4 failed and the fifth succeeded, seemingly because it didn’t have to upload as many documents as they had been uploaded during the 4 failed deploys:

https://app.netlify.com/sites/makeover-feed/deploys/5e9b37ac27bb150007521487
https://app.netlify.com/sites/makeover-feed/deploys/5e9c298ec73268b29e218b89
https://app.netlify.com/sites/makeover-feed/deploys/5e9c325a6446ed611e9886b7
https://app.netlify.com/sites/makeover-feed/deploys/5e9c50fa8e1a56f0db81faa5
https://app.netlify.com/sites/makeover-feed/deploys/5e9c50fa8e1a56f0db81faa5 (succeeded)

A few days later the same thing happened:

https://app.netlify.com/sites/makeover-feed/deploys/5e9f74522e22700006703d95
https://app.netlify.com/sites/makeover-feed/deploys/5e9ff1ea1e62434ad7edf933
https://app.netlify.com/sites/makeover-feed/deploys/5ea007efb4888090e64b8cf1 (this one was stuck on Post processing for ~12 hours)
https://app.netlify.com/sites/makeover-feed/deploys/5ea0b2e9de7904f78f590dca (succeeded)

EDIT:

It’s showing a different error today: “Build exited unexpectedly”. See these three deploy attempts:

https://app.netlify.com/sites/makeover-feed/deploys/5ea433b1b80e0f000852be70
https://app.netlify.com/sites/makeover-feed/deploys/5ea440c5a4028d328d38c51f
https://app.netlify.com/sites/makeover-feed/deploys/5ea44ad25418c31cc41d739b

hey sander,

i wanted to let you know we haven’t forgotten about this and we’re still looking into this behaviour. are you still seeing the same issues?

Hi Perry, thanks for your reply.

I was still seeing the issue last time I checked, and I started getting “javascript heap out of memory” issues too, which pushed me to try Gatsby Cloud. It builds fine there and deploys to Netlify fine from there too. I would probably prefer to have everything run on Netlify as I’d prefer to just use one service, so if you have any guidance on how to overcome these issues they’re very welcome.

Hey Perry. I’m having some issues with timeouts between uploading from Gatsby Cloud to Netlify so had another look at the builds here.

Recent builds crash early on with error

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Deploy log: https://app.netlify.com/sites/makeover-feed/deploys/5ead8b7ab591220007e5cb2e

I don’t get this error when building locally or when building on Gatsby Cloud.

Hey Sander, thanks for your patience while we looked into this.

This isn’t a perfect response, but this is what we got:

Firstly, I think that we have some answers for you on your memory problem, and they are already written up here:

you might have a look through that and see if that is helpful.

Secondly, and i know this isn’t the answer you were hoping for…we are aware of performance and upload concerns for gatsby cloud - and this is something we are are discussing with them to see how they can improve their upload process, unfortunately this is not something where we really hold the reins.

I wish I had better news for you - but I hope this is at least somewhat useful?