Unable to deploy Gatsby site, build timeout

Recently having builds fail on Netlify after no changes to the codebase. The site runs locally, and builds locally with no issues.

Error Message:
8:41:34 PM: (Netlify Build completed in 15m 8.1s)
8:41:34 PM: Execution timed out after 16m30.463314148s
8:41:34 PM: Error running command: Command did not finish within the time limit
8:41:34 PM: Failing build: Failed to build site
8:41:34 PM: Failed during stage ‘building site’: Command did not finish within the time limit
8:41:34 PM: Finished processing build request in 16m36.444869863s

Things I have tried:

  • Updating NPM packages - npm update
  • adding CI= to netlify build command - CI= npm run build

The affected sites API ID is: e83bdc5b-8175-410e-9966-f7b0e4327263

failed deploy log-

6:14:56 PM: Build ready to start
6:14:58 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
6:14:58 PM: build-image tag: v3.4.1
6:14:58 PM: buildbot version: 9c8ae11ff96d61099561d579a91d03dc24930de5
6:14:58 PM: Building without cache
6:14:58 PM: Starting to prepare the repo for build
6:14:59 PM: No cached dependencies found. Cloning fresh repo
6:14:59 PM: git clone https://github.com/emiled/harrywere
6:15:02 PM: Preparing Git Reference refs/heads/master
6:15:04 PM: Starting build script
6:15:04 PM: Installing dependencies
6:15:04 PM: Python version set to 2.7
6:15:05 PM: v12.18.0 is already installed.
6:15:05 PM: Now using node v12.18.0 (npm v6.14.4)
6:15:06 PM: Started restoring cached build plugins
6:15:06 PM: Finished restoring cached build plugins
6:15:06 PM: Attempting ruby version 2.7.1, read from environment
6:15:07 PM: Using ruby version 2.7.1
6:15:07 PM: Using PHP version 5.6
6:15:07 PM: 5.2 is already installed.
6:15:07 PM: Using Swift version 5.2
6:15:07 PM: Started restoring cached node modules
6:15:07 PM: Finished restoring cached node modules
6:15:08 PM: Installing NPM modules using NPM version 6.14.4
6:16:04 PM: > bufferutil@4.0.2 install /opt/build/repo/node_modules/bufferutil
6:16:04 PM: > node-gyp-build
6:16:05 PM: > utf-8-validate@5.0.3 install /opt/build/repo/node_modules/utf-8-validate
6:16:05 PM: > node-gyp-build
6:16:05 PM: > sharp@0.25.4 install /opt/build/repo/node_modules/sharp
6:16:05 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
6:16:05 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
6:16:07 PM: > node-sass@4.14.1 install /opt/build/repo/node_modules/node-sass
6:16:07 PM: > node scripts/install.js
6:16:08 PM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-72_binding.node
6:16:08 PM: Download complete
6:16:08 PM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-72/binding.node
6:16:09 PM: Caching binary to /opt/buildhome/.npm/node-sass/4.14.1/linux-x64-72_binding.node
6:16:09 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
6:16:09 PM: > node -e "try{require('./postinstall')}catch(e){}"
6:16:09 PM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/core-js
6:16:09 PM: > node -e "try{require('./postinstall')}catch(e){}"
6:16:09 PM: > core-js-pure@3.6.5 postinstall /opt/build/repo/node_modules/core-js-pure
6:16:09 PM: > node -e "try{require('./postinstall')}catch(e){}"
6:16:11 PM: > gatsby-telemetry@1.3.40 postinstall /opt/build/repo/node_modules/gatsby-telemetry
6:16:11 PM: > node src/postinstall.js || true
6:16:11 PM: > mozjpeg@7.0.0 postinstall /opt/build/repo/node_modules/mozjpeg
6:16:11 PM: > node lib/install.js
6:16:11 PM:   ✔ mozjpeg pre-build test passed successfully
6:16:11 PM: > pngquant-bin@6.0.0 postinstall /opt/build/repo/node_modules/pngquant-bin
6:16:11 PM: > node lib/install.js
6:16:12 PM:   ✔ pngquant pre-build test passed successfully
6:16:12 PM: > gatsby-cli@2.12.116 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
6:16:12 PM: > node scripts/postinstall.js
6:16:12 PM: > gatsby@2.25.2 postinstall /opt/build/repo/node_modules/gatsby
6:16:12 PM: > node scripts/postinstall.js
6:16:12 PM: > node-sass@4.14.1 postinstall /opt/build/repo/node_modules/node-sass
6:16:12 PM: > node scripts/build.js
6:16:13 PM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-72/binding.node
6:16:13 PM: Testing binary
6:16:13 PM: Binary is fine
6:16:13 PM: > styled-components@4.4.1 postinstall /opt/build/repo/node_modules/styled-components
6:16:13 PM: > node ./scripts/postinstall.js || exit 0
6:16:13 PM: Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
6:16:16 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
6:16:16 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
6:16:16 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/chokidar/node_modules/fsevents):
6:16:16 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
6:16:16 PM: added 2514 packages from 1296 contributors and audited 2520 packages in 67.4s
6:16:18 PM: 147 packages are looking for funding
6:16:18 PM:   run `npm fund` for details
6:16:18 PM: found 87 low severity vulnerabilities
6:16:18 PM:   run `npm audit fix` to fix them, or `npm audit` for details
6:16:18 PM: NPM modules installed
6:16:19 PM: Started restoring cached go cache
6:16:19 PM: Finished restoring cached go cache
6:16:19 PM: go version go1.14.4 linux/amd64
6:16:19 PM: go version go1.14.4 linux/amd64
6:16:19 PM: Installing missing commands
6:16:19 PM: Verify run directory
6:16:20 PM: ​
6:16:20 PM: ┌─────────────────────────────┐
6:16:20 PM: │        Netlify Build        │
6:16:20 PM: └─────────────────────────────┘
6:16:20 PM: ​
6:16:20 PM: ❯ Version
6:16:20 PM:   @netlify/build 5.2.1
6:16:20 PM: ​
6:16:20 PM: ❯ Flags
6:16:20 PM:   deployId: 5fa38a500b2657a7055b91de
6:16:20 PM:   mode: buildbot
6:16:20 PM: ​
6:16:20 PM: ❯ Current directory
6:16:20 PM:   /opt/build/repo
6:16:20 PM: ​
6:16:20 PM: ❯ Config file
6:16:20 PM:   /opt/build/repo/netlify.toml
6:16:20 PM: ​
6:16:20 PM: ❯ Context
6:16:20 PM:   production
6:16:20 PM: ​
6:16:20 PM: ❯ Loading plugins
6:16:20 PM:    - netlify-plugin-gatsby-cache@0.3.0 from netlify.toml
6:16:20 PM: ​
6:16:20 PM: ┌────────────────────────────────────────────────────────┐
6:16:20 PM: │ 1. onPreBuild command from netlify-plugin-gatsby-cache │
6:16:20 PM: └────────────────────────────────────────────────────────┘
6:16:20 PM: ​
6:16:21 PM: No Gatsby cache found. Building fresh.
6:16:21 PM: ​
6:16:21 PM: (netlify-plugin-gatsby-cache onPreBuild completed in 253ms)
6:16:21 PM: ​
6:16:21 PM: ┌───────────────────────────────────┐
6:16:21 PM: │ 2. Build command from Netlify app │
6:16:21 PM: └───────────────────────────────────┘
6:16:21 PM: ​
6:16:21 PM: $ CI= npm run build
6:16:21 PM: > harry-were-shop@1.0.7 build /opt/build/repo
6:16:21 PM: > GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES=true gatsby build --log-pages
6:16:25 PM: success open and validate gatsby-configs - 0.034s
6:16:26 PM: success load plugins - 1.286s
6:16:26 PM: success onPreInit - 0.037s
6:16:26 PM: success initialize cache - 0.006s
6:16:26 PM: success copy gatsby files - 0.028s
6:16:26 PM: success onPreBootstrap - 0.014s
6:16:26 PM: success createSchemaCustomization - 0.007s
6:16:27 PM: 
6:16:27 PM: gatsby-source-shopify/harrywere starting to fetch data from Shopify
6:16:27 PM: 
6:16:27 PM: gatsby-source-shopify/harrywere fetched and processed ShopPolicy nodes: 234.272ms
6:16:27 PM: 
6:16:27 PM: gatsby-source-shopify/harrywere fetched and processed Blog nodes: 237.582ms
6:16:27 PM: 
6:16:27 PM: gatsby-source-shopify/harrywere fetched and processed Page nodes: 237.260ms
6:16:27 PM: 
6:16:27 PM: gatsby-source-shopify/harrywere fetched and processed Shop nodes: 242.400ms
6:16:27 PM: 
6:16:27 PM: gatsby-source-shopify/harrywere fetched and processed Article nodes: 371.253ms
6:16:29 PM: 
6:16:29 PM: gatsby-source-shopify/harrywere fetched and processed Collection nodes: 2880.325ms
6:16:29 PM: success Downloading remote files - 2.664s - 211/211 79.21/s
6:16:29 PM: 
6:16:29 PM: gatsby-source-shopify/harrywere fetched and processed Product nodes: 2888.673ms
6:16:29 PM: 
6:16:29 PM: gatsby-source-shopify/harrywere finished fetching data from Shopify: 2880.985ms
6:16:29 PM: success Checking for changed pages - 0.000s
6:16:29 PM: success source and transform nodes - 3.157s
6:16:30 PM: success building schema - 0.594s
6:16:30 PM: info Total nodes: 777, SitePage nodes: 64 (use --verbose for breakdown)
6:16:30 PM: success createPages - 0.084s
6:16:30 PM: success Checking for changed pages - 0.000s
6:16:30 PM: success createPagesStatefully - 0.082s
6:16:30 PM: success update schema - 0.036s
6:16:30 PM: success onPreExtractQueries - 0.000s
6:16:31 PM: success extract queries from components - 0.534s
6:16:31 PM: success write out redirect data - 0.001s
6:16:31 PM: success Build manifest and related icons - 0.242s
6:16:31 PM: success onPostBootstrap - 0.244s
6:16:31 PM: info bootstrap finished - 10.004s
6:16:33 PM: success run static queries - 1.872s - 3/3 1.60/s
6:17:05 PM: success run page queries - 31.882s - 69/69 2.16/s
6:17:05 PM: success write out requires - 0.006s
6:17:54 PM: success Building production JavaScript and CSS bundles - 49.619s
6:17:55 PM: success Rewriting compilation hashes - 0.003s
6:30:35 PM: success Building static HTML for pages - 7.913s - 69/69 8.72/s
6:30:35 PM: success Delete previous page data - 0.001s
6:30:35 PM: success Generating image thumbnails - 843.545s - 6878/6878 8.15/s
6:30:35 PM: success onPostBuild - 0.002s
6:30:35 PM: info Done building in 853.605960785 sec
6:30:35 PM: info Built pages:
6:30:35 PM: Updated page: /product/small-new-zealand-gold-hoop/
6:30:35 PM: Updated page: /product/purple-wonky-cashmere-jumper/
6:30:35 PM: Updated page: /product/antartica-helmet/
6:30:35 PM: Updated page: /product/handwoven-hand-towel/
6:30:35 PM: Updated page: /product/autumn-spring-ends-vest/
6:30:35 PM: Updated page: /product/manuka-bud-earrings/
6:30:35 PM: Updated page: /product/deep-blue-wiggle-jumper/
6:30:35 PM: Updated page: /product/lavender-cable-jumper/
6:30:35 PM: Updated page: /product/isobel-thom-salt-pig-small/
6:30:35 PM: Updated page: /product/baby-cashmere-reversible-nutshell-cardigan/
6:30:35 PM: Updated page: /product/khaki-cashmere-patience-v-jumper/
6:30:35 PM: Updated page: /product/overcast-wednesday-jumper/
6:30:35 PM: Updated page: /product/hometime-jumper-1/
6:30:35 PM: Updated page: /product/sherie-muijs-x-harry-were-shirt-short/
6:30:35 PM: Updated page: /product/isobel-thom-salt-pig-large/
6:30:35 PM: Updated page: /product/sherie-muijs-x-harry-were-shirt-long/
6:30:35 PM: Updated page: /product/handknitted-rabbit/
6:30:35 PM: Updated page: /product/cloud-patience-jumper/
6:30:35 PM: Updated page: /product/handspun-overcast-jumper/
6:30:35 PM: Updated page: /product/handspun-gotland-shoulder-jumper/
6:30:35 PM: Updated page: /product/forget-me-not-chunky-vest/
6:30:35 PM: Updated page: /product/autumn-cocktail-cardigan/
6:30:35 PM: Updated page: /product/primary-jumper/
6:30:35 PM: Updated page: /product/nutshell-bobble-jumper-1/
6:30:35 PM: Updated page: /product/gingham-ragdoll-dress/
6:30:35 PM: Updated page: /product/antarctica-helmet/
6:30:35 PM: Updated page: /product/handwoven-cotton-shirt/
6:30:35 PM: Updated page: /product/handspun-arapawa-gotland-clown-jumper/
6:30:35 PM: Updated page: /product/nutshell-jumper/
6:30:35 PM: Updated page: /product/ribbed-carved-raglan-jumper/
6:30:35 PM: Updated page: /product/crocheted-couch-doily-scarf/
6:30:35 PM: Updated page: /product/handspun-siblings-bear/
6:30:35 PM: Updated page: /product/handspun-arapawa-clown-jumper/
6:30:35 PM: Updated page: /product/reversible-quilted-small-puff-jacket-1/
6:30:35 PM: Updated page: /product/ends-jumper/
6:30:35 PM: Updated page: /product/handspun-drysdale-bells-jumper/
6:30:35 PM: Updated page: /product/wonky-cashmere-jumper/
6:30:35 PM: Updated page: /product/blue-mondays-vest/
6:30:35 PM: Updated page: /product/gotland-madder-root-jumper/
6:30:35 PM: Updated page: /product/happy-chunky-vest/
6:30:35 PM: Updated page: /product/forget-me-not-jumper/
6:30:35 PM: Updated page: /product/handspun-perendale-clown-jumper/
6:30:35 PM: Updated page: /product/handwoven-hand-towel-1/
6:30:35 PM: Updated page: /product/square-spring-ends-vest/
6:30:35 PM: Updated page: /product/handspun-curtain-vest/
6:30:35 PM: Updated page: /product/love-jumper/
6:30:35 PM: Updated page: /product/stripe-ragdoll-dress/
6:30:35 PM: Updated page: /product/carpet-ends-vest/
6:30:35 PM: Updated page: /product/handspun-rainbow-clown-jumper/
6:30:35 PM: Updated page: /product/buttonless-jolly-dress/
6:30:35 PM: Updated page: /product/carpet-vest/
6:30:35 PM: Updated page: /product/curtain-cardigan/
6:30:35 PM: Updated page: /product/handwoven-cotton-summer-dress/
6:30:35 PM: Updated page: /product/handwoven-villa-borsani-hand-towel/
6:30:35 PM: Updated page: /product/organic-lockdown-bonnets-made-to-order-1/
6:30:35 PM: Updated page: /product/jolly-dress-1/
6:30:35 PM: Updated page: /product/patchwork-ragdoll-dress-5/
6:30:35 PM: Updated page: /product/square-dress-1/
6:30:35 PM: Updated page: /product/hand-smocked-flutter-dress/
6:30:35 PM: Updated page: /product/ends-vest/
6:30:35 PM: Updated page: /product/handspun-identical-twin-self-portrait-vest/
6:30:35 PM: Updated page: /product/hand-smocked-full-sleeve-dress-1/
6:30:35 PM: Updated page: /product/handspun-frog-vest/
6:30:35 PM: Updated page: /404/
6:30:35 PM: Updated page: /friends/
6:30:35 PM: Updated page: /
6:30:35 PM: Updated page: /info-care/
6:30:35 PM: Updated page: /past/
6:30:35 PM: Updated page: /404.html
6:30:35 PM: ​
6:30:35 PM: (build.command completed in 14m 14.3s)
6:30:35 PM: ​
6:30:35 PM: ┌─────────────────────────────────────────────────────────┐
6:30:35 PM: │ 3. onPostBuild command from netlify-plugin-gatsby-cache │
6:30:35 PM: └─────────────────────────────────────────────────────────┘
6:30:35 PM: ​
6:30:46 PM: Stored the Gatsby cache to speed up future builds.
6:30:46 PM: ​
6:30:46 PM: (netlify-plugin-gatsby-cache onPostBuild completed in 10.6s)
6:30:46 PM: ​
6:30:46 PM: ┌─────────────────────────────┐
6:30:46 PM: │   Netlify Build Complete    │
6:30:46 PM: └─────────────────────────────┘
6:30:46 PM: ​
6:30:46 PM: (Netlify Build completed in 14m 25.6s)
6:30:46 PM: Execution timed out after 15m42.284514781s
6:30:46 PM: Error running command: Command did not finish within the time limit
6:30:46 PM: Failing build: Failed to build site
6:30:46 PM: Failed during stage 'building site': Command did not finish within the time limit
6:30:46 PM: Finished processing build request in 15m47.940954468s

I’m aware of this post about hung processes, but could not resolve the issue.

Any help much appreciated,
Thanks for reading.

hey there,

it could be that your site really does need more than 15 minutes to build - if you put a credit card in your account so we can automatically bill for any overages, we’d be happy to bump your build timeout to 30 minutes. (we can’t do anything between 15 and 30.)

can you tell me the netlify site name (not custom domain) or API ID so i can check your account once you have added a card?

Hi @perry,

Thanks for the quick reply.
I have added a card to the account & the API ID is: e83bdc5b-8175-410e-9966-f7b0e4327263

Suspicious as to why the build is taking so long, previously builds were consistently finishing in less than 6 minutes.

@perry, did you manage to check over my account?

hi there, yes! we have bumped your build time up to 30mins.

not sure why it might be taking longer than expected, now that you can build, maybe these resources might help you slim it down: