-1

In short - my site shows an "Error establishing a database connection" message. The deploy log shows that the error is in Gridsome. Deploy log below. Any tips for a N00b on how to resolve this issue and get the site live?

10:16:43 AM: Waiting for other deploys from your team to complete. Check the queue: https://app.netlify.com/teams/take-detroit-media/builds

10:17:50 AM: Build ready to start

10:17:52 AM: build-image version: c6001ed68662a13e5deb24abec2b46058c58248a

10:17:52 AM: build-image tag: v3.9.0

10:17:52 AM: buildbot version: 0f2f658d862cfe72bae7cc05c6a8de0426a5a0e2

10:17:52 AM: Building without cache

10:17:52 AM: Starting to prepare the repo for build

10:17:53 AM: No cached dependencies found. Cloning fresh repo

10:17:53 AM: git clone https://github.com/taketaketaketake/takedetroitwebsite

10:17:53 AM: Preparing Git Reference refs/heads/master

10:17:54 AM: Parsing package.json dependencies

10:17:54 AM: Starting build script

10:17:54 AM: Installing dependencies

10:17:54 AM: Python version set to 2.7

10:17:56 AM: Downloading and installing node v10.24.1...

10:17:56 AM: Downloading https://nodejs.org/dist/v10.24.1/node-v10.24.1-linux-x64.tar.xz...

10:17:56 AM: Computing checksum with sha256sum

10:17:56 AM: Checksums matched!

10:17:58 AM: Now using node v10.24.1 (npm v6.14.12)

10:17:58 AM: Started restoring cached build plugins

10:17:58 AM: Finished restoring cached build plugins

10:17:58 AM: Attempting ruby version 2.6.2, read from environment

10:17:59 AM: Using ruby version 2.6.2

10:18:00 AM: Using PHP version 5.6

10:18:00 AM: Started restoring cached node modules

10:18:00 AM: Finished restoring cached node modules

10:18:00 AM: Installing NPM modules using NPM version 6.14.12

10:18:25 AM: > sharp@0.23.4 install /opt/build/repo/node_modules/sharp

10:18:25 AM: > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

10:18:26 AM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-linux-x64.tar.gz

10:18:28 AM: > node-sass@4.13.1 install /opt/build/repo/node_modules/node-sass

10:18:28 AM: > node scripts/install.js

10:18:28 AM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/linux-x64-64_binding.node

10:18:28 AM: Download complete

10:18:28 AM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node

10:18:29 AM: Caching binary to /opt/buildhome/.npm/node-sass/4.13.1/linux-x64-64_binding.node

10:18:29 AM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/core-js

10:18:29 AM: > node -e "try{require('./postinstall')}catch(e){}"

10:18:29 AM: > swiper@4.5.1 postinstall /opt/build/repo/node_modules/swiper

10:18:29 AM: > node -e "console.log('\u001b[35m\u001b[1mLove Swiper? Support Vladimir's work by donating or pledging on patreon:\u001b[22m\u001b[39m\n > \u001b[32mhttps://patreon.com/vladimirkharlampidi\u001b[0m\n')"

10:18:29 AM: Love Swiper? Support Vladimir's work by donating or pledging on patreon:

https://patreon.com/vladimirkharlampidi

10:18:29 AM: > cwebp-bin@5.1.0 postinstall /opt/build/repo/node_modules/cwebp-bin

10:18:29 AM: > node lib/install.js

10:18:29 AM: ✔ cwebp pre-build test passed successfully

10:18:29 AM: > mozjpeg@6.0.1 postinstall /opt/build/repo/node_modules/mozjpeg

10:18:29 AM: > node lib/install.js

10:18:30 AM: ✔ mozjpeg pre-build test passed successfully

10:18:30 AM: > pngquant-bin@5.0.2 postinstall /opt/build/repo/node_modules/pngquant-bin

10:18:30 AM: > node lib/install.js

10:18:30 AM: ✔ pngquant pre-build test passed successfully

10:18:30 AM: > electron@7.2.3 postinstall /opt/build/repo/node_modules/electron

10:18:30 AM: > node install.js

10:18:36 AM: > node-sass@4.13.1 postinstall /opt/build/repo/node_modules/node-sass 10:18:36 AM: > node scripts/build.js

10:18:36 AM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node

10:18:36 AM: Testing binary

10:18:36 AM: Binary is fine

10:18:38 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):

10:18:38 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

10:18:38 AM: added 1777 packages from 802 contributors and audited 1846 packages in 37.765s

10:18:40 AM: 45 packages are looking for funding

10:18:40 AM: run npm fund for details

10:18:40 AM: found 867 vulnerabilities (343 low, 145 moderate, 378 high, 1 critical)

10:18:40 AM: run npm audit fix to fix them, or npm audit for details

10:18:40 AM: NPM modules installed

10:18:40 AM: Started restoring cached go cache

10:18:40 AM: Finished restoring cached go cache

10:18:40 AM: Installing Go version 1.12

10:18:45 AM: unset GOOS;

10:18:45 AM: unset GOARCH;

10:18:45 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';

10:18:45 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";

10:18:45 AM: go version >&2;

10:18:45 AM: export GIMME_ENV="/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env"

10:18:45 AM: go version go1.12 linux/amd64

10:18:45 AM: Installing missing commands

10:18:45 AM: Verify run directory

10:18:46 AM: ​

10:18:46 AM: ────────────────────────────────────────────────────────────────

10:18:46 AM: Netlify Build

10:18:46 AM: ────────────────────────────────────────────────────────────────

10:18:46 AM: ​

10:18:46 AM: ❯ Version

10:18:46 AM: @netlify/build 18.7.2

10:18:46 AM: ​

10:18:46 AM: ❯ Flags

10:18:46 AM: baseRelDir: true

10:18:46 AM: buildId: 6128f3cb5637f1e4cecf5cab

10:18:46 AM: deployId: 6128f3cb5637f1e4cecf5cad

10:18:46 AM: ​

10:18:46 AM: ❯ Current directory

10:18:46 AM: /opt/build/repo

10:18:46 AM: ​

10:18:46 AM: ❯ Config file

10:18:46 AM: No config file was defined: using default values.

10:18:46 AM: ​

10:18:46 AM: ❯ Context

10:18:46 AM: production

10:18:46 AM: ​

10:18:46 AM: ────────────────────────────────────────────────────────────────

10:18:46 AM: 1. Build command from Netlify app

10:18:46 AM: ────────────────────────────────────────────────────────────────

10:18:46 AM: ​

10:18:46 AM: $ CI= gridsome build

10:18:46 AM: Gridsome v0.7.14

10:18:47 AM: Initializing plugins...

10:18:47 AM: Error: Request failed with status code 401

10:18:47 AM: at createError (/opt/build/repo/node_modules/contentful/dist/contentful.node.js:886:15)

10:18:47 AM: at settle (/opt/build/repo/node_modules/contentful/dist/contentful.node.js:1049:12)

10:18:47 AM: at IncomingMessage.handleStreamEnd (/opt/build/repo/node_modules/contentful/dist/contentful.node.js:294:11)

10:18:47 AM: at IncomingMessage.emit (events.js:203:15)

10:18:47 AM: at endReadableNT (_stream_readable.js:1145:12)

10:18:47 AM: at process._tickCallback (internal/process/next_tick.js:63:19)

10:18:47 AM: ​

10:18:47 AM: ────────────────────────────────────────────────────────────────

10:18:47 AM: "build.command" failed

10:18:47 AM: ────────────────────────────────────────────────────────────────

10:18:47 AM: ​

10:18:47 AM: Error message

10:18:47 AM: Command failed with exit code 1: CI= gridsome build

10:18:47 AM: ​

10:18:47 AM: Error location

10:18:47 AM: In Build command from Netlify app:

10:18:47 AM: CI= gridsome build

10:18:47 AM: ​

10:18:47 AM: Resolved config

10:18:47 AM: build:

10:18:47 AM: command: CI= gridsome build

10:18:47 AM: commandOrigin: ui

10:18:47 AM: environment:

10:18:47 AM: - CONTENTFUL_ACCESS_TOKEN

10:18:47 AM: - CONTENTFUL_SPACE_ID

10:18:47 AM: - GRIDSOME_MAPBOX_ACCESS_TOKEN

10:18:47 AM: publish: /opt/build/repo/dist

10:18:47 AM: publishOrigin: ui

10:18:48 AM: Caching artifacts

10:18:48 AM: Started saving node modules

10:18:48 AM: Finished saving node modules

10:18:48 AM: Started saving build plugins

10:18:48 AM: Finished saving build plugins

10:18:48 AM: Started saving pip cache

10:18:48 AM: Finished saving pip cache

10:18:48 AM: Started saving emacs cask dependencies

10:18:48 AM: Finished saving emacs cask dependencies

10:18:48 AM: Started saving maven dependencies

10:18:48 AM: Finished saving maven dependencies

10:18:48 AM: Started saving boot dependencies

10:18:48 AM: Finished saving boot dependencies

10:18:48 AM: Started saving rust rustup cache

10:18:48 AM: Finished saving rust rustup cache

10:18:48 AM: Started saving go dependencies

10:18:49 AM: Finished saving go dependencies

10:18:52 AM: Build failed due to a user error: Build script returned non-zero exit code: 2

10:18:53 AM: Creating deploy upload records

10:18:53 AM: Failing build: Failed to build site

10:18:53 AM: Failed during stage 'building site': Build script returned non- zero exit code: 2 10:18:53 AM: Finished processing build request in 1m0.893624153s

Lewis
  • 1
  • most common mistake during hosting is file naming. its case sensitive and once you upload to git it dosent matter if you correct later, check that once, – Salil Rajkarnikar Aug 27 '21 at 15:02
  • Please trim your code to make it easier to find your problem. Follow these guidelines to create a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). – Community Aug 28 '21 at 13:43

1 Answers1

0
10:18:47 AM: environment:

10:18:47 AM: - CONTENTFUL_ACCESS_TOKEN

10:18:47 AM: - CONTENTFUL_SPACE_ID

10:18:47 AM: - GRIDSOME_MAPBOX_ACCESS_TOKEN

Based on these lines in the error messages it looks like you might need to set your env values in Netlify.

From the Netlify Dashboard for your site, Click "Site Settings" in the ribbon (located roughly just under the Upgrade button if you are on the free plan) > Left hand nav "Build & Deploy" > "Environment"

You'll need to add your keys and value for CONTENTFUL_ACCESS_TOKEN, CONTENTFUL_SPACE_ID, and GRIDSOME_MAPBOX_ACCESS_TOKEN.

You should be able to find these values in a .env file of your local development repo. (this might be local.env or another variant)

vanblart
  • 328
  • 2
  • 12