I’m still running an old version of Hugo and recently Netlify changed their build image which prevented my site from building due to some incompatibility described in my previous post on the subject.
I received some help and was able to get my site building again with a change to my Netlify.toml which appears to route around the problem by retrieving the version the correct version of hugo to build my site that Netlify’s build image is unable to do.
Two days later it stopped building again. I feel like something change on their end as it was building fine right before that. The build logs are below.
Im working on a upgrade path to get my site to a newer build, but at this point I cant build my site and wondered what I can do until I I get my site upgrade to a newer version of hugo or migrate my site to an more recent installation of hugo.
7:06:37 PM: Netlify Build
7:06:37 PM: ────────────────────────────────────────────────────────────────
7:06:37 PM:
7:06:37 PM: ❯ Version
7:06:37 PM: @netlify/build 35.8.4
7:06:37 PM:
7:06:37 PM: ❯ Flags
7:06:37 PM: accountId: 5a32f1ff0b79b70b038bcd38
7:06:37 PM: baseRelDir: true
7:06:37 PM: buildId: 69a7313363e3fd000847c4af
7:06:37 PM: deployId: 69a7313363e3fd000847c4b1
7:06:38 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
7:06:38 PM:
7:06:38 PM: ❯ Current directory
7:06:38 PM: /opt/build/repo
7:06:38 PM:
7:06:38 PM: ❯ Config file
7:06:38 PM: /opt/build/repo/netlify.toml
7:06:38 PM:
7:06:38 PM: ❯ Context
7:06:38 PM: production
7:06:38 PM:
7:06:38 PM: build.command from netlify.toml
7:06:38 PM: ────────────────────────────────────────────────────────────────
7:06:38 PM:
7:06:38 PM: $ mkdir -p "${HOME}/.local/bin" && curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION_DOWNLOAD}/hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && tar -C "${HOME}/.local/bin" -xf "hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && rm "hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && git config core.quotepath false && export PATH="${HOME}/.local/bin:${PATH}" && hugo --gc --baseURL "${URL}"
7:06:38 PM:
7:06:38 PM: tar: This does not look like a tar archive
7:06:38 PM: gzip: stdin: not in gzip format
7:06:38 PM: tar: Child returned status 1
7:06:38 PM: tar: Error is not recoverable: exiting now
7:06:38 PM:
7:06:38 PM: "build.command" failed
7:06:38 PM: ────────────────────────────────────────────────────────────────
7:06:38 PM:
7:06:38 PM: Error message
7:06:38 PM: Command failed with exit code 2: mkdir -p "${HOME}/.local/bin" && curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION_DOWNLOAD}/hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && tar -C "${HOME}/.local/bin" -xf "hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && rm "hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && git config core.quotepath false && export PATH="${HOME}/.local/bin:${PATH}" && hugo --gc --baseURL "${URL}" (https://ntl.fyi/exit-code-2)
7:06:38 PM:
7:06:38 PM: Error location
7:06:38 PM: In build.command from netlify.toml:
7:06:38 PM: mkdir -p "${HOME}/.local/bin" && curl -sLJO "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION_DOWNLOAD}/hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && tar -C "${HOME}/.local/bin" -xf "hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && rm "hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz" && git config core.quotepath false && export PATH="${HOME}/.local/bin:${PATH}" && hugo --gc --baseURL "${URL}"
7:06:38 PM:
7:06:38 PM: Resolved config
7:06:38 PM: build:
7:06:38 PM: command: "mkdir -p \"${HOME}/.local/bin\" && curl -sLJO
\"https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION_DOWNLO\
AD}/hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz\" && tar -C
\"${HOME}/.local/bin\" -xf
\"hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz\" && rm
\"hugo_extended_${HUGO_VERSION_DOWNLOAD}_Linux-64bit.tar.gz\" && git config
core.quotepath false && export PATH=\"${HOME}/.local/bin:${PATH}\" && hugo
--gc --baseURL \"${URL}\"
7:06:38 PM: \ "
commandOrigin: config
7:06:38 PM: environment:
7:06:38 PM: - SITE_RECAPTCHA_KEY
7:06:38 PM: - SITE_RECAPTCHA_SECRET
7:06:38 PM: - HUGO_VERSION_DOWNLOAD
7:06:38 PM: publish: /opt/build/repo/public
7:06:38 PM: publishOrigin: config
7:06:38 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
7:06:38 PM: Failing build: Failed to build site
7:06:38 PM: Finished processing build request in 9.784s