"execute of template failed: template: _default/single.html:1:4: executing "_default/single.html" at <partial "_main.hugo">

Hello Team, Hello @jmooring , I am trying to use the hugo-theme-relearn template to build some documentation, I have noticed, when I tried to push to git with the action, getting the below warning and follow by the error even after increase the timeout to 300s.

WARN “/runner/_work/OEC-UserGuide/OEC-UserGuide/content/_index.en.md”: DEPRECATED usage of ‘json’ output format found, use ‘search’ instead; see Customization :: Hugo Relearn Theme

ERROR render of “page” failed: “/runner/_work/project-userguide/project-userguide/themes/hugo-theme-relearn/layouts/_default/single.html:1:4”: execute of template failed: template: _default/single.html:1:4: executing “_default/single.html” at <partial “_main.hugo” .>: error calling partial: partial “_main.hugo” timed out after 5m0s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the ‘timeout’ config setting.

"error building site: orender: failed to render pages: render of “404” failed: “/runner/_work/OEC-UserGuide/OEC-UserGuide/themes/hugo-theme-relearn/layouts/404.html:17:8”: execute of template failed: template: 404.html:17:8: executing “404.html” – File is nil; wrap it in if or with: {{ with partialCached “stylesheet.html” (dict “page” . “outputFormat” ) >: error calling partialCached: “/runner/_work/project-userguide/project-userguide/themes/hugo-theme-relearn/layouts/partials/stylesheet.html:35:184”: execute of template failed: template: partials/stylesheet.html:35:184: executing “partials/stylesheet.html” at <.File }}{{ .Filename }}{{ end }}"

++ _main.hugo file

{{- partialCached “page-meta.hugo” . .RelPermalink }}
{{- $outputFormat := partial “output-format.hugo” . }}
{{- partial “output-partial.hugo” (dict “base” “header” “page” . “parameter” . “outputFormat” $outputFormat) }}
{{- if not .File }}
{{- partial “output-partial.hugo” (dict “base” “body” “page” . “parameter” (dict “page” . “content” (partial “output-partial.hugo” (dict “base” “initial” “page” . “parameter” . “outputFormat” $outputFormat))) “outputFormat” $outputFormat) }}
{{- else }}
{{- partial “output-partial.hugo” (dict “base” “body” “page” . “parameter” (dict “page” . “content” (partial “output-partial.hugo” (dict “base” “content” “page” . “parameter” . “outputFormat” $outputFormat))) “outputFormat” $outputFormat) }}
{{- end }}
{{- partial “output-partial.hugo” (dict “base” “footer” “page” . “parameter” . “outputFormat” $outputFormat) }}

++Stylesheet.html

{{- $page := .page }}
{{- $outputFormat := .outputFormat }}
{{- if not $page }}
{{- $page = . }}
{{- $outputFormat = partial “output-format.hugo” $page }}
{{- end }}
{{- with $page }}
{{- $assetBusting := not .Site.Params.disableAssetsBusting }}
{{ “” | safeHTML }}
<link href=“{{“css/fontawesome-all.min.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet” media=“print” onload=“this.media=‘all’;this.onload=null;”><link href=“{{“css/fontawesome-all.min.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
<link href=“{{“css/nucleus.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
<link href=“{{“css/auto-complete.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet” media=“print” onload=“this.media=‘all’;this.onload=null;”><link href=“{{“css/auto-complete.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
<link href=“{{“css/perfect-scrollbar.min.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
<link href=“{{“css/fonts.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet” media=“print” onload=“this.media=‘all’;this.onload=null;”><link href=“{{“css/fonts.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
<link href=“{{“css/theme.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
{{- $themevariants := partialCached “get-theme-variants.hugo” . }}
{{- $themevariantmodifier := .Site.Params.themeVariantModifier | default “” }}
{{- with index $themevariants 0 }}
<link href=“{{(printf “css/theme-%s%s.css” .identifier $themevariantmodifier) | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet” id=“R-variant-style”>
<link href=“{{(printf “css/chroma-%s.css” .chroma) | safeHTML | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet” id=“R-variant-chroma-style”>
{{- end }}
<link href=“{{“css/variant.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
<link href=“{{“css/print.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet” media=“print”>
{{- $f := printf “/static/css/format-%s.css” $outputFormat }}
{{- if or (partialCached “fileExists.hugo” $f $f) (resources.Get (printf “/css/format-%s.css” $outputFormat)) }}
<link href=“{{(printf “css/format-%s.css” $outputFormat) | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
{{- end }}
<link href=“{{“css/ie.css” | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}” rel=“stylesheet”>
<script src=“{{“js/url.js” | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}”>
<script src=“{{“js/variant.js” | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}”>

{{- end }}

Note: locally, able to build and preview the changes while pushing to git getting the render error …

please share your inputs :slight_smile:

Which Hugo version are you using locally?
Which Hugo version are you using remotely?
Which version of the relearn theme are you using?

@McShelby

Feel free to continue this discussion in the themes issues list.

Without seeing your code, I can only guess:

  • you are using a Hugo version older than 0.112.4
  • your number of pages is huge (the theme has limitations with this)

Hello @jmooring , Somehow, I missed to reply back to your questions,

Below are the required details, **locally able to build successfully **

Which Hugo version are you using locally? - v0.121.2
Which Hugo version are you using remotely? - v0.124.1
Which version of the relearn theme are you using? - 0.112.4

ERROR render of “page” failed: “/runner/_work/documentation/documentation/themes/hugo-theme-relearn/layouts/_default/single.html:1:4”: execute of template failed: template: _default/single.html:1:4: executing “_default/single.html” at <partial “_main.hugo” .>: error calling partial: partial “_main.hugo” timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the ‘timeout’ config setting.

Error: error building site: render: failed to render pages: render of “page” failed: “/runner/_work/documentation/documentation/themes/hugo-theme-relearn/layouts/_default/single.html:1:4”: execute of template failed: template: _default/single.html:1:4: executing “_default/single.html” at <partial “_main.hugo” .>: error calling partial: partial “_main.hugo” timed out after 30s. This is most likely due to infinite recursion. If this is just a slow template, you can try to increase the ‘timeout’ config setting."

config.toml file

baseURL = ‘’
languageCode = ‘en-us’
theme = ‘hugo-theme-relearn’
canonifyURLs = true
relativeURLs = true

[params.carouselHomepage]
enable = false # default is true

[params.navigation]
#update logo
logo = “./static/images/oneeng-transparent.png”

#[taxonomies]

tag = “tags”

Categories are disabled by default.

#[outputs]
#home = [ “HTML”, “RSS”, “JSON”]

[params]

Change default color scheme with a variant one. Can be “red”, “blue”, “green”.

#themeVariant = “#007bff
themeVariant = [“light-mode”, “dark-mode”]
themeVariantAuto = [“light-mode”, “dark-mode”]

arrow navigation

disableNextPrev = true
author.anme = ‘OneEngConnect Team’
#disableKinds = [“RSS”, “taxonomy”, “taxonomyTerm”]

collapsibleMenu = true

Remove, when the generated files are not in the same repository

disableAssetsBusting = true
disableBreadcrumb = false
disableExplicitIndexURLs = true
disableLandingPageButton = false
disableSwagger= true
landingPageName = “ Overview”
statisticsEnabled = true

[params.csp]
childsrc = [“‘self’”]
fontsrc = [“‘self’”, “https://fonts.gstatic.com”, “https://cdn.jsdelivr.net/”]
formaction = [“‘self’”]
framesrc = [“‘self’”]
imgsrc = [“‘self’”]
objectsrc = [“‘none’”]
stylesrc = [
“‘self’”,
“‘unsafe-inline’”,
https://fonts.googleapis.com/”,
https://cdn.jsdelivr.net/
]
scriptsrc = [“‘self’”, “‘unsafe-inline’”, “https://www.google-analytics.com”]
prefetchsrc = [“‘self’”]

When posting code, configuration, or data on this forum, please wrap the text within backticks or use the </> button in the menu.

```
my code
```

Please see the reply from @McShelby .