Gridsome build fails with 401, Causes netlify deployment to hang

PLEASE help us help you by writing a good post!

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

Hello!

I’m attempting to deploy a gridsome app but am receiving 401 errors after netlify runs the “gridsome build” command. When this happens netlify shows that the build is deploying continuously and I have to manually cancel the deployment. I can run “gridsome build” locally with no errors.

I just created my netlify account and linked my github account this evening. There were a couple glitches on netlify’s side when linking my account.

In the Create a new site wizard, I clicked on the GitHub button under the Continuous Deployment section. I selected my repos and then hit ok and the window closed. I had to click the GitHub button again, which popped open the integration window before immediately closing itself again. Only then did I see my repos appear in the netlify UI.

I have tried deleting my netlify site and recreating, revoking GitHub access and regranting, and deploying several times, all with the same behavior.

site name: sleepy-panini-6dba62

Deploy Log:
11:11:39 PM: Build ready to start
11:11:40 PM: build-image version: 3571f0130496395a23bffe9820bc78b4f73a6234
11:11:40 PM: build-image tag: v3.7.0
11:11:40 PM: buildbot version: c469f7ab4d394d961ca036b1163fdbb6ef9fb78c
11:11:40 PM: Fetching cached dependencies
11:11:40 PM: Failed to fetch cache, continuing with build
11:11:40 PM: Starting to prepare the repo for build
11:11:41 PM: No cached dependencies found. Cloning fresh repo
11:11:41 PM: git clone https://github.com/FreshCourageTake/3DKeeb
11:11:43 PM: Preparing Git Reference refs/heads/master
11:11:44 PM: Starting build script
11:11:44 PM: Installing dependencies
11:11:44 PM: Python version set to 2.7
11:11:45 PM: v12.18.0 is already installed.
11:11:46 PM: Now using node v12.18.0 (npm v6.14.4)
11:11:46 PM: Started restoring cached build plugins
11:11:46 PM: Finished restoring cached build plugins
11:11:46 PM: Attempting ruby version 2.7.1, read from environment
11:11:47 PM: Using ruby version 2.7.1
11:11:47 PM: Using PHP version 5.6
11:11:47 PM: Started restoring cached yarn cache
11:11:47 PM: Finished restoring cached yarn cache
11:11:47 PM: Installing yarn at version 1.22.4
11:11:47 PM: Installing Yarn!
11:11:47 PM: > Downloading tarball…
11:11:47 PM: [1/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz → /tmp/yarn.tar.gz.3kHpKj8fXD
11:11:47 PM: % Total % Received % Xferd Average Speed Time Time Time Current
11:11:47 PM: Dload Upload Total Spent Left Speed
11:11:47 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
11:11:47 PM: 100 79 100 79 0 0 454 0 --:–:-- --:–:-- --:–:-- 456
11:11:47 PM: 100 93 100 93 0 0 223 0 --:–:-- --:–:-- --:–:-- 223
11:11:48 PM: 0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
11:11:48 PM: 100 625 100 625 0 0 875 0 --:–:-- --:–:-- --:–:-- 2376
11:11:48 PM: 100 1215k 100 1215k 0 0 1121k 0 0:00:01 0:00:01 --:–:-- 1121k
11:11:48 PM: [2/2]: https://yarnpkg.com/downloads/1.22.4/yarn-v1.22.4.tar.gz.asc → /tmp/yarn.tar.gz.3kHpKj8fXD.asc
11:11:48 PM: 100 83 100 83 0 0 1693 0 --:–:-- --:–:-- --:–:-- 1693
11:11:48 PM: 100 97 100 97 0 0 1272 0 --:–:-- --:–:-- --:–:-- 1272
11:11:48 PM: 100 629 100 629 0 0 6041 0 --:–:-- --:–:-- --:–:-- 6041
11:11:48 PM: 100 1028 100 1028 0 0 8716 0 --:–:-- --:–:-- --:–:-- 8716
11:11:48 PM: > Verifying integrity…
11:11:48 PM: gpg: Signature made Mon 09 Mar 2020 03:52:13 PM UTC using RSA key ID 69475BAA
11:11:48 PM: gpg: Good signature from “Yarn Packaging yarn@dan.cx
11:11:48 PM: gpg: WARNING: This key is not certified with a trusted signature!
11:11:48 PM: gpg: There is no indication that the signature belongs to the owner.
11:11:48 PM: Primary key fingerprint: 72EC F46A 56B4 AD39 C907 BBB7 1646 B01B 86E5 0310
11:11:48 PM: Subkey fingerprint: 6D98 490C 6F1A CDDD 448E 4595 4F77 6793 6947 5BAA
11:11:48 PM: > GPG signature looks good
11:11:48 PM: > Extracting to ~/.yarn…
11:11:48 PM: > Adding to $PATH…
11:11:49 PM: > Successfully installed Yarn 1.22.4! Please open another terminal where the yarn command will now be available.
11:11:49 PM: Started restoring cached node modules
11:11:49 PM: Finished restoring cached node modules
11:11:49 PM: Installing NPM modules using Yarn version 1.22.4
11:11:49 PM: yarn install v1.22.4
11:11:49 PM: [1/4] Resolving packages…
11:11:50 PM: [2/4] Fetching packages…
11:11:52 PM: warning mini-css-extract-plugin@0.5.0: Invalid bin field for “mini-css-extract-plugin”.
11:11:53 PM: warning url-loader@1.1.2: Invalid bin field for “url-loader”.
11:12:04 PM: info fsevents@1.2.13: The platform “linux” is incompatible with this module.
11:12:04 PM: info “fsevents@1.2.13” is an optional dependency and failed compatibility check. Excluding it from installation.
11:12:04 PM: info fsevents@2.1.3: The platform “linux” is incompatible with this module.
11:12:04 PM: info “fsevents@2.1.3” is an optional dependency and failed compatibility check. Excluding it from installation.
11:12:04 PM: [3/4] Linking dependencies…
11:12:04 PM: warning “gridsome-plugin-modal > vue-js-modal@1.3.35” has unmet peer dependency “vue@^2.2.6”.
11:12:04 PM: warning " > vue-recaptcha@1.3.0" has unmet peer dependency “vue@^2.0.0”.
11:12:04 PM: warning " > vue-select@3.11.2" has unmet peer dependency “vue@2.x”.
11:12:04 PM: warning " > vuex@3.6.2" has unmet peer dependency “vue@^2.0.0”.
11:12:04 PM: warning " > gridsome-plugin-pug@0.0.3" has incorrect peer dependency “pug@2”.
11:12:04 PM: warning “gridsome-plugin-pug > pug-loader@2.4.0” has incorrect peer dependency “pug@^2.0.0”.
11:12:12 PM: [4/4] Building fresh packages…
11:12:15 PM: Done in 26.07s.
11:12:15 PM: NPM modules installed using Yarn
11:12:15 PM: Started restoring cached go cache
11:12:15 PM: Finished restoring cached go cache
11:12:16 PM: go version go1.14.4 linux/amd64
11:12:16 PM: go version go1.14.4 linux/amd64
11:12:16 PM: Installing missing commands
11:12:16 PM: Verify run directory
11:12:17 PM: ​
11:12:17 PM: ────────────────────────────────────────────────────────────────
11:12:17 PM: Netlify Build
11:12:17 PM: ────────────────────────────────────────────────────────────────
11:12:17 PM: ​
11:12:17 PM: ❯ Version
11:12:17 PM: @netlify/build 9.9.5
11:12:17 PM: ​
11:12:17 PM: ❯ Flags
11:12:17 PM: apiHost: api.netlify.com
11:12:17 PM: cacheDir: /opt/build/cache
11:12:17 PM: deployId: 604da91b8d3ab114b3d38ff9
11:12:17 PM: mode: buildbot
11:12:17 PM: testOpts:
11:12:17 PM: silentLingeringProcesses: ‘’
11:12:17 PM: ​
11:12:17 PM: ❯ Current directory
11:12:17 PM: /opt/build/repo
11:12:17 PM: ​
11:12:17 PM: ❯ Config file
11:12:17 PM: No config file was defined: using default values.
11:12:17 PM: ​
11:12:17 PM: ❯ Context
11:12:17 PM: production
11:12:17 PM: ​
11:12:17 PM: ────────────────────────────────────────────────────────────────
11:12:17 PM: 1. Build command from Netlify app
11:12:17 PM: ────────────────────────────────────────────────────────────────
11:12:17 PM: ​
11:12:17 PM: $ gridsome build
11:12:17 PM: Gridsome v0.7.22
11:12:18 PM: Initializing plugins…
11:12:18 PM: Error: Request failed with status code 401
11:12:18 PM: at createError (/opt/build/repo/node_modules/@bageldb/bagel-db/node_modules/axios/lib/core/createError.js:16:15)
11:12:18 PM: at settle (/opt/build/repo/node_modules/@bageldb/bagel-db/node_modules/axios/lib/core/settle.js:17:12)
11:12:18 PM: at IncomingMessage.handleStreamEnd (/opt/build/repo/node_modules/@bageldb/bagel-db/node_modules/axios/lib/adapters/http.js:236:11)
11:12:18 PM: at IncomingMessage.emit (events.js:327:22)
11:12:18 PM: at endReadableNT (_stream_readable.js:1221:12)
11:12:18 PM: at processTicksAndRejections (internal/process/task_queues.js:84:21)
11:12:18 PM: ​
11:12:18 PM: ────────────────────────────────────────────────────────────────
11:12:18 PM: “build.command” failed
11:12:18 PM: ────────────────────────────────────────────────────────────────
11:12:18 PM: ​
11:12:18 PM: Error message
11:12:18 PM: Command failed with exit code 1: gridsome build
11:12:18 PM: ​
11:12:18 PM: Error location
11:12:18 PM: In Build command from Netlify app:
11:12:18 PM: gridsome build
11:12:18 PM: ​
11:12:18 PM: Resolved config
11:12:18 PM: build:
11:12:18 PM: command: gridsome build
11:12:18 PM: commandOrigin: ui
11:12:18 PM: publish: /opt/build/repo/dist
11:12:18 PM: Caching artifacts
11:12:18 PM: Started saving node modules
11:12:18 PM: Finished saving node modules
11:12:18 PM: Started saving build plugins
11:12:18 PM: Finished saving build plugins
11:12:18 PM: Started saving yarn cache
11:12:18 PM: Finished saving yarn cache
11:12:18 PM: Started saving pip cache
11:12:19 PM: Finished saving pip cache
11:12:19 PM: Started saving emacs cask dependencies
11:12:19 PM: Finished saving emacs cask dependencies
11:12:19 PM: Started saving maven dependencies
11:12:19 PM: Finished saving maven dependencies
11:12:19 PM: Started saving boot dependencies
11:12:19 PM: Finished saving boot dependencies
11:12:19 PM: Started saving rust rustup cache
11:12:19 PM: Finished saving rust rustup cache
11:12:19 PM: Started saving go dependencies
11:12:19 PM: Finished saving go dependencies
11:12:21 PM: Build script success
11:12:40 PM: Finished processing build request in 59.433667485s

401 is Unauthorized. Are you sure you’re using the correct credentials?

The correct credentials for what? I successfully logged into netlify, then I successfully linked my GitHub account to netlify, found my repo, and attempted the build/deploy.

Are there other credentials I need to be aware of?

BagelDB looks like a backend. So, that might be the one needing credentials?

My assumption would be, if not that, it’s one of the plugins that’s requesting data from somewhere that needs authorization.

1 Like

Oh awesome. That’s a good lead. Thank you!

It was, indeed, missing credentials for bageldb. Things are building fine now that I added those.

Thanks again!

1 Like