Gatsby deploy returns SIGKILL (it works locally)

Hello! I’m trying to deploy my website by means of

gatsby build

And while locally it works ok, on Netlify I’m getting a SIGKILL and no real explanation.

My website is at gianlucabelvisi.com
Git repo is: https://github.com/gianlucabelvisi/gianlucabelvisi.com.git

3:50:59 PM: Build ready to start
3:51:01 PM: build-image version: 0582042f4fc261adc7bd8333f34884959c577302
3:51:01 PM: build-image tag: v3.7.6
3:51:01 PM: buildbot version: 3934dc3e65fec0466cd25051c676f6e727c64ab1
3:51:01 PM: Building without cache
3:51:01 PM: Starting to prepare the repo for build
3:51:01 PM: No cached dependencies found. Cloning fresh repo
3:51:01 PM: git clone https://github.com/gianlucabelvisi/personalpage
3:51:03 PM: Preparing Git Reference refs/heads/master
3:51:04 PM: Parsing package.json dependencies
3:51:05 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'public' versus 'public/' in the Netlify UI
3:51:05 PM: Starting build script
3:51:05 PM: Installing dependencies
3:51:05 PM: Python version set to 2.7
3:51:06 PM: Attempting node version 'v16.1.0' from .nvmrc
3:51:06 PM: Downloading and installing node v16.1.0...
3:51:06 PM: Downloading https://nodejs.org/dist/v16.1.0/node-v16.1.0-linux-x64.tar.xz...
3:51:07 PM: Computing checksum with sha256sum
3:51:07 PM: Checksums matched!
3:51:10 PM: Now using node v16.1.0 (npm v7.11.2)
3:51:10 PM: Started restoring cached build plugins
3:51:10 PM: Finished restoring cached build plugins
3:51:10 PM: Attempting ruby version 2.7.1, read from environment
3:51:12 PM: Using ruby version 2.7.1
3:51:12 PM: Using PHP version 5.6
3:51:12 PM: Started restoring cached node modules
3:51:12 PM: Finished restoring cached node modules
3:51:12 PM: Installing NPM modules using NPM version 7.11.2
3:51:26 PM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
3:51:26 PM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
3:51:29 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
3:51:43 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
3:51:44 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
3:51:44 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
3:51:45 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
3:51:45 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
3:51:47 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
3:51:56 PM: npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
3:52:03 PM: added 2297 packages, and audited 2298 packages in 51s
3:52:03 PM: 280 packages are looking for funding
3:52:03 PM:   run `npm fund` for details
3:52:03 PM: 22 vulnerabilities (17 moderate, 5 high)
3:52:03 PM: To address issues that do not require attention, run:
3:52:03 PM:   npm audit fix
3:52:03 PM: To address all issues possible (including breaking changes), run:
3:52:03 PM:   npm audit fix --force
3:52:03 PM: Some issues need review, and may require choosing
3:52:03 PM: a different dependency.
3:52:03 PM: Run `npm audit` for details.
3:52:04 PM: NPM modules installed
3:52:04 PM: Started restoring cached go cache
3:52:04 PM: Finished restoring cached go cache
3:52:04 PM: go version go1.14.4 linux/amd64
3:52:04 PM: go version go1.14.4 linux/amd64
3:52:04 PM: Installing missing commands
3:52:04 PM: Verify run directory
3:52:06 PM: ​
3:52:06 PM: ────────────────────────────────────────────────────────────────
3:52:06 PM:   Netlify Build                                                 
3:52:06 PM: ────────────────────────────────────────────────────────────────
3:52:06 PM: ​
3:52:06 PM: ❯ Version
3:52:06 PM:   @netlify/build 11.17.0
3:52:06 PM: ​
3:52:06 PM: ❯ Flags
3:52:06 PM:   deployId: 609fd1c383ec5af184038638
3:52:06 PM: ​
3:52:06 PM: ❯ Current directory
3:52:06 PM:   /opt/build/repo
3:52:06 PM: ​
3:52:06 PM: ❯ Config file
3:52:06 PM:   No config file was defined: using default values.
3:52:06 PM: ​
3:52:06 PM: ❯ Context
3:52:06 PM:   production
3:52:06 PM: ​
3:52:06 PM: ────────────────────────────────────────────────────────────────
3:52:06 PM:   1. Build command from Netlify app                             
3:52:06 PM: ────────────────────────────────────────────────────────────────
3:52:06 PM: ​
3:52:06 PM: $ gatsby build --verbose
3:52:07 PM: verbose 1.035803017 set gatsby_log_level: "verbose"
3:52:07 PM: verbose 1.037492119 set gatsby_executing_command: "build"
3:52:07 PM: verbose 1.03830031 loading local command from: /opt/build/repo/node_modules/gatsby/dist/commands/build.js
3:52:09 PM: verbose 2.94146894 running command: build
3:52:09 PM: success open and validate gatsby-configs - 0.063s
3:52:10 PM: success load plugins - 1.002s
3:52:10 PM: success onPreInit - 0.040s
3:52:10 PM: success initialize cache - 0.007s
3:52:10 PM: success copy gatsby files - 0.062s
3:52:10 PM: success onPreBootstrap - 0.019s
3:52:10 PM: success createSchemaCustomization - 0.016s
3:52:10 PM: verbose 4.513965613 Checking for deleted pages
3:52:10 PM: verbose 4.5146345 Deleted 0 pages
3:52:10 PM: verbose 4.514805307 Found 0 changed pages
3:52:10 PM: success Checking for changed pages - 0.001s
3:52:11 PM: success source and transform nodes - 0.294s
3:52:11 PM: success building schema - 0.798s
3:52:11 PM: success createPages - 0.095s
3:52:11 PM: success createPagesStatefully - 0.104s
3:52:12 PM: info Total nodes: 89, SitePage nodes: 9 (use --verbose for breakdown)
3:52:12 PM: verbose 5.51578795 Number of node types: 10. Nodes per type: SitePlugin: 38, Site: 1, SiteBuildMetadata: 1, SiteFunction: 1, Directory: 5, File: 20, ImageSharp: 8, MarkdownRemark: 2, TripsJson: 4, SitePage: 9
3:52:12 PM: verbose 5.515983024 Checking for deleted pages
3:52:12 PM: verbose 5.516363167 Deleted 0 pages
3:52:12 PM: verbose 5.516897951 Found 9 changed pages
3:52:12 PM: success Checking for changed pages - 0.000s
3:52:12 PM: success update schema - 0.130s
3:52:12 PM: success onPreExtractQueries - 0.000s
3:52:12 PM: error (node:1716) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /opt/build/repo/node_modules/postcss/package.json.
3:52:12 PM: Update this package.json to use a subpath pattern like "./*".
3:52:12 PM: (Use `node --trace-deprecation ...` to show where the warning was created)
3:52:18 PM: success extract queries from components - 6.448s
3:52:18 PM: success write out redirect data - 0.001s
3:52:18 PM: success Build manifest and related icons - 0.165s
3:52:18 PM: success onPostBootstrap - 0.168s
3:52:18 PM: info bootstrap finished - 12.270s
3:52:28 PM: success run static queries - 10.049s - 3/3 0.30/s
3:53:22 PM: success run page queries - 53.314s - 9/9 0.17/s
3:53:52 PM: success write out requires - 30.210s
3:54:08 PM: ​
3:54:08 PM: ────────────────────────────────────────────────────────────────
3:54:08 PM:   "build.command" failed                                        
3:54:08 PM: ────────────────────────────────────────────────────────────────
3:54:08 PM: ​
3:54:08 PM:   Error message
3:54:08 PM:   Command was killed with SIGKILL (Forced termination): gatsby build --verbose
3:54:08 PM: ​
3:54:08 PM:   Error location
3:54:08 PM:   In Build command from Netlify app:
3:54:08 PM:   gatsby build --verbose
3:54:08 PM: ​
3:54:08 PM:   Resolved config
3:54:08 PM:   build:
3:54:08 PM:     command: gatsby build --verbose
3:54:08 PM:     commandOrigin: ui
3:54:08 PM:     publish: /opt/build/repo/public
3:54:09 PM: Caching artifacts
3:54:09 PM: Started saving node modules
3:54:09 PM: Finished saving node modules
3:54:09 PM: Started saving build plugins
3:54:09 PM: Finished saving build plugins
3:54:09 PM: Started saving pip cache
3:54:09 PM: Finished saving pip cache
3:54:09 PM: Started saving emacs cask dependencies
3:54:09 PM: Finished saving emacs cask dependencies
3:54:09 PM: Started saving maven dependencies
3:54:09 PM: Finished saving maven dependencies
3:54:09 PM: Started saving boot dependencies
3:54:09 PM: Finished saving boot dependencies
3:54:09 PM: Started saving rust rustup cache
3:54:09 PM: Finished saving rust rustup cache
3:54:09 PM: Started saving go dependencies
3:54:09 PM: Finished saving go dependencies
3:54:13 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:54:13 PM: Creating deploy upload records
3:54:13 PM: Failing build: Failed to build site
3:54:13 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:54:13 PM: Finished processing build request in 3m12.419972264s

After many attempts by recreating the project from scratch and adding stuff until it broke, I isolated by original problem: it seems that the build failed because I was executing a static query on 4 images larger than 1MB each. Reducing the size of the images fixed it.

Makes me think that maybe the deploy job interrupts too soon? It didn’t seem like too much to ask for, and on my machine it works fine.

1 Like

Hey there, @gianlucabelvisi :wave:

Thanks so much for following up with your solution. This will definitely be beneficial for future Forums members who encounter something similar. I encourage you to check out Build Performance Pro Tips as well :slight_smile:

Hey Hillary, thank you!

2 Likes