Automatic deployment error on netlifly

Hello everyone!

I have been trying to automatically deploy my website using GitHub. I succeeded in the manual deployment, but when I try the automatic, it fails. Is there a way to prevent this error?
Here is the deploy log:

2:49:45 PM: Build ready to start 2:49:47 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6 2:49:47 PM: build-image tag: v3.4.1 2:49:47 PM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871 2:49:47 PM: Fetching cached dependencies 2:49:47 PM: Failed to fetch cache, continuing with build 2:49:47 PM: Starting to prepare the repo for build 2:49:47 PM: No cached dependencies found. Cloning fresh repo 2:49:47 PM: git clone https://github.com/hhadah/website 2:49:48 PM: Preparing Git Reference refs/heads/master 2:49:50 PM: Starting build script 2:49:50 PM: Installing dependencies 2:49:50 PM: Python version set to 2.7 2:49:51 PM: v12.18.0 is already installed. 2:49:52 PM: Now using node v12.18.0 (npm v6.14.4) 2:49:52 PM: Started restoring cached build plugins 2:49:52 PM: Finished restoring cached build plugins 2:49:52 PM: Attempting ruby version 2.7.1, read from environment 2:49:53 PM: Using ruby version 2.7.1 2:49:54 PM: Using PHP version 5.6 2:49:54 PM: 5.2 is already installed. 2:49:54 PM: Using Swift version 5.2 2:49:54 PM: Started restoring cached go cache 2:49:54 PM: Finished restoring cached go cache 2:49:54 PM: go version go1.14.4 linux/amd64 2:49:54 PM: go version go1.14.4 linux/amd64 2:49:54 PM: Installing missing commands 2:49:54 PM: Verify run directory 2:49:55 PM: ​ 2:49:55 PM: ┌─────────────────────────────┐ 2:49:55 PM: │ Netlify Build │ 2:49:55 PM: └─────────────────────────────┘ 2:49:55 PM: ​ 2:49:55 PM: ❯ Version 2:49:55 PM: @netlify/build 3.3.0 2:49:55 PM: ​ 2:49:55 PM: ❯ Flags 2:49:55 PM: deployId: 5f4176d94c09937b3524fbaa 2:49:55 PM: mode: buildbot 2:49:55 PM: ​ 2:49:55 PM: ❯ Current directory 2:49:55 PM: /opt/build/repo 2:49:55 PM: ​ 2:49:55 PM: ❯ Config file 2:49:55 PM: No config file was defined: using default values. 2:49:55 PM: ​ 2:49:55 PM: ❯ Context 2:49:55 PM: production 2:49:55 PM: ​ 2:49:55 PM: ┌───────────────────────────────────┐ 2:49:55 PM: │ 1. Build command from Netlify app │ 2:49:55 PM: └───────────────────────────────────┘ 2:49:55 PM: ​ 2:49:55 PM: $ hugo 2:49:55 PM: Error: "/opt/build/repo/themes/hugo-academic/layouts/partials/book_sidebar.html:24:1": parse failed: template: partials/book_sidebar.html:24: illegal number syntax: "-" 2:49:55 PM: ​ 2:49:55 PM: ┌─────────────────────────────┐ 2:49:55 PM: │ "build.command" failed │ 2:49:55 PM: └─────────────────────────────┘ 2:49:55 PM: ​ 2:49:55 PM: Error message 2:49:55 PM: Command failed with exit code 255: hugo 2:49:55 PM: ​ 2:49:55 PM: Error location 2:49:55 PM: In Build command from Netlify app: 2:49:55 PM: hugo 2:49:55 PM: ​ 2:49:55 PM: Resolved config 2:49:55 PM: build: 2:49:55 PM: command: hugo 2:49:55 PM: commandOrigin: ui 2:49:55 PM: publish: /opt/build/repo/public 2:49:55 PM: Caching artifacts 2:49:55 PM: Started saving build plugins 2:49:55 PM: Finished saving build plugins 2:49:55 PM: Started saving pip cache 2:49:55 PM: Finished saving pip cache 2:49:55 PM: Started saving emacs cask dependencies 2:49:55 PM: Finished saving emacs cask dependencies 2:49:55 PM: Started saving maven dependencies 2:49:55 PM: Finished saving maven dependencies 2:49:55 PM: Started saving boot dependencies 2:49:55 PM: Finished saving boot dependencies 2:49:55 PM: Started saving go dependencies 2:49:55 PM: Finished saving go dependencies 2:49:58 PM: Error running command: Build script returned non-zero exit code: 1 2:49:58 PM: Failing build: Failed to build site 2:49:58 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 2:49:58 PM: Finished processing build request in 11.718068491s

Here is my netlifly.toml:
`[build]
publish = “public”
command = “hugo --gc --minify”

[context.production.environment]
HUGO_VERSION = “0.74.3”
HUGO_ENV = “production”
HUGO_ENABLEGITINFO = “true”

[context.split1]
command = “hugo --gc --minify --enableGitInfo”

[context.split1.environment]
HUGO_VERSION = “0.74.3”
HUGO_ENV = “production”

[context.deploy-preview]
command = “hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL”

[context.deploy-preview.environment]
HUGO_VERSION = “0.74.3”

[context.branch-deploy]
command = “hugo --gc --minify -b $DEPLOY_PRIME_URL”

[context.branch-deploy.environment]
HUGO_VERSION = “0.74.3”

[context.next.environment]
HUGO_ENABLEGITINFO = “true”`

Thank you!

It looks like you also posted your question here:
https://community.netlify.com/t/i-am-getting-an-error-whenever-i-try-automatic-deployment-with-github/21077/4

Your first problem in that thread:

parse failed: template: partials/book_sidebar.html:24: illegal number syntax

It appears that you resolved this by using a newer version of Hugo. Is that correct?

@jmooring correct. I created a version variable and gave it the latest Hugo version.

  1. your repo gets cloned fresh in those log lines. try to submit a change and see if it still fails. It might be that there is something missing that comes after the error in the first run

  2. the following is the actuall error:

Error: "/opt/build/repo/themes/hugo-academic/layouts/partials/book_sidebar.html:24:1": parse failed: template: partials/book_sidebar.html:24: illegal number syntax: "-"

Check that file on line 24 and see what happens there. Post it here. That might require a fix.

If you were able to solve the problem, then why did you post the same problem again on this forum?

@jmooring I posted the wrong log, sorry. Here is the log of the failed deployment after correcting for the Hugo version.

2:58:46 PM: Build ready to start
2:58:48 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
2:58:48 PM: build-image tag: v3.4.1
2:58:48 PM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
2:58:48 PM: Fetching cached dependencies
2:58:48 PM: Failed to fetch cache, continuing with build
2:58:48 PM: Starting to prepare the repo for build
2:58:49 PM: No cached dependencies found. Cloning fresh repo
2:58:49 PM: git clone https://github.com/hhadah/website
2:58:50 PM: Preparing Git Reference refs/heads/master
2:58:52 PM: Starting build script
2:58:52 PM: Installing dependencies
2:58:52 PM: Python version set to 2.7
2:58:53 PM: v12.18.0 is already installed.
2:58:54 PM: Now using node v12.18.0 (npm v6.14.4)
2:58:54 PM: Started restoring cached build plugins
2:58:54 PM: Finished restoring cached build plugins
2:58:54 PM: Attempting ruby version 2.7.1, read from environment
2:58:55 PM: Using ruby version 2.7.1
2:58:56 PM: Using PHP version 5.6
2:58:56 PM: 5.2 is already installed.
2:58:56 PM: Using Swift version 5.2
2:58:56 PM: Installing Hugo 0.74.3
2:58:57 PM: Hugo Static Site Generator v0.74.3-DA0437B4/extended linux/amd64 BuildDate: 2020-07-23T16:30:30Z
2:58:57 PM: Started restoring cached go cache
2:58:57 PM: Finished restoring cached go cache
2:58:57 PM: go version go1.14.4 linux/amd64
2:58:57 PM: go version go1.14.4 linux/amd64
2:58:57 PM: Installing missing commands
2:58:57 PM: Verify run directory
2:58:58 PM: ​
2:58:58 PM: ┌─────────────────────────────┐
2:58:58 PM: │        Netlify Build        │
2:58:58 PM: └─────────────────────────────┘
2:58:58 PM: ​
2:58:58 PM: ❯ Version
2:58:58 PM:   @netlify/build 3.3.0
2:58:58 PM: ​
2:58:58 PM: ❯ Flags
2:58:58 PM:   deployId: 5f4178f69b90396be8d19664
2:58:58 PM:   mode: buildbot
2:58:58 PM: ​
2:58:58 PM: ❯ Current directory
2:58:58 PM:   /opt/build/repo
2:58:58 PM: ​
2:58:58 PM: ❯ Config file
2:58:58 PM:   No config file was defined: using default values.
2:58:58 PM: ​
2:58:58 PM: ❯ Context
2:58:58 PM:   production
2:58:58 PM: ​
2:58:58 PM: ┌───────────────────────────────────┐
2:58:58 PM: │ 1. Build command from Netlify app │
2:58:58 PM: └───────────────────────────────────┘
2:58:58 PM: ​
2:58:58 PM: $ hugo
2:58:59 PM: Building sites … ERROR 2020/08/22 19:58:59 render of "section" failed: execute of template failed: template: section/publication.html:65:15: executing "main" at <partial "li_citation" .>: error calling partial: execute of template failed: template: partials/li_citation.html:17:8: executing "partials/li_citation.html" at <partial "page_links" (dict "page" . "is_list" 1)>: error calling partial: "/opt/build/repo/themes/hugo-academic/layouts/partials/page_links.html:62:14": execute of template failed: template: partials/page_links.html:62:14: executing "partials/page_links.html" at <$page.Params.projects>: range can't iterate over internal-projectTotal in 921 ms
2:58:59 PM: Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: publication/single.html:5:5: executing "main" at <partial "page_header.html" .>: error calling partial: execute of template failed: template: partials/page_header.html:64:5: executing "partials/page_header.html" at <partial "page_links_div.html" $page>: error calling partial: execute of template failed: template: partials/page_links_div.html:23:5: executing "partials/page_links_div.html" at <partial "page_links" (dict "page" $page "is_list" 0)>: error calling partial: "/opt/build/repo/themes/hugo-academic/layouts/partials/page_links.html:62:14": execute of template failed: template: partials/page_links.html:62:14: executing "partials/page_links.html" at <$page.Params.projects>: range can't iterate over internal-project​
2:58:59 PM: ┌─────────────────────────────┐
2:58:59 PM: │   "build.command" failed    │
2:58:59 PM: └─────────────────────────────┘
2:58:59 PM: ​
2:58:59 PM:   Error message
2:58:59 PM:   Command failed with exit code 255: hugo
2:58:59 PM: ​
2:58:59 PM:   Error location
2:58:59 PM:   In Build command from Netlify app:
2:58:59 PM:   hugo
2:58:59 PM: ​
2:58:59 PM:   Resolved config
2:58:59 PM:   build:
2:58:59 PM:     command: hugo
2:58:59 PM:     commandOrigin: ui
2:58:59 PM:     environment:
2:58:59 PM:       - HUGO_VERSION
2:58:59 PM:     publish: /opt/build/repo/public
2:58:59 PM: Caching artifacts
2:58:59 PM: Started saving build plugins
2:58:59 PM: Finished saving build plugins
2:58:59 PM: Started saving pip cache
2:58:59 PM: Finished saving pip cache
2:58:59 PM: Started saving emacs cask dependencies
2:58:59 PM: Finished saving emacs cask dependencies
2:58:59 PM: Started saving maven dependencies
2:58:59 PM: Finished saving maven dependencies
2:58:59 PM: Started saving boot dependencies
2:58:59 PM: Finished saving boot dependencies
2:58:59 PM: Started saving go dependencies
2:58:59 PM: Finished saving go dependencies
2:59:02 PM: Error running command: Build script returned non-zero exit code: 1
2:59:02 PM: Failing build: Failed to build site
2:59:02 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
2:59:02 PM: Finished processing build request in 13.911619005s

Please temporarily make the repo (https://github.com/hhadah/website) public so that I may clone it in order to troubleshoot the problem. Thanks.

@jmooring I just made it public. Thank you for your help.

content/publication/conference-paper/index.md

Change:

projects: internal-project
publication: In *Source Themes Conference*
publication_short: In *STC*
publication_types: '1'

To:

projects: 
- internal-project
publication: In *Source Themes Conference*
publication_short: In *STC*
publication_types: 
- '1'

And remember that your repository is now public.

It worked! Thank you so much, @jmooring.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.