Home
Support Forums

Failed to deploy - error Command failed with exit code 255

Both my sites have the same error →

  1. https://bandrainfo.netlify.app

  2. https://powaiinfo.netlify.app

Below is the error code

Hi @exist2021

Unfortunately the screenshot does not show the cause of the error, only that there was an error. If you post the raw log, or a link to the log (if public) then others can provide assistance.

I can access both sites, so I am wondering if you resolved the issue.

No that’s the old build which was successfully deployed. Recent changes giving me error on both my side.

Copy pasting the log below for https://powaiinfo.netlify.app

9:36:38 PM: Build ready to start
9:36:40 PM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
9:36:40 PM: build-image tag: v4.3.0
9:36:40 PM: buildbot version: d2795bf5a96b85e585e90944f15f15381ce164a7
9:36:40 PM: Fetching cached dependencies
9:36:40 PM: Starting to download cache of 336.4MB
9:36:42 PM: Finished downloading cache in 1.839414411s
9:36:42 PM: Starting to extract cache
9:36:53 PM: Finished extracting cache in 10.601162486s
9:36:53 PM: Finished fetching cache in 12.535624037s
9:36:53 PM: Starting to prepare the repo for build
9:36:53 PM: Preparing Git Reference refs/heads/master
9:36:54 PM: Parsing package.json dependencies
9:36:55 PM: Starting build script
9:36:55 PM: Installing dependencies
9:36:55 PM: Python version set to 2.7
9:36:55 PM: Started restoring cached node version
9:36:57 PM: Finished restoring cached node version
9:36:57 PM: Attempting node version ‘12’ from .nvmrc
9:36:58 PM: v12.22.5 is already installed.
9:36:58 PM: Now using node v12.22.5 (npm v6.14.14)
9:36:58 PM: Started restoring cached build plugins
9:36:58 PM: Finished restoring cached build plugins
9:36:58 PM: Attempting ruby version 2.7.2, read from environment
9:36:59 PM: Using ruby version 2.7.2
9:37:00 PM: Using PHP version 8.0
9:37:00 PM: Started restoring cached yarn cache
9:37:05 PM: Finished restoring cached yarn cache
9:37:06 PM: No yarn workspaces detected
9:37:06 PM: Started restoring cached node modules
9:37:06 PM: Finished restoring cached node modules
9:37:06 PM: Installing NPM modules using Yarn version 1.12.1
9:37:06 PM: yarn install v1.12.1
9:37:06 PM: [1/4] Resolving packages…
9:37:07 PM: success Already up-to-date.
9:37:07 PM: Done in 0.85s.
9:37:07 PM: NPM modules installed using Yarn
9:37:07 PM: Started restoring cached go cache
9:37:07 PM: Finished restoring cached go cache
9:37:07 PM: go version go1.16.5 linux/amd64
9:37:07 PM: go version go1.16.5 linux/amd64
9:37:07 PM: Installing missing commands
9:37:07 PM: Verify run directory
9:37:09 PM: ​
9:37:09 PM: ────────────────────────────────────────────────────────────────
9:37:09 PM: Netlify Build
9:37:09 PM: ────────────────────────────────────────────────────────────────
9:37:09 PM: ​
9:37:09 PM: ❯ Version
9:37:09 PM: @netlify/build 18.5.0
9:37:09 PM: ​
9:37:09 PM: ❯ Flags
9:37:09 PM: baseRelDir: true
9:37:09 PM: buildId: 6127bc0eda25ff00079d053b
9:37:09 PM: deployId: 6127bc0eda25ff00079d053d
9:37:09 PM: ​
9:37:09 PM: ❯ Current directory
9:37:09 PM: /opt/build/repo
9:37:09 PM: ​
9:37:09 PM: ❯ Config file
9:37:09 PM: /opt/build/repo/netlify.toml
9:37:09 PM: ​
9:37:09 PM: ❯ Context
9:37:09 PM: production
9:37:09 PM: ​
9:37:09 PM: ────────────────────────────────────────────────────────────────
9:37:09 PM: 1. build.command from netlify.toml
9:37:09 PM: ────────────────────────────────────────────────────────────────
9:37:09 PM: ​
9:37:09 PM: $ yarn build
9:37:09 PM: yarn run v1.12.1
9:37:09 PM: $ rimraf dist
9:37:09 PM: $ npm run build:webpack && npm run build:hugo
9:37:09 PM: npm WARN lifecycle The node binary used for scripts is /tmp/yarn–1629994029497-0.4206369682081068/node but npm is using /opt/buildhome/.nvm/versions/node/v12.22.5/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.
9:37:09 PM: > victor-hugo@1.0.0 build:webpack /opt/build/repo
9:37:09 PM: > cross-env NODE_ENV=production webpack --config webpack.prod.js
9:37:21 PM: Hash: 125b586d8ba58ad7c600
9:37:21 PM: Version: webpack 4.46.0
9:37:21 PM: Time: 10307ms
9:37:21 PM: Built at: 08/26/2021 4:07:21 PM
9:37:21 PM: Asset Size Chunks Chunk Names
9:37:21 PM: admin/index.html 328 bytes [emitted]
9:37:21 PM: cms.125b5.js 4.61 MiB 0 [emitted] [immutable] [big] cms
9:37:21 PM: cms.125b5.js.LICENSE.txt 4.99 KiB [emitted]
9:37:21 PM: fonts/.keep 0 bytes [emitted]
9:37:21 PM: main.125b5.css 83.9 KiB 1 [emitted] [immutable] main
9:37:21 PM: main.125b5.js 3.74 KiB 1 [emitted] [immutable] main
9:37:21 PM: Entrypoint main = main.125b5.css main.125b5.js
9:37:21 PM: Entrypoint cms [big] = cms.125b5.js
9:37:21 PM: [8] ./node_modules/to-string-loader/src/to-string.js!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/sass-loader/dist/cjs.js!./src/css/main.css 338 bytes {0} [built]
9:37:21 PM: [9] ./src/index.js 122 bytes {1} [built]
9:37:21 PM: [10] ./src/css/main.css 672 bytes {1} [built]
9:37:21 PM: [12] ./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/sass-loader/dist/cjs.js!./src/css/main.css 39 bytes {1} [built]
9:37:21 PM: [15] (webpack)/buildin/global.js 472 bytes {0} [built]
9:37:21 PM: [23] ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/sass-loader/dist/cjs.js!./src/css/main.css 85.9 KiB {0} [built]
9:37:21 PM: [39] ./src/js/cms.js + 6 modules 35 KiB {0} [built]
9:37:21 PM: | ./src/js/cms.js 860 bytes [built]
9:37:21 PM: | ./src/js/cms-preview-templates/home.js 6.63 KiB [built]
9:37:21 PM: | ./src/js/cms-preview-templates/post.js 4.37 KiB [built]
9:37:21 PM: | ./src/js/cms-preview-templates/products.js 8.63 KiB [built]
9:37:21 PM: | ./src/js/cms-preview-templates/values.js 5.37 KiB [built]
9:37:21 PM: | ./src/js/cms-preview-templates/contact.js 4.81 KiB [built]
9:37:21 PM: | + 1 hidden module
9:37:21 PM: + 34 hidden modules
9:37:21 PM: WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
9:37:21 PM: This can impact web performance.
9:37:21 PM: Assets:
9:37:21 PM: cms.125b5.js (4.61 MiB)
9:37:21 PM: WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
9:37:21 PM: Entrypoints:
9:37:21 PM: cms (4.61 MiB)
9:37:21 PM: cms.125b5.js
9:37:21 PM:
9:37:21 PM: WARNING in webpack performance recommendations:
9:37:21 PM: You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
9:37:21 PM: For more info visit Code Splitting | webpack
9:37:21 PM: Child html-webpack-plugin for “admin/index.html”:
9:37:21 PM: 1 asset
9:37:21 PM: Entrypoint undefined = admin/index.html
9:37:21 PM: [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/cms.html 602 bytes {0} [built]
9:37:21 PM: [2] (webpack)/buildin/global.js 472 bytes {0} [built]
9:37:21 PM: [3] (webpack)/buildin/module.js 497 bytes {0} [built]
9:37:21 PM: + 1 hidden module
9:37:21 PM: Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js!node_modules/postcss-loader/src/index.js!node_modules/sass-loader/dist/cjs.js!src/css/main.css:
9:37:21 PM: Entrypoint mini-css-extract-plugin = *
9:37:21 PM: [0] ./node_modules/css-loader/dist/cjs.js!./node_modules/postcss-loader/src!./node_modules/sass-loader/dist/cjs.js!./src/css/main.css 85.9 KiB {0} [built]
9:37:21 PM: + 1 hidden module
9:37:21 PM: npm WARN lifecycle The node binary used for scripts is /tmp/yarn–1629994029497-0.4206369682081068/node but npm is using /opt/buildhome/.nvm/versions/node/v12.22.5/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.
9:37:21 PM: > victor-hugo@1.0.0 build:hugo /opt/build/repo
9:37:21 PM: > hugo -d …/dist -s site -v
9:37:22 PM: Start building sites …
9:37:22 PM: hugo v0.85.0-724D5DB5 linux/amd64 BuildDate=2021-07-05T10:46:28Z VendorInfo=gohugoio
9:37:22 PM: INFO 2021/08/26 16:07:22 syncing static files to /opt/build/repo/dist/
9:37:22 PM: Error: Error building site: “/opt/build/repo/site/content/post/Hiranandani Hospital suicide case.md:8:1”: unmarshal failed: Near line 8 (last key parsed ‘title’): strings cannot contain newlines
9:37:22 PM: Total in 74 ms
9:37:22 PM: npm ERR! code ELIFECYCLE
9:37:22 PM: npm ERR! errno 255
9:37:22 PM: npm ERR! victor-hugo@1.0.0 build:hugo: hugo -d ../dist -s site -v
9:37:22 PM: npm ERR! Exit status 255
9:37:22 PM: npm ERR!
9:37:22 PM: npm ERR! Failed at the victor-hugo@1.0.0 build:hugo script.
9:37:22 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
9:37:22 PM: npm ERR! A complete log of this run can be found in:
9:37:22 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-08-26T16_07_22_156Z-debug.log
9:37:22 PM: error Command failed with exit code 255.
9:37:22 PM: info Visit yarn run | Yarn for documentation about this command.
9:37:22 PM: ​
9:37:22 PM: ────────────────────────────────────────────────────────────────
9:37:22 PM: “build.command” failed
9:37:22 PM: ────────────────────────────────────────────────────────────────
9:37:22 PM: ​
9:37:22 PM: Error message
9:37:22 PM: Command failed with exit code 1: yarn build
9:37:22 PM: ​
9:37:22 PM: Error location
9:37:22 PM: In build.command from netlify.toml:
9:37:22 PM: yarn build
9:37:22 PM: ​
9:37:22 PM: Resolved config
9:37:22 PM: build:
9:37:22 PM: command: yarn build
9:37:22 PM: commandOrigin: config
9:37:22 PM: environment:
9:37:22 PM: - YARN_VERSION
9:37:22 PM: - NPM_VERSION
9:37:22 PM: publish: /opt/build/repo/dist
9:37:22 PM: publishOrigin: config
9:37:22 PM: Caching artifacts
9:37:22 PM: Started saving node modules
9:37:22 PM: Finished saving node modules
9:37:22 PM: Started saving build plugins
9:37:22 PM: Finished saving build plugins
9:37:22 PM: Started saving yarn cache
9:37:28 PM: Finished saving yarn cache
9:37:28 PM: Started saving pip cache
9:37:28 PM: Finished saving pip cache
9:37:28 PM: Started saving emacs cask dependencies
9:37:28 PM: Finished saving emacs cask dependencies
9:37:28 PM: Started saving maven dependencies
9:37:28 PM: Finished saving maven dependencies
9:37:28 PM: Started saving boot dependencies
9:37:28 PM: Finished saving boot dependencies
9:37:28 PM: Started saving rust rustup cache
9:37:28 PM: Finished saving rust rustup cache
9:37:28 PM: Started saving go dependencies
9:37:28 PM: Finished saving go dependencies
9:37:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:37:28 PM: Creating deploy upload records
9:37:28 PM: Failing build: Failed to build site
9:37:28 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
9:37:28 PM: Finished processing build request in 47.878337877s

You seem to have formatted the front matter incorrectly. Please recheck the file or share the file so others can check.

woah! Thanks a bunch. Both sites deployed.

Now I learnt how to check errors and debug

Excited with Hugo!