Gatsby Site build timed out

I’m looking for a solution to the issue with netlify deploy. Everything was working fine until I see Build exceeded maximum allowed runtime at the very end of the deploy logs. It’s a Gatsby Site with a Contentful CMS. 2-3 days back deployment was working fine, I don’t know what the issue is. Please, help me with the issue.

7:18:32 PM: Build ready to start
7:18:34 PM: build-image version: 0e2f4c52031ab562db66aec633308326e3b108d0 (focal)
7:18:34 PM: build-image tag: focal
7:18:34 PM: buildbot version: ed990b4b6588208e959ba45b6b7b05738f8b6004
7:18:34 PM: Fetching cached dependencies
7:18:34 PM: Failed to fetch cache, continuing with build
7:18:34 PM: Starting to prepare the repo for build
7:18:35 PM: No cached dependencies found. Cloning fresh repo
7:18:35 PM: git clone https://github.com/pbit0x/Flow-It-All
7:18:36 PM: Preparing Git Reference refs/heads/master
7:18:36 PM: Parsing package.json dependencies
7:18:38 PM: Starting build script
7:18:38 PM: Installing dependencies
7:18:38 PM: Python version set to 2.7
7:18:38 PM: v16.15.1 is already installed.
7:18:39 PM: Now using node v16.15.1 (npm v8.11.0)
7:18:39 PM: Started restoring cached build plugins
7:18:39 PM: Finished restoring cached build plugins
7:18:39 PM: Attempting ruby version 2.7.2, read from environment
7:18:40 PM: Using ruby version 2.7.2
7:18:40 PM: Using PHP version 8.0
7:18:40 PM: Started restoring cached yarn cache
7:18:40 PM: Finished restoring cached yarn cache
7:18:41 PM: No yarn workspaces detected
7:18:41 PM: Started restoring cached node modules
7:18:41 PM: Finished restoring cached node modules
7:18:41 PM: Installing NPM modules using Yarn version 1.22.10
7:18:41 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
7:18:41 PM: npm WARN config location in the cache, and they are managed by
7:18:41 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
7:18:42 PM: yarn install v1.22.10
7:18:42 PM: [1/4] Resolving packages...
7:18:42 PM: [2/4] Fetching packages...
7:19:19 PM: info fsevents@2.3.2: The platform "linux" is incompatible with this module.
7:19:19 PM: info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @lmdb/lmdb-darwin-arm64@2.5.2: The platform "linux" is incompatible with this module.
7:19:19 PM: info "@lmdb/lmdb-darwin-arm64@2.5.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @lmdb/lmdb-darwin-arm64@2.5.2: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info @lmdb/lmdb-darwin-x64@2.5.2: The platform "linux" is incompatible with this module.
7:19:19 PM: info "@lmdb/lmdb-darwin-x64@2.5.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @lmdb/lmdb-linux-arm@2.5.2: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info "@lmdb/lmdb-linux-arm@2.5.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @lmdb/lmdb-linux-arm64@2.5.2: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info "@lmdb/lmdb-linux-arm64@2.5.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @lmdb/lmdb-win32-x64@2.5.2: The platform "linux" is incompatible with this module.
7:19:19 PM: info "@lmdb/lmdb-win32-x64@2.5.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info lmdb-darwin-arm64@2.3.10: The platform "linux" is incompatible with this module.
7:19:19 PM: info "lmdb-darwin-arm64@2.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info lmdb-darwin-arm64@2.3.10: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info lmdb-darwin-x64@2.3.10: The platform "linux" is incompatible with this module.
7:19:19 PM: info "lmdb-darwin-x64@2.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info lmdb-linux-arm@2.3.10: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info "lmdb-linux-arm@2.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info lmdb-linux-arm64@2.3.10: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info "lmdb-linux-arm64@2.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info lmdb-win32-x64@2.3.10: The platform "linux" is incompatible with this module.
7:19:19 PM: info "lmdb-win32-x64@2.3.10" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @msgpackr-extract/msgpackr-extract-darwin-arm64@2.0.2: The platform "linux" is incompatible with this module.
7:19:19 PM: info "@msgpackr-extract/msgpackr-extract-darwin-arm64@2.0.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @msgpackr-extract/msgpackr-extract-darwin-arm64@2.0.2: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info @msgpackr-extract/msgpackr-extract-darwin-x64@2.0.2: The platform "linux" is incompatible with this module.
7:19:19 PM: info "@msgpackr-extract/msgpackr-extract-darwin-x64@2.0.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @msgpackr-extract/msgpackr-extract-linux-arm@2.0.2: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info "@msgpackr-extract/msgpackr-extract-linux-arm@2.0.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @msgpackr-extract/msgpackr-extract-linux-arm64@2.0.2: The CPU architecture "x64" is incompatible with this module.
7:19:19 PM: info "@msgpackr-extract/msgpackr-extract-linux-arm64@2.0.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: info @msgpackr-extract/msgpackr-extract-win32-x64@2.0.2: The platform "linux" is incompatible with this module.
7:19:19 PM: info "@msgpackr-extract/msgpackr-extract-win32-x64@2.0.2" is an optional dependency and failed compatibility check. Excluding it from installation.
7:19:19 PM: [3/4] Linking dependencies...
7:19:19 PM: warning "@emotion/react > @emotion/babel-plugin@11.9.2" has unmet peer dependency "@babel/core@^7.0.0".
7:19:19 PM: warning "@emotion/react > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.18.6" has unmet peer dependency "@babel/core@^7.0.0-0".
7:19:19 PM: warning "gatsby > eslint-config-react-app@6.0.0" has unmet peer dependency "babel-eslint@^10.0.0".
7:19:19 PM: warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.21.0" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
7:19:19 PM: warning "gatsby > gatsby-parcel-config > @gatsbyjs/parcel-namer-relative-to-cwd@1.2.0" has incorrect peer dependency "@parcel/namer-default@2.5.0".
7:19:19 PM: warning "gatsby > react-dev-utils > fork-ts-checker-webpack-plugin@6.5.2" has unmet peer dependency "typescript@>= 2.7".
7:19:19 PM: warning "gatsby > eslint-plugin-graphql > graphql-config > @endemolshinegroup/cosmiconfig-typescript-loader > ts-node@9.1.1" has unmet peer dependency "typescript@>=2.7".
7:19:19 PM: warning " > gatsby-plugin-image@2.17.0" has unmet peer dependency "@babel/core@^7.12.3".
7:19:19 PM: warning "gatsby-plugin-netlify > webpack-assets-manifest@5.1.0" has unmet peer dependency "webpack@^5.2.0".
7:19:19 PM: warning " > gatsby-source-contentful@7.15.0" has unmet peer dependency "sharp@^0.30.1".
7:19:19 PM: warning " > react-share@4.4.0" has incorrect peer dependency "react@^16.3.0 || ^17".
7:19:19 PM: warning " > styled-components@5.3.5" has unmet peer dependency "react-is@>= 16.8.0".
7:19:41 PM: [4/4] Building fresh packages...
7:19:46 PM: Done in 64.31s.
7:19:46 PM: NPM modules installed using Yarn
7:19:46 PM: Started restoring cached go cache
7:19:46 PM: Finished restoring cached go cache
7:19:46 PM: Installing Go version 1.17 (requested 1.17)
7:19:52 PM: unset GOOS;
7:19:52 PM: unset GOARCH;
7:19:52 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
7:19:52 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
7:19:52 PM: go version >&2;
7:19:52 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
7:19:52 PM: go version go1.17 linux/amd64
7:19:52 PM: Installing missing commands
7:19:52 PM: Verify run directory
7:19:53 PM: ​
7:19:53 PM: ────────────────────────────────────────────────────────────────
7:19:53 PM:   Netlify Build                                                 
7:19:53 PM: ────────────────────────────────────────────────────────────────
7:19:53 PM: ​
7:19:53 PM: ❯ Version
7:19:53 PM:   @netlify/build 27.3.3
7:19:53 PM: ​
7:19:53 PM: ❯ Flags
7:19:53 PM:   baseRelDir: true
7:19:53 PM:   buildId: 62c6eb389ed7b80008bd0cda
7:19:53 PM:   deployId: 62c6eb389ed7b80008bd0cdc
7:19:53 PM: ​
7:19:53 PM: ❯ Current directory
7:19:53 PM:   /opt/build/repo
7:19:53 PM: ​
7:19:53 PM: ❯ Config file
7:19:53 PM:   No config file was defined: using default values.
7:19:53 PM: ​
7:19:53 PM: ❯ Context
7:19:53 PM:   production
7:19:53 PM: ​
7:19:53 PM: ❯ Installing plugins
7:19:53 PM:    - @netlify/plugin-gatsby@3.2.4
7:20:05 PM: ​
7:20:05 PM: ❯ Loading plugins
7:20:05 PM:    - @netlify/plugin-gatsby@3.2.4 from Netlify app
7:20:07 PM: ​
7:20:07 PM: ────────────────────────────────────────────────────────────────
7:20:07 PM:   1. @netlify/plugin-gatsby (onPreBuild event)                  
7:20:07 PM: ────────────────────────────────────────────────────────────────
7:20:07 PM: ​
7:20:07 PM: No Gatsby cache found. Building fresh.
7:20:07 PM: ​
7:20:07 PM: (@netlify/plugin-gatsby onPreBuild completed in 18ms)
7:20:07 PM: ​
7:20:07 PM: ────────────────────────────────────────────────────────────────
7:20:07 PM:   2. Build command from Netlify app                             
7:20:07 PM: ────────────────────────────────────────────────────────────────
7:20:07 PM: ​
7:20:07 PM: $ yarn build
7:20:07 PM: yarn run v1.22.10
7:20:07 PM: $ gatsby build
7:20:10 PM: success compile gatsby files - 0.931s
7:20:10 PM: success load gatsby config - 0.025s
7:20:11 PM: success load plugins - 0.748s
7:20:11 PM: success onPreInit - 0.006s
7:20:11 PM: success initialize cache - 0.066s
7:20:11 PM: success copy gatsby files - 0.112s
7:20:11 PM: success Compiling Gatsby Functions - 0.200s
7:20:11 PM: success onPreBootstrap - 0.210s
7:20:11 PM: success createSchemaCustomization - 0.113s
7:20:12 PM: success Contentful: Sync all items - 0.166s - 47/47 283.19/s
7:20:12 PM: success Contentful: Fetch data - 0.442s
7:20:12 PM: info Contentful: 24 new entries
7:20:12 PM: info Contentful: 9 updated entries
7:20:12 PM: info Contentful: 0 deleted entries
7:20:12 PM: info Contentful: 0 cached entries
7:20:12 PM: info Contentful: 14 new assets
7:20:12 PM: info Contentful: 0 updated assets
7:20:12 PM: info Contentful: 0 cached assets
7:20:12 PM: info Contentful: 0 deleted assets
7:20:12 PM: info Creating 1 Contentful Home nodes
7:20:12 PM: info Creating 3 Contentful Teaser Component nodes
7:20:12 PM: info Creating 2 Contentful Article Template nodes
7:20:12 PM: info Creating 1 Contentful FAQ nodes
7:20:12 PM: info Creating 3 Contentful FAQ Question Template nodes
7:20:12 PM: info Creating 4 Contentful FAQ Question Answer Section nodes
7:20:12 PM: info Creating 1 Contentful App Status Page nodes
7:20:12 PM: info Creating 6 Contentful Services Status nodes
7:20:12 PM: info Creating 1 Contentful Footer nodes
7:20:12 PM: info Creating 1 Contentful Footer Queries Section nodes
7:20:12 PM: info Creating 1 Contentful Our Best Feature Section nodes
7:20:12 PM: info Creating 6 Contentful Feature nodes
7:20:12 PM: info Creating 1 Contentful Topics nodes
7:20:12 PM: info Creating 1 Contentful Stay In Touch nodes
7:20:12 PM: info Creating 1 Contentful Single Topic nodes
7:20:12 PM: info Creating 14 Contentful asset nodes
7:20:12 PM: success Contentful: Create nodes - 0.141s
7:20:12 PM: success Contentful: Process data - 0.173s
7:20:12 PM: success Checking for changed pages - 0.000s
7:20:12 PM: success source and transform nodes - 0.807s
7:20:13 PM: info Writing GraphQL type definitions to /opt/build/repo/.cache/schema.gql
7:20:15 PM: success building schema - 2.997s
7:20:15 PM: success createPages - 0.084s
7:20:15 PM: success createPagesStatefully - 0.203s
7:20:15 PM: info Total nodes: 107, SitePage nodes: 7 (use --verbose for breakdown)
7:20:15 PM: success Checking for changed pages - 0.000s
7:20:15 PM: success onPreExtractQueries - 0.000s
7:20:21 PM: success extract queries from components - 5.518s
7:20:21 PM: success write out redirect data - 0.002s
7:20:21 PM: success onPostBootstrap - 0.001s
7:20:21 PM: info bootstrap finished - 14.241s
7:20:21 PM: success write out requires - 0.005s
7:20:58 PM: success Building production JavaScript and CSS bundles - 36.481s
7:21:12 PM: <w> [webpack.cache.PackFileCacheStrategy] Skipped not serializable cache item 'mini-css-extract-plugin /opt/build/repo/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[1]!/opt/build/repo/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[2]!/opt/build/repo/src/assets/css/layout.css|0|Compilation/modules|/opt/build/repo/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[1]!/opt/build/repo/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[10].oneOf[1].use[2]!/opt/build/repo/src/assets/css/layout.css': No serializer registered for Warning
7:21:12 PM: <w> while serializing webpack/lib/cache/PackFileCacheStrategy.PackContentItems -> webpack/lib/NormalModule -> Array { 1 items } -> webpack/lib/ModuleWarning -> Warning
7:21:14 PM: success Building HTML renderer - 16.204s
7:21:14 PM: success Execute page configs - 0.022s
7:21:14 PM: success Caching Webpack compilations - 0.000s
7:21:23 PM: success run queries in workers - 9.090s - 8/8 0.88/s
7:21:23 PM: success Merge worker state - 0.001s
7:21:23 PM: success Rewriting compilation hashes - 0.004s
7:21:23 PM: success Writing page-data.json files to public directory - 0.004s - 7/7 1745.23/s
7:54:32 PM: Build exceeded maximum allowed runtime

Hey @bugattie,

It looks like the site (or the deploy) has been deleted. Do you still need help?

I’m experiencing a similar problem.

fyi: Complete build log at /teams/davidsabine/builds/62c83b210310d123bbf6bad9

10:11:45 AM: Build ready to start
10:11:47 AM: build-image version: ac716c5be7f79fe384a0f3759e8ef612cb821a37 (xenial)
10:11:47 AM: build-image tag: v3.13.0
10:11:47 AM: buildbot version: ed990b4b6588208e959ba45b6b7b05738f8b6004
10:11:47 AM: Fetching cached dependencies
10:11:47 AM: Failed to fetch cache, continuing with build
10:11:47 AM: Starting to prepare the repo for build
10:11:47 AM: No cached dependencies found. Cloning fresh repo
.
.
.
et cetera!! (I deleted a bunch here)
.
.
.
10:14:07 AM: ────────────────────────────────────────────────────────────────
10:14:07 AM:   Netlify Build                                                 
10:14:07 AM: ────────────────────────────────────────────────────────────────
10:14:07 AM: ​
10:14:07 AM: ❯ Version
10:14:07 AM:   @netlify/build 27.3.3
10:14:07 AM: ​
10:14:07 AM: ❯ Flags
10:14:07 AM:   baseRelDir: true
10:14:07 AM:   buildId: 62c83b210310d123bbf6bad7
10:14:07 AM:   deployId: 62c83b210310d123bbf6bad9
10:14:07 AM: ​
10:14:07 AM: ❯ Current directory
10:14:07 AM:   /opt/build/repo
10:14:07 AM: ​
10:14:07 AM: ❯ Config file
10:14:07 AM:   /opt/build/repo/netlify.toml
10:14:07 AM: ​
10:14:07 AM: ❯ Context
10:14:07 AM:   production
10:14:07 AM: ​
10:14:07 AM: ❯ Installing plugins
10:14:07 AM:    - netlify-plugin-gatsby-cache@0.3.0
10:14:08 AM: ​
10:14:08 AM: ❯ Loading plugins
10:14:08 AM:    - netlify-plugin-gatsby-cache@0.3.0 from netlify.toml
10:14:09 AM: ​
10:14:09 AM: ────────────────────────────────────────────────────────────────
10:14:09 AM:   1. netlify-plugin-gatsby-cache (onPreBuild event)             
10:14:09 AM: ────────────────────────────────────────────────────────────────
10:14:09 AM: ​
10:14:09 AM: No Gatsby cache found. Building fresh.
10:14:09 AM: ​
10:14:09 AM: (netlify-plugin-gatsby-cache onPreBuild completed in 11ms)
10:14:09 AM: ​
10:14:09 AM: ────────────────────────────────────────────────────────────────
10:14:09 AM:   2. Build command from Netlify app                             
10:14:09 AM: ────────────────────────────────────────────────────────────────
10:14:09 AM: ​
10:14:09 AM: $ git submodule update --init --recursive && yarn workspace site build --log-pages
.
.
.
et cetera!! (I deleted a bunch here)
.
.
.
10:16:44 AM: success run queries in workers - 75.768s - 117/117 1.54/s
10:18:48 AM: success Running gatsby-plugin-sharp.IMAGE_PROCESSING jobs - 197.506s - 281/281 1.42/s
10:18:48 AM: success Merge worker state - 0.007s
10:18:48 AM: success Rewriting compilation hashes - 0.212s
10:18:48 AM: success Writing page-data.json files to public directory - 0.159s - 107/107 674.85/s
10:47:46 AM: Build exceeded maximum allowed runtime
10:47:46 AM: info deleted directory at /opt/build/repo/gatsby-theme-style/src/assets/images/icons/fontawesome

Note the gap in time from 10:18:48 AM to 10:47:46 AM.

Is there some way to see verbose logs to learn what happened in those 30 minutes?

Hi @hrishikesh, are you able to see whether only @bugattie and I are the only two affected? Or is this more widespread?

I should add:

  • It appears to occur while “writing page-data.json files to public directory”
  • and then 30 minutes later, there’s a long list of messages “deleted directory (or file) at /path/path/path”

FALSE ALARM - in my case.

Will return to this if/when I have time to explain.

But basically: I updated the Gatsby version and (for reasons I can’t explain) I was able to get a little further into the build process and see more output in the logs). With that information I was able to find root cause: which was, I was getting an unexpected value from a graphql query.