Updating Hugo version fails to build

Hi,

I have a site thinkaheadcomix.com

Its powered by Hugo.

I am currently on hugo version 0.83.1 I want to upgrade to the latest version which I believe is 0.97.0.

I updated the version number on GitLab but builds fail on Netlify. This is what i get.

Failing build: Failed to parse configuration
11:32:42 AM: Failed during stage ‘Reading and parsing configuration files’:
When resolving config file /opt/build/repo/netlify.toml:
Could not parse configuration file
Expected “=”, [ \t] or [A-Za-z0-9_-] but “:” found.

: exit status 1

Any idea why the update is failing am i doing it wrong?

Is there a way to auto update perhaps by means of GitLab CI? or other means?

Any guidance is greatly appreciated.

Hey @lycaon-security

Looks like you have used a colon : instead of an equals sign = somewhere which is not valid in a TOML.

If you have issues still, can you provide a link to the netlify.toml or paste the contents here in a codeblock.

Hi @coelmay ,

Thanks for your help here is the TOML file:

[build]
publish = “public”
command = “hugo --gc --minify”

[build.environment]
HUGO_VERSION = “0.83.1”
HUGO_BASEURL = “/”

[[headers]]
for = “/*” # This defines which paths this specific [[headers]] block will cover.

[headers.values]
X-Frame-Options = “DENY”
X-Content-Type-Options = “nosniff”
X-XSS-Protection = “0”
Referrer-Policy = “same-origin”
Strict-Transport-Security = “max-age=31536000; includeSubDomains; preload”

I can’t see any issues in the TOML text. I’m at a loss to explain the error now :thinking:

Hi @coelmay ,

Any idea where I go from here?

If you are able to share the full deploy log, and the repository, if I can’t, I know there are a number of other Hugo users in the community that likely can.

The repo is private but here is the full deploy log

11:31:44 AM: Waiting for other deploys from your team to complete. Check the queue: Netlify App

11:32:14 AM: Build ready to start

11:32:16 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)

11:32:16 AM: build-image tag: v4.8.0

11:32:16 AM: buildbot version: e552b142336b2b1222a93a4fd4cbed0019c77b46

11:32:17 AM: Fetching cached dependencies

11:32:17 AM: Starting to download cache of 897.6MB

11:32:26 AM: Finished downloading cache in 9.486015625s

11:32:26 AM: Starting to extract cache

11:32:40 AM: Finished extracting cache in 13.761149876s

11:32:40 AM: Finished fetching cache in 23.449258428s

11:32:40 AM: Starting to prepare the repo for build

11:32:41 AM: Preparing Git Reference merge-requests/45/head

11:32:41 AM: Parsing package.json dependencies

11:32:42 AM: Creating deploy upload records

11:32:42 AM: Failing build: Failed to parse configuration

11:32:42 AM: Failed during stage ‘Reading and parsing configuration files’:
When resolving config file /opt/build/repo/netlify.toml:
Could not parse configuration file
Expected “=”, [ \t] or [A-Za-z0-9_-] but “:” found.

: exit status 1

11:32:43 AM: Finished processing build request in 26.264437743s

Hey there, @lycaon-security :wave:

Thanks for your patience here. Have you already seen this thread: Failed during stage 'Reading and parsing configuration files'? It looks like this customer encountered the same error. This thread contains next steps.

1 Like