Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hugo Build Timeout Due to Recursive Call in head.html Partial #275

Open
harshita9104 opened this issue Feb 6, 2025 · 4 comments · May be fixed by #276
Open

Hugo Build Timeout Due to Recursive Call in head.html Partial #275

harshita9104 opened this issue Feb 6, 2025 · 4 comments · May be fixed by #276
Labels
component/rendering Relates to rendering engine and dependencies kind/bug Something isn't working kind/question Further information is requested

Comments

@harshita9104
Copy link

Describe the bug

While setting up the project locally, Hugo fails to build the site due to an infinite recursive call in head.html, causing a timeout error. This prevents the site from rendering and makes local development impossible.

Error: error building site: render: failed to render pages: render of "E:/Projects/microcks.io/content/documentation/tutorials/first-soap-mock.md" failed:
"E:\Projects\microcks.io\themes\microcks\layouts\documentation\baseof.html:9:9": execute of template failed:
template: documentation/single.html:9:9: executing "documentation/single.html" at <partial "essentials/head.html" .>:
error calling partial: partial "essentials/head.html" timed out after 30s. This is most likely due to infinite recursion.

Expected behavior

Hugo should successfully build the site without timing out.
The local development server should start, allowing developers to preview the site on http://localhost:1313/.
No infinite recursion should occur in the head.html partial.

Actual behavior

Hugo build fails with a timeout error due to infinite recursion in head.html.
The site does not render, making local development impossible.
Hugo logs indicate a recursive partial call in themes/microcks/layouts/documentation/baseof.html and themes/microcks/layouts/_default/baseof.html.

How to Reproduce?

1.Clone the repository and navigate to the project directory.
2. Run: hugo server --bind 0.0.0.0 --baseURL=http://localhost:1313/ --logLevel debug
3. The build process times out with a error.
4. The local development server does not start successfully.

Microcks version or git rev

No response

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

Check for self-referencing calls:
{{ partial "essentials/head.html" . }}
This can cause an infinite loop if head.html calls itself.

Increase Hugo Timeout (Temporary Workaround)

harshita9104 added a commit to harshita9104/microcks.io that referenced this issue Feb 6, 2025
harshita9104 added a commit to harshita9104/microcks.io that referenced this issue Feb 6, 2025
@lbroudoux
Copy link
Member

What is the hugo version you're running? I can't reproduce this issue with:

$ hugo version
hugo v0.127.0+extended darwin/arm64 BuildDate=2024-06-05T10:27:59Z VendorInfo=brew

@lbroudoux lbroudoux added kind/bug Something isn't working kind/question Further information is requested component/rendering Relates to rendering engine and dependencies labels Feb 7, 2025
@yada
Copy link
Member

yada commented Feb 7, 2025

Hi @harshita9104,

Like @lbroudoux, I tried to reproduce on my side using recent versions of Hugo but without success:

1/

> hugo version
hugo v0.141.0+extended+withdeploy darwin/arm64 BuildDate=2025-01-16T13:11:18Z VendorInfo=brew

❯ hugo server
hugo: collected modules in 720 msWatching for changes in /tmp/microcks.io/{archetypes,assets,content,hugo_stats.json,i18n,layouts,package.json,postcss.config.js,static,themes}
Watching for config changes in /tmp/microcks.io/hugo.toml, /tmp/microcks.io/config/_default, /tmp/microcks.io/themes/microcks/config.toml, /tmp/microcks.io/go.mod
Start building sites …
hugo v0.141.0+extended+withdeploy darwin/arm64 BuildDate=2025-01-16T13:11:18Z VendorInfo=brew


                   |  EN
-------------------+-------
  Pages            |  186
  Paginator pages  |    7
  Non-page files   |   12
  Static files     |   66
  Processed images | 1532
  Aliases          |    1
  Cleaned          |    0

Built in 53173 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

❯ hugo server --bind 0.0.0.0 --baseURL=http://localhost:1313/ --logLevel debug
Watching for changes in /tmp/microcks.io/{archetypes,assets,content,hugo_stats.json,i18n,layouts,package.json,postcss.config.js,static,themes}
Watching for config changes in /tmp/microcks.io/hugo.toml, /tmp/microcks.io/config/_default, /tmp/microcks.io/themes/microcks/config.toml, /tmp/microcks.io/go.mod
Start building sites …
hugo v0.141.0+extended+withdeploy darwin/arm64 BuildDate=2025-01-16T13:11:18Z VendorInfo=brew

INFO  build:  step process substep collect files 165 files_total 165 pages_total 153 resources_total 12 duration 13.716292ms
INFO  build:  step process duration 14.011584ms
INFO  build:  step assemble duration 4.467834ms
INFO  static: syncing static files to / duration 36.293667ms
INFO  build:  step render substep pages site en outputFormat html duration 1.502323292s
INFO  build:  step render substep pages site en outputFormat json duration 21.065834ms
INFO  build:  step render substep pages site en outputFormat rss duration 5.922292ms
INFO  build:  step render substep pages site en outputFormat webappmanifest duration 1.517542ms
INFO  build:  step render pages 193 content 154 duration 1.531099917s
INFO  build:  step render deferred count 0 duration 1.125µs
INFO  build:  step postProcess duration 110.708µs
INFO  build:  duration 1.551478334s

                   |  EN
-------------------+-------
  Pages            |  186
  Paginator pages  |    7
  Non-page files   |   12
  Static files     |   66
  Processed images | 1532
  Aliases          |    1
  Cleaned          |    0

Built in 1552 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 0.0.0.0)
Press Ctrl+C to stop

2/
Also tested using the latest Hugo version:

❯ brew upgrade
==> Upgrading 19 outdated packages:
.../...
hugo 0.141.0 -> 0.143.1
.../...
==> Upgrading hugo
  0.141.0 -> 0.143.1
==> Pouring hugo--0.143.1.arm64_sequoia.bottle.tar.gz
.../...
❯ hugo version
hugo v0.143.1+extended+withdeploy darwin/arm64 BuildDate=2025-02-04T08:57:38Z VendorInfo=brew

❯ hugo server
hugo: collected modules in 894 msWatching for changes in /tmp/microcks.io/{archetypes,assets,content,hugo_stats.json,i18n,layouts,package.json,postcss.config.js,static,themes}
Watching for config changes in /tmp/microcks.io/hugo.toml, /tmp/microcks.io/config/_default, /tmp/microcks.io/themes/microcks/config.toml, /tmp/microcks.io/go.mod
Start building sites …
hugo v0.143.1+extended+withdeploy darwin/arm64 BuildDate=2025-02-04T08:57:38Z VendorInfo=brew


                   |  EN
-------------------+-------
  Pages            |  186
  Paginator pages  |    7
  Non-page files   |   12
  Static files     |   66
  Processed images | 1532
  Aliases          |    1
  Cleaned          |    0

Built in 53878 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

❯ hugo server --bind 0.0.0.0 --baseURL=http://localhost:1313/ --logLevel debug
Watching for changes in /tmp/microcks.io/{archetypes,assets,content,hugo_stats.json,i18n,layouts,package.json,postcss.config.js,static,themes}
Watching for config changes in /tmp/microcks.io/hugo.toml, /tmp/microcks.io/config/_default, /tmp/microcks.io/themes/microcks/config.toml, /tmp/microcks.io/go.mod
Start building sites …
hugo v0.143.1+extended+withdeploy darwin/arm64 BuildDate=2025-02-04T08:57:38Z VendorInfo=brew

INFO  build:  step process substep collect files 165 files_total 165 pages_total 153 resources_total 12 duration 11.573875ms
INFO  build:  step process duration 11.603542ms
INFO  build:  step assemble duration 2.200417ms
INFO  static: syncing static files to / duration 38.4595ms
INFO  build:  step render substep pages site en outputFormat html duration 1.395560666s
INFO  build:  step render substep pages site en outputFormat json duration 20.211208ms
INFO  build:  step render substep pages site en outputFormat rss duration 4.757209ms
INFO  build:  step render substep pages site en outputFormat webappmanifest duration 1.626667ms
INFO  build:  step render pages 193 content 154 duration 1.422397834s
INFO  build:  step render deferred count 0 duration 1.083µs
INFO  build:  step postProcess duration 113.416µs
INFO  build:  duration 1.437478042s

                   |  EN
-------------------+-------
  Pages            |  186
  Paginator pages  |    7
  Non-page files   |   12
  Static files     |   66
  Processed images | 1532
  Aliases          |    1
  Cleaned          |    0

Built in 1437 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 0.0.0.0)
Press Ctrl+C to stop
DEBUG Received System Events: [CHMOD         "/tmp/microcks.io/assets/jsconfig.json" WRITE         "/tmp/microcks.io/assets/jsconfig.json"]

Can you try to reproduce or give directions? Cause currently, we do not see any issues.

@yada
Copy link
Member

yada commented Feb 7, 2025

What is the hugo version you're running? I can't reproduce this issue with:

$ hugo version
hugo v0.127.0+extended darwin/arm64 BuildDate=2024-06-05T10:27:59Z VendorInfo=brew

And can you ensure you are using Hugo's "extended" version (which is mandatory for the theme we are using)?
Ref: https://gohugo.io/troubleshooting/faq/#i-get--this-feature-is-not-available-in-your-current-hugo-version

@yada
Copy link
Member

yada commented Feb 10, 2025

@harshita9104 I am looking forward to your feedback to see if we missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/rendering Relates to rendering engine and dependencies kind/bug Something isn't working kind/question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants