Newly migrated LMS fails to build

Site name:

johnmuchovej.netlify.app

Build log:

12:12:00 AM: Build ready to start
12:12:02 AM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
12:12:02 AM: build-image tag: v3.4.1
12:12:02 AM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
12:12:03 AM: Fetching cached dependencies
12:12:03 AM: Starting to download cache of 115.9MB
12:12:03 AM: Finished downloading cache in 761.050754ms
12:12:03 AM: Starting to extract cache
12:12:07 AM: Finished extracting cache in 3.509570921s
12:12:07 AM: Finished fetching cache in 4.328125675s
12:12:07 AM: Starting to prepare the repo for build
12:12:07 AM: Netlify Large Media is enabled, running git commands with GIT_LFS_SKIP_SMUDGE=1
12:12:07 AM: Unable to disable git gc.autoDetach: fatal: $HOME not set
12:12:07 AM: Preparing Git Reference refs/heads/master
12:12:09 AM: Starting build script
12:12:09 AM: Installing dependencies
12:12:09 AM: Python version set to 2.7
12:12:09 AM: Started restoring cached node version
12:12:12 AM: Finished restoring cached node version
12:12:13 AM: v12.18.0 is already installed.
12:12:13 AM: Now using node v12.18.0 (npm v6.14.4)
12:12:13 AM: Started restoring cached build plugins
12:12:13 AM: Finished restoring cached build plugins
12:12:13 AM: Attempting ruby version 2.7.1, read from environment
12:12:14 AM: Using ruby version 2.7.1
12:12:15 AM: Using PHP version 5.6
12:12:15 AM: 5.2 is already installed.
12:12:15 AM: Using Swift version 5.2
12:12:15 AM: Installing Hugo 0.72.0
12:12:15 AM: Hugo Static Site Generator v0.72.0-8A7EF3CF/extended linux/amd64 BuildDate: 2020-05-31T12:14:23Z
12:12:15 AM: Started restoring cached go cache
12:12:15 AM: Finished restoring cached go cache
12:12:15 AM: go version go1.14.4 linux/amd64
12:12:15 AM: go version go1.14.4 linux/amd64
12:12:15 AM: Installing missing commands
12:12:15 AM: Verify run directory
12:12:16 AM: ​
12:12:16 AM: ┌─────────────────────────────┐
12:12:16 AM: │        Netlify Build        │
12:12:16 AM: └─────────────────────────────┘
12:12:16 AM: ​
12:12:16 AM: ❯ Version
12:12:16 AM:   @netlify/build 3.3.0
12:12:16 AM: ​
12:12:16 AM: ❯ Flags
12:12:16 AM:   deployId: 5f41ec90f78c890008bf7706
12:12:16 AM:   mode: buildbot
12:12:16 AM: ​
12:12:16 AM: ❯ Current directory
12:12:16 AM:   /opt/build/repo
12:12:16 AM: ​
12:12:16 AM: ❯ Config file
12:12:16 AM:   /opt/build/repo/netlify.toml
12:12:16 AM: ​
12:12:16 AM: ❯ Context
12:12:16 AM:   production
12:12:16 AM: ​
12:12:16 AM: ┌────────────────────────────────────┐
12:12:16 AM: │ 1. build.command from netlify.toml │
12:12:16 AM: └────────────────────────────────────┘
12:12:16 AM: ​
12:12:16 AM: $ hugo --gc --minify -b $URL
12:12:17 AM: Building sites … ERROR 2020/08/23 04:12:17 render of "home" failed: execute of template failed: template: index.html:18:3: executing "main" at <partial "widget_page.html" .>: error calling partial: execute of template failed: template: partials/widget_page.html:94:9: executing "partials/widget_page.html" at <partial $widget_path $widget_args>: error calling partial: execute of template failed: template: partials/widgets/pages.html:89:11: executing "partials/widgets/pages.html" at <partial "li_compact" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/li_compact.html:81:17": execute of template failed: template: partials/li_compact.html:81:17: executing "partials/li_compact.html" at <.Resize>: error calling Resize: image "/opt/build/repo/content/post/foraging-for-research/featured.jpg": resize : image: unknown format
12:12:17 AM: ERROR 2020/08/23 04:12:17 render of "section" failed: execute of template failed: template: section/post.html:18:9: executing "main" at <partial "li_compact" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/li_compact.html:81:17": execute of template failed: template: partials/li_compact.html:81:17: executing "partials/li_compact.html" at <.Resize>: error calling Resize: image "/opt/build/repo/content/post/foraging-for-research/featured.jpg": resize : image: unknown format
12:12:17 AM: Total in 1202 ms
12:12:17 AM: Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: project/single.html:29:15: executing "main" at <partial "li_compact" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/li_compact.html:81:17": execute of template failed: template: partials/li_compact.html:81:17: executing "partials/li_compact.html" at <.Resize>: error calling Resize: image "/opt/build/repo/content/post/foraging-for-research/featured.jpg": resize : image: unknown format
12:12:17 AM: ​
12:12:17 AM: ┌─────────────────────────────┐
12:12:17 AM: │   "build.command" failed    │
12:12:17 AM: └─────────────────────────────┘
12:12:17 AM: ​
12:12:17 AM:   Error message
12:12:17 AM:   Command failed with exit code 255: hugo --gc --minify -b $URL
12:12:17 AM: ​
12:12:17 AM:   Error location
12:12:17 AM:   In build.command from netlify.toml:
12:12:17 AM:   hugo --gc --minify -b $URL
12:12:17 AM: ​
12:12:17 AM:   Resolved config
12:12:17 AM:   build:
12:12:17 AM:     command: hugo --gc --minify -b $URL
12:12:17 AM:     commandOrigin: config
12:12:17 AM:     environment:
12:12:17 AM:       - NETLIFY_LFS_ORIGIN_URL
12:12:17 AM:       - HUGO_VERSION
12:12:17 AM:       - HUGO_ENABLEGITINFO
12:12:17 AM:       - HUGO_ENV
12:12:17 AM:     publish: /opt/build/repo/public
12:12:17 AM: Caching artifacts
12:12:17 AM: Started saving build plugins
12:12:17 AM: Finished saving build plugins
12:12:17 AM: Started saving pip cache
12:12:17 AM: Finished saving pip cache
12:12:17 AM: Started saving emacs cask dependencies
12:12:18 AM: Finished saving emacs cask dependencies
12:12:18 AM: Started saving maven dependencies
12:12:18 AM: Finished saving maven dependencies
12:12:18 AM: Started saving boot dependencies
12:12:18 AM: Finished saving boot dependencies
12:12:18 AM: Started saving go dependencies
12:12:18 AM: Finished saving go dependencies
12:12:18 AM: Error running command: Build script returned non-zero exit code: 1
12:12:18 AM: Failing build: Failed to build site
12:12:18 AM: Failed during stage 'building site': Build script returned non-zero exit code: 1
12:12:18 AM: Finished processing build request in 15.338613154s

Build settings:

hugo command: hugo --gc --minify -b $URL
OS: Ubuntu 16.04
Asset Optimization: All but Images is ON.

Thoughts so far:

From what I’ve gathered, it seems like the problem with the build is that the LFS references aren’t loading the proper files. Something I’ve found a bit confusing is that only PDFs display in my Netlify LMS portal, yet LFS-backed images show up on GitHub. (See screenshots.)


The file this build fails on is in the 2nd screenshot. This issue only seems to creep up when I have files that are pre-processed/transformed by hugo itself during compilation. What I’ve read online conveys that Netlify builds clone LFS-backed files to the build server, but this seems to convey otherwise – as my local builds run perfectly fine, too.

Hi. @ionlights. The firs thing that jumps out it that asset optimization is incompatible with our Large Media service as documented here. Quoting:

Netlify Large Media is not compatible with Netlify’s built-in asset optimization. If you enable Netlify Large Media, you need to select Disable asset optimization in your site dashboard under Settings > Build & deploy > Post processing > Asset optimization .

I know you have it disabled for images but would you please try disabling it completely.

Also, if Hugo is processing those images during the build, that is also incompatible with Large Media. Again, quoting from the same page:

Files tracked with Large Media are uploaded directly to the Netlify Large Media storage service on push, completely bypassing the site build. This saves build time, but also means that the files are not available to tools that process asset files during the build, such as Hugo’s image processing or the gatsby-image plugin. Depending on your needs, you may be able to replace this functionality with Netlify’s image transformation service.

If you want to uninstall Large Media, please see the following support guide:

If there are other question or if you want to uninstall Large Media, please reply here anytime.

Thanks for the reply! I wasn’t sure if all asset optimization had to be disabled.

I guess I glossed over the “… completely bypassing the site build.” snippet.

This might warrant a separate post – but… like I mentioned in the post, I only see PDFs on LMS, yet GitHub seems to be able to source images “Stored with LFS.”

Any thoughts on what might be going on, there?

Hi, @ionlights, the local git repo doesn’t have any data about which files are uploaded to which Git LFS service. This can mean that Large Media (the Netlify Git LFS service) simply doesn’t have the files.

Note, I only see three files in the Large Media storage for this site here:

All three are PDF files so no other files are store in Large Media at this time.

If that is the root cause (the files haven’t been uploaded), you can manually upload the files to Large Media using the following git command:

git lfs push --all origin

After doing that, a new deploy will be required before the change will be reflected on the site itself.

If that doesn’t resolve the issue, please send us the the output of that same command but with debugging enabled. The debugging version of that command is:

GIT_TRACE=true GIT_CURL_VERBOSE=true git lfs push --all origin

Please send that as a direct message to one of our support team (meaning, probably, me) in case there are any private details in that output. (There normally isn’t but better safe than sorry.)

Also, if the first command (and a new deploy) doesn’t fix the issue, would please send us a URL for a Git LFS asset which should work but does not?

As always, if there are questions about any of this we will be happy to answer.

Hi, @ionlights, the traced git lfs output which was PM’d to me shows all seven files tracked by Git LFS successfully uploaded to Large Media.

If you don’t put the file in the publish directory, that would cause it not to display in the Large Media tab in the web UI. Are you sure the image is being put in the publish directory?

If so, what is a URL for an image (or other Git LFS tracked file) which is deployed but not working?

What do you mean by the “publish directory”? Each of the PDFs are nested under content/, like many images – yet I don’t see the images.

These are the only directories I have in the repository:

-> tree -L 1 -d
.
├── archetypes
├── assets
├── config
├── content
├── data
├── layouts
├── resources
├── static
└── themes

9 directories

The image I showed above is here: Foraging for Research | John Muchovej (Note that this isn’t the image on Large Media, as LMS doesn’t support build-time asset manipulation, which all images on the site go through.)

It’s possible I may just need to off-load strictly PDFs to LMS and keep the images on the repository; but I’m just trying to determine if that’s the case, given the current state of LMS.

Hi, @ionlights. I’m still a little confused. I’m looking for an image URL which isn’t working.

The URL provide is a URL for the HTML page:

https://john.muchovej.com/thoughts/foraging-for-research/

Here is an image URL from that page (and note this URL is working):

https://d33wubrfki0l68.cloudfront.net/59a6f2bd12f3372394b9c66399fe05973cee7118/3e45b/thoughts/foraging-for-research/featured_hu789364e8e4c0e6f733e69f18e4d92ae5_395957_720x0_resize_q90_lanczos.jpg

What I’m looking for is a non-working URL example.

When I check the page load for the URL provided there are three 404 responses:

Two are for this URL (which isn’t hosted at Netlify so we cannot control that 404):

https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/js.min.js

The third 404 is for this URL:

https://john.muchovej.com/index.webmanifest

That is a 404 because the file index.webmanifest doesn’t exist in the deployed files for this site. It is a 404 “not found” because the file is literally not found in the bundle of deployed files.

You can download the deployed files for any successful deploy (including the currently published deploy for a site) by using the button in the following screenshot. This is a screenshot of the deploy details page for an individual deploy:

download-deploy-button-small

I’d be happy to troubleshoot any images/assets/files which are not working. However, before I can do so I need to be able to identify what image isn’t working and I don’t seem to have enough information to do that.

Would you please let us know how to find the non-working image and/or URL? If you don’t have a URL, would you please highlight in a screenshot where on the page the image should appear? Does the image work for your local version of the site? If so, what is the URL for that image on the local version?

Answers to these questions above will help us to further troubleshoot this issue.