Buid fail with random reason

Hi ! my site name is https://pauavelo.netlify.app/

Recently, site builiding begins to fail with random reason : missing files, fail during initialisation while downloading, timeout because build time too long, and even fail while deploying after build succeeded.

It looks like my site is too big? Netlify stop before downloading all files (initialisation?), or before the end of the build, or after building.

Is there something that may be done to succeed my build ? At home everything is fine, I red the guide about solving netlify build fails, but it did not help me.

Here are some relevant logs during failed deploys:

Fail during build

5:44:12 PM: build.command from netlify.toml
5:44:12 PM: ─────────────────────────────────────────────
5:44:12 PM: ​
5:44:12 PM: $ hugo
5:44:12 PM: Start building sites …
5:44:12 PM: hugo v0.89.4-AB01BA6E+extended linux/amd64 BuildDate=2021-11-17T08:24:09Z VendorInfo=gohugoio
5:44:24 PM: Failed during stage “building site”: Command was cancelled
5:44:24 PM: panic: runtime error: slice bounds out of range [4:3]
5:44:24 PM: goroutine 152 [running]:
5:44:24 PM: github.com/gohugoio/hugo/hugolib.(*pageState).deleteResource(...)
5:44:24 PM: /root/project/hugo/hugolib/page.go:550
5:44:24 PM: github.com/gohugoio/hugo/hugolib.(*pageState).renderResources.func1()
5:44:24 PM: /root/project/hugo/hugolib/page.go:542 +0x245
5:44:24 PM: sync.(*Once).doSlow(0x4ce320, 0xc0024f7980)
5:44:24 PM: /usr/local/go/src/sync/once.go:68 +0xd2
5:44:24 PM: sync.(*Once).Do(…)
5:44:24 PM: /usr/local/go/src/sync/once.go:59
5:44:24 PM: github.com/gohugoio/hugo/hugolib.(*pageState).renderResources(0xc00098ea00)
5:44:24 PM: /root/project/hugo/hugolib/page.go:510 +0x67
5:44:24 PM: github.com/gohugoio/hugo/hugolib.pageRenderer(0x115bca5, 0xc00098ea00, 0xc000720fd0, 0x115bc26, 0xc000517080)
5:44:24 PM: /root/project/hugo/hugolib/site_render.go:113 +0xe7
5:44:24 PM: created by github.com/gohugoio/hugo/hugolib.(*Site).renderPages
5:44:24 PM: /root/project/hugo/hugolib/site_render.go:73 +0x112
5:44:24 PM: ​
5:44:24 PM: “build.command” failed
5:44:24 PM: ──────────────────────────────────────────────

Fail after build succeeded (during deploy)

2:53:03 AM: Finished processing build request in 36m0.475s
Deploying
Failed
2:53:02 AM: Deploy site
2:53:02 AM: ───────────────────────────────────────────
2:53:02 AM: ​
2:53:02 AM: ​
2:53:02 AM: ❯ Uploaded config
2:53:02 AM: [build]
2:53:02 AM: publish = “public”
2:53:02 AM: command = “hugo”
2:53:02 AM: ​
2:53:02 AM: [context.production.environment]
2:53:02 AM: HUGO_VERSION = “0.89.4”
2:53:02 AM: HUGO_ENV = “production”
2:53:02 AM: HUGO_ENABLEGITINFO = “true”
2:53:02 AM: ​
2:53:02 AM: [context.branch-deploy]
2:53:02 AM: command = “hugo -D -b $DEPLOY_PRIME_URL”
2:53:02 AM: ​
2:53:02 AM: [context.branch-deploy.environment]
2:53:02 AM: HUGO_VERSION = “0.89.4”
2:53:02 AM: HUGO_ENV = “production”
2:53:02 AM: HUGO_ENABLEGITINFO = “true”
2:53:02 AM: ​
2:53:02 AM: ❯ Uploaded headers
2:53:02 AM: No headers
2:53:02 AM: ​
2:53:02 AM: ❯ Uploaded redirects
2:53:02 AM: No redirects
2:53:02 AM: ​
2:53:02 AM: Starting to deploy site from “public”
2:53:02 AM: Section completed: deploying
2:53:03 AM: Failed during stage “building site”: Command was cancelled
2:53:03 AM: Execution cancelled
2:53:03 AM: Error running command: Command was cancelled
2:53:03 AM: Failing build: Failed to build site

Other fail during build

11:01:52 PM: Build exceeded maximum allowed runtime

Fail during initialization

5:48:20 PM: Starting to install dependencies
5:48:20 PM: Python version set to 3.8
5:48:20 PM: Attempting Ruby version 2.7.2, read from environment
5:48:21 PM: Using Ruby version 2.7.2
5:48:21 PM: Started restoring cached go cache
5:48:21 PM: Finished restoring cached go cache
5:48:23 PM: Failed during stage “Install dependencies”: Command was cancelled
5:48:23 PM: go version go1.19.13 linux/amd64
5:48:23 PM: Execution cancelled
5:48:23 PM: Failing build: Failed to install dependencies

This one simply means, you ran over the default 15-min build time limit. We can bump it to 30 mins or so if this is a consistent issue.

But the other 2 issues, by their error message look like they were cancelled by someone. Would that be the case?

No, nobody canceled the build. It seems like netlify canceled it for some reasons I ignore. Maybe bumping build time limit would let the build be done ?

Looking at the logs, the initializing part seems to take about 35 minutes, wich is quite a lot. It take this time wether it fails or not. Then building part takes about 40s.

Hi, you can also try optimising your build time. Would you like us to initially bump up your build to 30 minutes ?

Would you like us to initially bump up your build to 30 minutes ?

Yes, can you do that so I see if it solve the problem ?

Also, I think my source files recently passed the 1GB size (lots of pictures in git LFS). Is there any limit on the size netlify can download from gitlab? Maybe this would explain the missing files, witch let me think the download of source files was only partial.

Maybe also this could explain the fail at final stage of deploy in netlify (after build suceeded): is there a limit of internal uploading from built wesite to production in netlify ?

I have pushed the build timelimit to an hour. See if that changes something. There’s no limit to the size of the repo though.

It seems build time limit was the cause indeed : deploys are succeeding again. @hrishikesh modified my build limit, posting his message on december 9th. Strange thing is that on december 8th I had already two commits that deployed, each in about 35 minutes. I suppose built limit was upgraded a few hours before @hrishikesh posted his message? Anyway then, all following deploys succeeded, and took less than 2 minutes to deploy.

I investigated a bit, and if I clear cache, deploy takes about 35mn, and without clearing cache it takes less than 2 minutes. The “big” part is the initializing part of the deploy, not the build part. I clearly was in a situation with nothing cached when all my deploying attempts failed.

This makes me think I might need again to have a build timeout of more than 30 minutes, though this will happen very rarely, because most of my builds will take less than 2 minutes. Does this mean I need to upgrade plan ?

Your build time is at 1 hour, you’ll just want to keep an eye on your build minutes to ensure you don’t go over the 300 minutes /month allotted on the starter plan or you’ll be charged