Please help with deployment exit code 255

Please help with my deployment error.
I am kind of newbie to Netlify. I maintain my blog on Netlify, today when I tried to post a new blog, I got the following deployment error. I have just successfully posted a blog one day ago, I didn’t know what happened after my last posting. I tried to make my new blog as simple as possible for testing if there is any weird text or content in my blog caused error, but no lucky.

Can anyone help me with this?

Thank you in advance.

8:31:28 PM: build-image version: 3ffff9df3d5419545acc1b673a54de348174406d (focal)
8:31:28 PM: buildbot version: 234adcfe967f1d318bfad465ff22f561d657197d
8:31:28 PM: Fetching cached dependencies
8:31:28 PM: Starting to download cache of 312.9MB
8:31:32 PM: Finished downloading cache in 3.903s
8:31:32 PM: Starting to extract cache
8:31:34 PM: Finished extracting cache in 2.09s
8:31:34 PM: Finished fetching cache in 6.068s
8:31:34 PM: Starting to prepare the repo for build
8:31:35 PM: Preparing Git Reference refs/heads/master
8:31:37 PM: Custom publish path detected. Proceeding with the specified path: β€œXiangWebsite/public”
8:31:37 PM: manpath: warning: $PATH not set
8:31:37 PM: Starting to install dependencies
8:31:37 PM: Python version set to 3.8
8:31:37 PM: Attempting Ruby version 2.7.2, read from environment
8:31:38 PM: Using Ruby version 2.7.2
8:31:38 PM: Started restoring cached go cache
8:31:38 PM: Finished restoring cached go cache
8:31:40 PM: go version go1.19.13 linux/amd64
8:31:40 PM: Using PHP version 8.0
8:31:41 PM: Started restoring cached Node.js version
8:31:42 PM: Finished restoring cached Node.js version
8:31:42 PM: v16.20.2 is already installed.
8:31:42 PM: Now using node v16.20.2 (npm v8.19.4)
8:31:42 PM: Enabling Node.js Corepack
8:31:42 PM: Started restoring cached build plugins
8:31:42 PM: Finished restoring cached build plugins
8:31:43 PM: Successfully installed dependencies
8:31:43 PM: Starting build script
8:31:43 PM: Detected 2 framework(s)
8:31:43 PM: β€œhugo” at version β€œunknown”
8:31:43 PM: β€œzola” at version β€œunknown”
8:31:43 PM: Section completed: initializing
8:31:45 PM: ​
8:31:45 PM: Netlify Build
8:31:45 PM: ────────────────────────────────────────────────────────────────
8:31:45 PM: ​
8:31:45 PM: ❯ Version
8:31:45 PM: @netlify/build 29.29.4
8:31:45 PM: ​
8:31:45 PM: ❯ Flags
8:31:45 PM: baseRelDir: true
8:31:45 PM: buildId: 656db88f881aec0008cd433b
8:31:45 PM: deployId: 656db88f881aec0008cd433d
8:31:45 PM: ​
8:31:45 PM: ❯ Current directory
8:31:45 PM: /opt/build/repo/XiangWebsite
8:31:45 PM: ​
8:31:45 PM: ❯ Config file
8:31:45 PM: No config file was defined: using default values.
8:31:45 PM: ​
8:31:45 PM: ❯ Context
8:31:45 PM: production
8:31:45 PM: ​
8:31:45 PM: ❯ Installing plugins
8:31:45 PM: - @netlify/plugin-lighthouse@5.0.0
8:31:47 PM: ​
8:31:47 PM: ❯ Loading plugins
8:31:47 PM: - @algolia/netlify-plugin-crawler@1.0.0 from Netlify app
8:31:47 PM: - @netlify/plugin-lighthouse@5.0.0 from Netlify app
8:31:48 PM: ​
8:31:48 PM: Build command from Netlify app
8:31:48 PM: ────────────────────────────────────────────────────────────────
8:31:48 PM: ​
8:31:48 PM: $ hugo
8:31:48 PM: Start building sites …
8:31:48 PM: hugo v0.85.0-724D5DB5+extended linux/amd64 BuildDate=2021-07-05T10:46:28Z VendorInfo=gohugoio
8:31:48 PM: ERROR 2023/12/04 11:31:48 render of β€œhome” failed: execute of template failed: template: index.html:36:20: executing β€œcontent” at <.Render>: error calling Render: failed to execute template [β€œsummary”] v: β€œ/opt/build/repo/XiangWebsite/themes/loveit/layouts/_default/summary.html:69:32”: execute of template failed: template: _default/summary.html:69:32: executing β€œ_default/summary.html” at <partialCached β€œfunction/path.html” $value $value>: error calling partialCached: partial that returns a value needs a non-zero argument.
8:31:48 PM: Error: Error building site: failed to render pages: render of β€œpage” failed: execute of template failed: template: posts/single.html:96:12: executing β€œcontent” at <partial β€œsingle/footer.html” .>: error calling partial: β€œ/opt/build/repo/XiangWebsite/themes/loveit/layouts/partials/single/footer.html:54:32”: execute of template failed: template: partials/single/footer.html:54:32: executing β€œpartials/single/footer.html” at <partialCached β€œfunction/path.html” $value $value>: error calling partialCached: partial that returns a value needs a non-zero argument.
8:31:48 PM: Total in 199 ms
8:31:48 PM: Usage:
8:31:48 PM: hugo [flags]
8:31:48 PM: hugo [command]
8:31:48 PM: Available Commands:
8:31:48 PM: config Print the site configuration
8:31:48 PM: convert Convert your content to different formats
8:31:48 PM: deploy Deploy your site to a Cloud provider.
8:31:48 PM: env Print Hugo version and environment info
8:31:48 PM: gen A collection of several useful generators.
8:31:48 PM: help Help about any command
8:31:48 PM: import Import your site from others.
8:31:48 PM: list Listing out various types of content
8:31:48 PM: mod Various Hugo Modules helpers.
8:31:48 PM: new Create new content for your site
8:31:48 PM: server A high performance webserver
8:31:48 PM: version Print the version number of Hugo
8:31:48 PM: Flags:
8:31:48 PM: -b, --baseURL string hostname (and path) to the root, e.g. http://spf13.com/
8:31:48 PM: -D, --buildDrafts include content marked as draft
8:31:48 PM: -E, --buildExpired include expired content
8:31:48 PM: -F, --buildFuture include content with publishdate in the future
8:31:48 PM: --cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
8:31:48 PM: --cleanDestinationDir remove files from destination not found in static directories
8:31:48 PM: --config string config file (default is path/config.yaml|json|toml)
8:31:48 PM: --configDir string config dir (default β€œconfig”)
8:31:48 PM: -c, --contentDir string filesystem path to content directory
8:31:48 PM: --debug debug output
8:31:48 PM: -d, --destination string filesystem path to write files to
8:31:48 PM: --disableKinds strings disable different kind of pages (home, RSS etc.)
8:31:48 PM: --enableGitInfo add Git revision, date and author info to the pages
8:31:48 PM: -e, --environment string build environment
8:31:48 PM: --forceSyncStatic copy all files when static is changed.
8:31:48 PM: --gc enable to run some cleanup tasks (remove unused cache files) after the build
8:31:48 PM: -h, --help help for hugo
8:31:48 PM: --i18n-warnings print missing translations
8:31:48 PM: --ignoreCache ignores the cache directory
8:31:48 PM: --ignoreVendor ignores any _vendor directory
8:31:48 PM: --ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
8:31:48 PM: -l, --layoutDir string filesystem path to layout directory
8:31:48 PM: --log enable Logging
8:31:48 PM: --logFile string log File path (if set, logging enabled automatically)
8:31:48 PM: --minify minify any supported output format (HTML, XML etc.)
8:31:48 PM: --noChmod don"t sync permission mode of files
–noTimes don"t sync modification time of files
–path-warnings print warnings on duplicate target paths etc.
8:31:48 PM: --poll string set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes
8:31:48 PM: --print-mem print memory usage to screen at intervals
8:31:48 PM: --quiet build in quiet mode
8:31:48 PM: --renderToMemory render to memory (only useful for benchmark testing)
8:31:48 PM: -s, --source string filesystem path to read files relative from
8:31:48 PM: --templateMetrics display metrics about template executions
8:31:48 PM: --templateMetricsHints calculate some improvement hints when combined with --templateMetrics
8:31:48 PM: -t, --theme strings themes to use (located in /themes/THEMENAME/)
8:31:48 PM: --themesDir string filesystem path to themes directory
8:31:48 PM: --trace file write trace to file (not useful in general)
8:31:48 PM: -v, --verbose verbose output
8:31:48 PM: --verboseLog verbose logging
8:31:48 PM: -w, --watch watch filesystem for changes and recreate as needed
8:31:48 PM: Additional help topics:
8:31:48 PM: hugo check Contains some verification checks
8:31:48 PM: Use β€œhugo [command] --help” for more information about a command.
8:31:48 PM: ​
8:31:48 PM: β€œbuild.command” failed
8:31:48 PM: ────────────────────────────────────────────────────────────────
8:31:48 PM: ​
8:31:48 PM: Error message
8:31:48 PM: Command failed with exit code 255: hugo (Search results for '"non-zero exit code: 255"' - Netlify Support Forums)
8:31:48 PM: ​
8:31:48 PM: Error location
8:31:48 PM: In Build command from Netlify app:
8:31:48 PM: hugo
8:31:48 PM: ​
8:31:48 PM: Resolved config
8:31:48 PM: build:
8:31:48 PM: base: /opt/build/repo/XiangWebsite
8:31:48 PM: command: hugo
8:31:48 PM: commandOrigin: ui
8:31:48 PM: environment:
8:31:48 PM: - ALGOLIA_API_KEY
8:31:48 PM: - ALGOLIA_BASE_URL
8:31:48 PM: publish: /opt/build/repo/XiangWebsite/public
8:31:48 PM: publishOrigin: ui
8:31:48 PM: plugins:
8:31:48 PM: - inputs: {}
8:31:48 PM: origin: ui
8:31:48 PM: package: β€œ@algolia/netlify-plugin-crawler”
8:31:48 PM: - inputs: {}
8:31:48 PM: origin: ui
8:31:48 PM: package: β€œ@netlify/plugin-lighthouse”
8:31:49 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:31:49 PM: Failing build: Failed to build site
8:31:49 PM: Finished processing build request in 20.759s
8:31:49 PM: Failed during stage β€œbuilding site”: Build script returned non-zero exit code: 2

Hi @ruanxiang,

Thanks for reaching out and welcome to Netlify’s Support Forums!

Looks like the error starts here:

This looks like it may be an issue with the template. I found a similar issue here:

Hi, Melvin,

Thank you for the quick response.
I have checked the issue you shared, but unfortunately I still don’t know how to fix the problem.

I just tried to use latest node.js version to deploy the site, but failed with the same error again.
I am so sorry, could you please give more detailed steps for how to deal with this β€œtemplate” error?

best regards,

Hi, @ruanxiang. Hugo is a program written in Go. It doesn’t use Node.js at all in the default configuration so changing the node version won’t affect this error.

Does the site build successfully locally with Hugo? If it works locally but not at Netlify, the most common reason for this is that Netlify is using a different version of Hugo. If so, this can be fixed by creating an environment variable to change which version of Hugo Netlify uses so it matches the local version.

The instructions to change the Hugo version at Netlify can be found here:

https://docs.netlify.com/integrations/frameworks/hugo/#hugo-version

If that doesn’t resolve the issue or if there are other questions, please let us know.

1 Like

Hi, @luke , thank you for the response. Yes, I know Node.js has nothing to do with Hugo, I just run out of idea to fix the problem, and tried to modify many Netlify build configures to see if anything changed. :frowning:

Thank you so much for the hint, I will check it.

I set Hugo version to the version recommended by the themes I use, and the problem solved. Thank you so much for your support.

glad to hear you got this issue resolved. Thanks fro writing back in. :+1:t6: