ECONNRESET thrown @ gatsby-source-wordpress sourceNodes lifecycle | local build fine, Netlify build fails @ wp-json request

On my local machine where the build succeeds, the first line after gatsby-source-wordpress verbose START PLUGIN output is "Detected ACF to REST namespace: acf/v3 – on Netlify it never makes it to this point. See @ 4:17:55 PM: The request failed with error code "ECONNRESET"

My hunch is that perhaps it’s related to DNS issues. As attempts to control throttling Gatsby did not help.

Wordpress/GoDaddy site is hosted @ https://dev.opensourcenorth.com for pulling in GraphQL data
Netlify site is @ https://netlify.opensourcenorth.com || https://opensourcenorth.com/

Node v13.7
Wordpress v5.6

NETLIFY BUILD FAIL LOG —
4:15:49 PM: Build ready to start
4:15:51 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
4:15:51 PM: build-image tag: v3.6.1
4:15:51 PM: buildbot version: d35018babe252245044d3565f193fa426818b4b1
4:15:51 PM: Building without cache
4:15:51 PM: Starting to prepare the repo for build
4:15:52 PM: No cached dependencies found. Cloning fresh repo
4:15:52 PM: git clone https://github.com/sdgOSN/OSN2020
4:15:58 PM: Preparing Git Reference refs/heads/master
4:15:59 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘frontend/public’ versus ‘public’ in the Netlify UI
4:15:59 PM: Starting build script
4:15:59 PM: Installing dependencies
4:15:59 PM: Python version set to 2.7
4:16:01 PM: Downloading and installing node v13.7.0…
4:16:01 PM: Downloading https://nodejs.org/dist/v13.7.0/node-v13.7.0-linux-x64.tar.xz
4:16:01 PM: Computing checksum with sha256sum
4:16:01 PM: Checksums matched!
4:16:04 PM: Now using node v13.7.0 (npm v6.13.6)
4:16:04 PM: Started restoring cached build plugins
4:16:04 PM: Finished restoring cached build plugins
4:16:05 PM: Attempting ruby version 2.6.2, read from environment
4:16:06 PM: Using ruby version 2.6.2
4:16:06 PM: Using PHP version 5.6
4:16:06 PM: Started restoring cached node modules
4:16:06 PM: Finished restoring cached node modules
4:16:06 PM: Installing NPM modules using NPM version 6.13.6
4:16:09 PM: npm WARN deprecated @hapi/joi@15.1.1: Switch to ‘npm install joi’
4:16:11 PM: npm WARN deprecated request@2.88.2: request has been deprecated, see Request’s Past, Present and Future · Issue #3142 · request/request · GitHub
4:16:11 PM: npm WARN deprecated @types/ink@2.0.3: This is a stub types definition. ink provides its own type definitions, so you do not need this installed.
4:16:12 PM: npm WARN deprecated core-js@2.6.12: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
4:16:13 PM: npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
4:16:13 PM: npm WARN deprecated eslint-loader@2.2.1: This loader has been deprecated. Please use eslint-webpack-plugin
4:16:15 PM: npm WARN deprecated @hapi/address@2.1.4: Moved to ‘npm install @sideway/address’
4:16:15 PM: npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
4:16:15 PM: npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
4:16:15 PM: npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
4:16:16 PM: npm WARN deprecated cheerio-select-tmp@0.1.1: Use cheerio-select instead
4:16:18 PM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
4:16:19 PM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
4:16:22 PM: npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · visionmedia/debug · GitHub)
4:16:26 PM: npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
4:16:29 PM: npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
4:16:29 PM: npm WARN deprecated resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
4:16:29 PM: npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
4:16:29 PM: npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see Request’s Past, Present and Future · Issue #3142 · request/request · GitHub
4:17:26 PM: > deasync@0.1.21 install /opt/build/repo/frontend/node_modules/deasync
4:17:26 PM: > node ./build.js
4:17:26 PM: linux-x64-node-13 exists; testing
4:17:26 PM: Binary is fine; exiting
4:17:27 PM: > sharp@0.27.1 install /opt/build/repo/frontend/node_modules/sharp
4:17:27 PM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
4:17:29 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-linux-x64.tar.br
4:17:31 PM: > node-sass@4.14.1 install /opt/build/repo/frontend/node_modules/node-sass
4:17:31 PM: > node scripts/install.js
4:17:32 PM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-79_binding.node
4:17:32 PM: Download complete
4:17:32 PM: Binary saved to /opt/build/repo/frontend/node_modules/node-sass/vendor/linux-x64-79/binding.node
4:17:32 PM: Caching binary to /opt/buildhome/.npm/node-sass/4.14.1/linux-x64-79_binding.node
4:17:33 PM: > core-js@2.6.12 postinstall /opt/build/repo/frontend/node_modules/babel-runtime/node_modules/core-js
4:17:33 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
4:17:33 PM: > core-js@3.8.3 postinstall /opt/build/repo/frontend/node_modules/core-js
4:17:33 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
4:17:33 PM: > core-js-pure@3.8.3 postinstall /opt/build/repo/frontend/node_modules/core-js-pure
4:17:33 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
4:17:34 PM: > core-js@2.6.12 postinstall /opt/build/repo/frontend/node_modules/parcel-bundler/node_modules/core-js
4:17:34 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
4:17:35 PM: > gatsby-telemetry@1.10.0 postinstall /opt/build/repo/frontend/node_modules/gatsby-telemetry
4:17:35 PM: > node src/postinstall.js || true
4:17:35 PM: > mozjpeg@7.0.0 postinstall /opt/build/repo/frontend/node_modules/mozjpeg
4:17:35 PM: > node lib/install.js
4:17:35 PM: :heavy_check_mark: mozjpeg pre-build test passed successfully
4:17:35 PM: > pngquant-bin@6.0.0 postinstall /opt/build/repo/frontend/node_modules/pngquant-bin
4:17:35 PM: > node lib/install.js
4:17:36 PM: :heavy_check_mark: pngquant pre-build test passed successfully
4:17:36 PM: > gatsby-cli@2.19.1 postinstall /opt/build/repo/frontend/node_modules/gatsby-cli
4:17:36 PM: > node scripts/postinstall.js
4:17:36 PM: > gatsby@2.32.2 postinstall /opt/build/repo/frontend/node_modules/gatsby
4:17:36 PM: > node scripts/postinstall.js
4:17:36 PM: > node-sass@4.14.1 postinstall /opt/build/repo/frontend/node_modules/node-sass
4:17:36 PM: > node scripts/build.js
4:17:37 PM: Binary found at /opt/build/repo/frontend/node_modules/node-sass/vendor/linux-x64-79/binding.node
4:17:37 PM: Testing binary
4:17:37 PM: Binary is fine
4:17:37 PM: > parcel-bundler@1.12.4 postinstall /opt/build/repo/frontend/node_modules/parcel-bundler
4:17:37 PM: > node -e “console.log(’\u001b[35m\u001b[1mLove Parcel? You can now donate to our open collective:\u001b[22m\u001b[39m\n > \u001b[34mhttps://opencollective.com/parcel/donate\u001b[0m’)”
4:17:37 PM: Love Parcel? You can now donate to our open collective:
4:17:37 PM: > Contribute to Parcel - Open Collective
4:17:39 PM: npm notice created a lockfile as package-lock.json. You should commit this file.
4:17:39 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/chokidar/node_modules/fsevents):
4:17:39 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
4:17:39 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
4:17:39 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
4:17:39 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/webpack-dev-server/node_modules/chokidar/node_modules/fsevents):
4:17:39 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
4:17:39 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@parcel/watcher/node_modules/chokidar/node_modules/fsevents):
4:17:39 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
4:17:39 PM: npm WARN bootstrap@4.6.0 requires a peer of popper.js@^1.16.1 but none is installed. You must install peer dependencies yourself.
4:17:39 PM: npm WARN tsutils@3.20.0 requires a peer of 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 but none is installed. You must install peer dependencies yourself.
4:17:39 PM: npm WARN ts-node@9.1.1 requires a peer of typescript@>=2.7 but none is installed. You must install peer dependencies yourself.
4:17:39 PM: npm WARN Open-Source-North@0.1.0 No repository field.
4:17:39 PM: added 2842 packages from 1561 contributors and audited 2854 packages in 92.262s
4:17:41 PM: 206 packages are looking for funding
4:17:41 PM: run npm fund for details
4:17:41 PM: found 1 high severity vulnerability
4:17:41 PM: run npm audit fix to fix them, or npm audit for details
4:17:41 PM: NPM modules installed
4:17:42 PM: Started restoring cached go cache
4:17:42 PM: Finished restoring cached go cache
4:17:42 PM: Installing Go version 1.12
4:17:48 PM: unset GOOS;
4:17:48 PM: unset GOARCH;
4:17:48 PM: export GOROOT=’/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64’;
4:17:48 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:{PATH}"; 4:17:48 PM: go version >&2; 4:17:48 PM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env" 4:17:48 PM: go version go1.12 linux/amd64 4:17:48 PM: Installing missing commands 4:17:48 PM: Verify run directory 4:17:49 PM: ​ 4:17:49 PM: ──────────────────────────────────────────────────────────────── 4:17:49 PM: Netlify Build 4:17:49 PM: ──────────────────────────────────────────────────────────────── 4:17:49 PM: ​ 4:17:49 PM: ❯ Version 4:17:49 PM: @netlify/build 9.0.0 4:17:49 PM: ​ 4:17:49 PM: ❯ Flags 4:17:49 PM: deployId: 601c721552ce4e011f1297ba 4:17:49 PM: mode: buildbot 4:17:49 PM: ​ 4:17:49 PM: ❯ Current directory 4:17:49 PM: /opt/build/repo/frontend 4:17:50 PM: ​ 4:17:50 PM: ❯ Config file 4:17:50 PM: /opt/build/repo/frontend/netlify.toml 4:17:50 PM: ​ 4:17:50 PM: ❯ Context 4:17:50 PM: production 4:17:50 PM: ​ 4:17:50 PM: ──────────────────────────────────────────────────────────────── 4:17:50 PM: 1. build.command from netlify.toml 4:17:50 PM: ──────────────────────────────────────────────────────────────── 4:17:50 PM: ​ 4:17:50 PM: npm run build
4:17:50 PM: > Open-Source-North@0.1.0 build /opt/build/repo/frontend
4:17:50 PM: > npm run clean && gatsby build
4:17:50 PM: > Open-Source-North@0.1.0 clean /opt/build/repo/frontend
4:17:50 PM: > rm -fr .cache/ ./public/
4:17:53 PM: error (node:1845) ExperimentalWarning: Package name self resolution is an experimental feature. This feature could change at any time
4:17:53 PM: error (node:1845) ExperimentalWarning: Conditional exports is an experimental feature. This feature could change at any time
4:17:54 PM: success open and validate gatsby-configs - 0.061s
4:17:54 PM: success load plugins - 0.803s
4:17:54 PM: success onPreInit - 0.138s
4:17:54 PM: success delete html and css files from previous builds - 0.003s
4:17:54 PM: success initialize cache - 0.006s
4:17:55 PM: success copy gatsby files - 0.051s
4:17:55 PM:
4:17:55 PM: warning [gatsby-source-wordpress]
4:17:55 PM: This version of gatsby-source-wordpress will be deprecated soon.
4:17:55 PM: The next major version (v4) is a complete rewrite in order to take advantage of WPGraphQL.
4:17:55 PM: This allows us to support features like Preview and incremental builds and provides a much more stable experience.
4:17:55 PM: Please upgrade to the BETA of gatsby-source-wordpress@v4 by installing gatsby-source-wordpress-experimental.
4:17:55 PM: These two packages are currently published under separate names to allow activating them side-by-side.
4:17:55 PM: This makes migration between the two simpler.
4:17:55 PM: Once the new plugin is stable it will be merged back in and published as gatsby-source-wordpress going forward.
4:17:55 PM: Read this blog post for the beta announcement:
4:17:55 PM: https://www.gatsbyjs.org/blog/2020-07-07-wordpress-source-beta/
4:17:55 PM: Or get started with the new plugin here:
4:17:55 PM: GitHub - gatsbyjs/gatsby-source-wordpress-experimental: The upcoming v4 of gatsby-source-wordpress, currently in beta
4:17:55 PM: You can minimize this notice using the minimizeDeprecationNotice plugin option:
4:17:55 PM: {
4:17:55 PM: resolve: “gatsby-source-wordpress”,
4:17:55 PM: options: {
4:17:55 PM: minimizeDeprecationNotice: true
4:17:55 PM: },
4:17:55 PM: },
4:17:55 PM: success onPreBootstrap - 0.020s
4:17:55 PM: success createSchemaCustomization - 0.006s
4:17:55 PM:
4:17:55 PM: =START PLUGIN=====================================
4:17:55 PM: Site URL: https://dev.opensourcenorth.com
4:17:55 PM: Site hosted on Wordpress.com: false
4:17:55 PM: Using ACF: true
4:17:55 PM: Auth: false
4:17:55 PM: Verbose output: true
4:17:55 PM: Mama Route URL: https://dev.opensourcenorth.com/wp-json
4:17:55 PM:
4:17:55 PM: The request failed with error code “ECONNRESET”
4:17:55 PM: error “gatsby-source-wordpress” threw an error while running the sourceNodes lifecycle:
4:17:55 PM: Cannot read property ‘data’ of undefined
4:17:55 PM:
4:17:55 PM:
4:17:55 PM: TypeError: Cannot read property ‘data’ of undefined
4:17:55 PM:
4:17:55 PM: - fetch.js:142 fetch
4:17:55 PM: [frontend]/[gatsby-source-wordpress]/fetch.js:142:21
4:17:55 PM:
4:17:55 PM: - task_queues.js:97 processTicksAndRejections
4:17:55 PM: internal/process/task_queues.js:97:5
4:17:55 PM:
4:17:55 PM:
4:17:55 PM: not finished source and transform nodes - 0.249s
4:17:55 PM: npm ERR! code ELIFECYCLE
4:17:55 PM: npm ERR! errno 1
4:17:55 PM: npm ERR! Open-Source-North@0.1.0 build: npm run clean && gatsby build
4:17:55 PM: npm ERR! Exit status 1
4:17:55 PM: npm ERR!
4:17:55 PM: npm ERR! Failed at the Open-Source-North@0.1.0 build script.
4:17:55 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
4:17:55 PM: npm ERR! A complete log of this run can be found in:
4:17:55 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-02-04T22_17_55_421Z-debug.log
4:17:55 PM: ​
4:17:55 PM: ────────────────────────────────────────────────────────────────
4:17:55 PM: “build.command” failed
4:17:55 PM: ────────────────────────────────────────────────────────────────
4:17:55 PM: ​
4:17:55 PM: Error message
4:17:55 PM: Command failed with exit code 1: npm run build
4:17:55 PM: ​
4:17:55 PM: Error location
4:17:55 PM: In build.command from netlify.toml:
4:17:55 PM: npm run build
4:17:55 PM: ​
4:17:55 PM: Resolved config
4:17:55 PM: build:
4:17:55 PM: base: /opt/build/repo/frontend
4:17:55 PM: command: npm run build
4:17:55 PM: commandOrigin: config
4:17:55 PM: environment:
4:17:55 PM: - GATSBY_CONCURRENT_DOWNLOAD
4:17:55 PM: - NODE_VERSION
4:17:55 PM: - YARN_VERSION
4:17:55 PM: - YARN_FLAGS
4:17:55 PM: publish: /opt/build/repo/frontend/public
4:17:55 PM: Caching artifacts
4:17:55 PM: Started saving node modules
4:17:55 PM: Finished saving node modules
4:17:55 PM: Started saving build plugins
4:17:55 PM: Finished saving build plugins
4:17:55 PM: Started saving pip cache
4:17:55 PM: Finished saving pip cache
4:17:55 PM: Started saving emacs cask dependencies
4:17:55 PM: Finished saving emacs cask dependencies
4:17:55 PM: Started saving maven dependencies
4:17:55 PM: Finished saving maven dependencies
4:17:55 PM: Started saving boot dependencies
4:17:55 PM: Finished saving boot dependencies
4:17:55 PM: Started saving rust rustup cache
4:17:55 PM: Finished saving rust rustup cache
4:17:55 PM: Started saving go dependencies
4:17:57 PM: Finished saving go dependencies
4:18:00 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:18:00 PM: Failing build: Failed to build site
4:18:00 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
4:18:00 PM: Finished processing build request in 2m9.307452455s

Hi, @drew.bluske. I believe there is also an open support ticket about this same issue.

The issue appears to be caused by authentication issues when connecting to the remote site. Netlify doesn’t have any additional information about why the authentication failures occur.

You might want to look at the documentation from that plugin creator to find out how to debug these connection errors.

More recent builds of this same site show a number of 401 errors which further supports this being authentication related.

​Please let us know if there are other questions about this.