[Hugo Academic] Can't deploy because of git submodule

It’s looking like the build can’t find the SHA for a specific commit, but I don’t know where to specify it.

My primary domain is www.matthewemery.ca

Build log:

2:38:09 PM: Build ready to start
2:38:10 PM: build-image version: 6dfe19d15f524c85d6f9bf7df9fb30b0a9f0a61a
2:38:10 PM: build-image tag: v3.3.10
2:38:10 PM: buildbot version: 0d19834c19ebfe54208907d729718495339fe085
2:38:11 PM: Fetching cached dependencies
2:38:11 PM: Failed to fetch cache, continuing with build
2:38:11 PM: Starting to prepare the repo for build
2:38:12 PM: No cached dependencies found. Cloning fresh repo
2:38:12 PM: git clone git@github.com:lstmemery/matthewemery.ca
2:38:13 PM: Preparing Git Reference refs/heads/master
2:38:15 PM: Error checking out submodules: Submodule 'themes/academic' (https://github.com/gcushen/hugo-academic.git) registered for path 'themes/academic'Cloning into '/opt/build/repo/themes/academic'...fatal: remote error: upload-pack: not our ref e8af7e2451ddd689021ad1f6bec2b6706927c301Fetched in submodule path 'themes/academic', but it did not contain e8af7e2451ddd689021ad1f6bec2b6706927c301. Direct fetching of that commit failed.
2:38:15 PM: Failing build: Failed to prepare repo
2:38:15 PM: Failed during stage 'preparing repo': Error checking out submodules: Submodule 'themes/academic' (https://github.com/gcushen/hugo-academic.git) registered for path 'themes/academic'Cloning into '/opt/build/repo/themes/academic'...fatal: remote error: upload-pack: not our ref e8af7e2451ddd689021ad1f6bec2b6706927c301Fetched in submodule path 'themes/academic', but it did not contain e8af7e2451ddd689021ad1f6bec2b6706927c301. Direct fetching of that commit failed.: exit status 1
2:38:15 PM: Finished processing build request in 4.914779809s

Build Settings:

Repository:github.com/lstmemery/matthewemery.ca
Base directory:Not set
Build command: hugo --minify -b $URL
Publish directory: public
Deploy log visibility: Logs are public
Builds: Active

Thank you for the help!

Hey @lstmemery,
How were you setting this up- locally and then pushing to GitHub or with the one-click deploy here: GitHub - wowchemy/wowchemy-hugo-themes: 🔥 Hugo website builder, Hugo themes & Hugo CMS. No code, easily build with blocks! 创建在线课程,学术简历或初创网站。#OpenScience? Asking because if there’s an error with the deploy there, we’ll want to file an issue :slight_smile:

In terms of next steps, this thread seemed to have some good suggestions for that error:

Want to try incorporating one of those suggestions into your build command, so:
git submodule update --force --recursive --init --remote && hugo --minify -b $URL?

Hi Jen! I set this up locally and and pushed through GitHub. I’ve updated the build command with what you suggested and got the same error. I’ll try removing and reinstalling the submodule manually.

1 Like

keep us posted, please!

Hi I was able to get further in the deploy by forcing an update of the submodule locally but now I have this error:

7:24:03 PM: Build ready to start
7:24:05 PM: build-image version: 30f629161c0736b1a3ecd8b418e5eeffab5c0faf
7:24:05 PM: build-image tag: v3.3.14
7:24:05 PM: buildbot version: 1da4cf38e1ad1fe9ce7deeeba939bcc9c6c3f794
7:24:05 PM: Fetching cached dependencies
7:24:05 PM: Starting to download cache of 254.9KB
7:24:05 PM: Finished downloading cache in 72.522241ms
7:24:05 PM: Starting to extract cache
7:24:05 PM: Failed to fetch cache, continuing with build
7:24:05 PM: Starting to prepare the repo for build
7:24:06 PM: No cached dependencies found. Cloning fresh repo
7:24:06 PM: git clone git@github.com:lstmemery/matthewemery.ca
7:24:07 PM: Preparing Git Reference refs/heads/master
7:24:09 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'git submodule update --force --recursive --init --remote && hugo --minify -b $URL' versus 'hugo --minify -b $URL' in the Netlify UI
7:24:09 PM: Starting build script
7:24:09 PM: Installing dependencies
7:24:11 PM: v10.20.1 is already installed.
7:24:11 PM: Now using node v10.20.1 (npm v6.14.4)
7:24:11 PM: Started restoring cached build plugins
7:24:11 PM: Finished restoring cached build plugins
7:24:12 PM: Attempting ruby version 2.6.2, read from environment
7:24:13 PM: Using ruby version 2.6.2
7:24:13 PM: Using PHP version 5.6
7:24:13 PM: 5.2 is already installed.
7:24:13 PM: Using Swift version 5.2
7:24:13 PM: Installing Hugo 0.65.0
7:24:15 PM: Hugo Static Site Generator v0.65.0-24AFE2B82/extended linux/amd64 BuildDate: 2020-02-20T09:09:42Z
7:24:15 PM: Started restoring cached go cache
7:24:15 PM: Finished restoring cached go cache
7:24:15 PM: go version go1.12 linux/amd64
7:24:15 PM: go version go1.12 linux/amd64
7:24:15 PM: Installing missing commands
7:24:15 PM: Verify run directory
7:24:16 PM: ​
7:24:16 PM: ┌─────────────────────────────┐
7:24:16 PM: │        Netlify Build        │
7:24:16 PM: └─────────────────────────────┘
7:24:16 PM: ​
7:24:16 PM: ❯ Version
7:24:16 PM:   @netlify/build 1.0.10
7:24:16 PM: ​
7:24:16 PM: ❯ Flags
7:24:16 PM:   mode: buildbot
7:24:16 PM: ​
7:24:16 PM: ❯ Current directory
7:24:16 PM:   /opt/build/repo
7:24:16 PM: ​
7:24:16 PM: ❯ Config file
7:24:16 PM:   /opt/build/repo/netlify.toml
7:24:16 PM: ​
7:24:16 PM: ❯ Context
7:24:16 PM:   production
7:24:16 PM: ​
7:24:16 PM: ┌────────────────────────────────────┐
7:24:16 PM: │ 1. build.command from netlify.toml │
7:24:16 PM: └────────────────────────────────────┘
7:24:16 PM: ​
7:24:16 PM: $ git submodule update --force --recursive --init --remote && hugo --minify -b $URL
7:24:17 PM: Submodule path 'themes/academic': checked out '5dbcff616768cbb931eba31139e8399136828871'
7:24:17 PM: Building sites …
7:24:18 PM: ERROR 2020/05/29 02:24:18 render of "page" failed: execute of template failed: template: _default/single.html:13:7: executing "main" at <partial "page_footer" .>: error calling partial: execute of template failed: template: partials/page_footer.html:13:3: executing "partials/page_footer.html" at <partial "page_related" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/page_related.html:1:7": execute of template failed: template: partials/page_related.html:1:7: executing "partials/page_related.html" at <index site.Params.show_related .Type>: error calling index: index of untyped nil
7:24:18 PM: ERROR 2020/05/29 02:24:18 render of "page" failed: execute of template failed: template: _default/single.html:13:7: executing "main" at <partial "page_footer" .>: error calling partial: execute of template failed: template: partials/page_footer.html:13:3: executing "partials/page_footer.html" at <partial "page_related" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/page_related.html:1:7": execute of template failed: template: partials/page_related.html:1:7: executing "partials/page_related.html" at <index site.Params.show_related .Type>: error calling index: index of untyped nil
7:24:18 PM: ERROR 2020/05/29 02:24:18 render of "page" failed: execute of template failed: template: project/single.html:13:7: executing "main" at <partial "page_footer" .>: error calling partial: execute of template failed: template: partials/page_footer.html:13:3: executing "partials/page_footer.html" at <partial "page_related" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/page_related.html:1:7": execute of template failed: template: partials/page_related.html:1:7: executing "partials/page_related.html" at <index site.Params.show_related .Type>: error calling index: index of untyped nil
7:24:18 PM: Total in 713 ms
7:24:18 PM: Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: _default/single.html:13:7: executing "main" at <partial "page_footer" .>: error calling partial: execute of template failed: template: partials/page_footer.html:13:3: executing "partials/page_footer.html" at <partial "page_related" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/page_related.html:1:7": execute of template failed: template: partials/page_related.html:1:7: executing "partials/page_related.html" at <index site.Params.show_related .Type>: error calling index: index of untyped nil
7:24:18 PM: ​
7:24:18 PM: ┌─────────────────────────────┐
7:24:18 PM: │   "build.command" failed    │
7:24:18 PM: └─────────────────────────────┘
7:24:18 PM: ​
7:24:18 PM:   Error message
7:24:18 PM:   Command failed with exit code 255: git submodule update --force --recursive --init --remote && hugo --minify -b $URL
7:24:18 PM: ​
7:24:18 PM:   Error location
7:24:18 PM:   In build.command from netlify.toml:
7:24:18 PM:   git submodule update --force --recursive --init --remote && hugo --minify -b $URL
7:24:18 PM: ​
7:24:18 PM:   Resolved config
7:24:18 PM:   build:
7:24:18 PM:     command: git submodule update --force --recursive --init --remote && hugo --minify -b $URL
7:24:18 PM:     publish: /opt/build/repo/public
7:24:18 PM:   headers:
7:24:18 PM:     - for: '*.webmanifest'
7:24:18 PM:       values:
7:24:18 PM:         Content-Type: application/manifest+json; charset=UTF-8
7:24:18 PM:     - for: index.xml
7:24:18 PM:       values:
7:24:18 PM:         Content-Type: application/rss+xml
7:24:18 PM: Caching artifacts
7:24:18 PM: Started saving build plugins
7:24:18 PM: Finished saving build plugins
7:24:18 PM: Started saving pip cache
7:24:18 PM: Finished saving pip cache
7:24:18 PM: Started saving emacs cask dependencies
7:24:18 PM: Finished saving emacs cask dependencies
7:24:18 PM: Started saving maven dependencies
7:24:18 PM: Finished saving maven dependencies
7:24:18 PM: Started saving boot dependencies
7:24:18 PM: Finished saving boot dependencies
7:24:18 PM: Started saving go dependencies
7:24:18 PM: Finished saving go dependencies
7:24:21 PM: Error running command: Build script returned non-zero exit code: 1
7:24:21 PM: Failing build: Failed to build site
7:24:21 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1
7:24:21 PM: Finished processing build request in 16.539126188s

I got it!

My params.toml was missing the following line:

show_related = {docs = false, page = false, post = false, project = false, publication = false, talk = false}
1 Like