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 version detected incorrectly #2533

Closed
cchessnz opened this issue Oct 12, 2024 · 2 comments
Closed

Hugo version detected incorrectly #2533

cchessnz opened this issue Oct 12, 2024 · 2 comments

Comments

@cchessnz
Copy link

Bug Report

  • At what date and time did you most recently experience the problem?
    13 Oct 2024 12:20am NZDT

  • Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.
    Azure Portal - deploying a Static Web App

  • If your repo is publicly available please share its URL:

  • What happened?
    I am trying to deploy a new Hugo application as Static Web App. However, the deployment failed. The log shows that Oryx detected the Hugo version as 0.112.5, however I am using version 0.135.0 . Then , deployment failed because the theme I am using, "Ananke", performs a version check and won't run on 0.112.5 .

  • What did you expect or want to happen?
    Expect successful deployment.

  • How can we reproduce it?
    Create a Hugo app via https://gohugo.io/getting-started/quick-start/ , with Ananke theme as shown on that page, , then deploy by exactly following the instructions at https://learn.microsoft.com/en-us/azure/static-web-apps/publish-hugo

  • Do you have log output? Please include between the backticks:

Run Azure/static-web-apps-deploy@v1
with:
  azure_static_web_apps_api_token: ***
  repo_token: ***
  action: upload
  app_location: /
  output_location: public

/usr/bin/docker run --name efa358e9cff3357cf417a8aa50c15b1ae1eb0_04c87c --label 1efa35 --workdir /github/workspace --rm -e "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN" -e "INPUT_REPO_TOKEN" -e "INPUT_ACTION" -e "INPUT_APP_LOCATION" -e "INPUT_API_LOCATION" -e "INPUT_OUTPUT_LOCATION" -e "INPUT_API_BUILD_COMMAND" -e "INPUT_APP_ARTIFACT_LOCATION" -e "INPUT_APP_BUILD_COMMAND" -e "INPUT_ROUTES_LOCATION" -e "INPUT_SKIP_APP_BUILD" -e "INPUT_CONFIG_FILE_LOCATION" -e "INPUT_SKIP_API_BUILD" -e "INPUT_PRODUCTION_BRANCH" -e "INPUT_DEPLOYMENT_ENVIRONMENT" -e "INPUT_IS_STATIC_EXPORT" -e "INPUT_DATA_API_LOCATION" -e "INPUT_GITHUB_ID_TOKEN" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e "ACTIONS_RESULTS_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/kht/kht":"/github/workspace" 1efa35:8e9cff3357cf417a8aa50c15b1ae1eb0
DeploymentId: 8a595931-5f5e-4c8a-949c-87d8627be49d

Try to validate location at: '/github/workspace'.
App Directory Location: '/' was found.
Try to validate location at: '/github/workspace/swa-db-connections'.
Looking for event info
Starting to build app with Oryx
Azure Static Web Apps utilizes Oryx to build both static applications and Azure Functions. You can find more details on Oryx here: https://github.com/microsoft/Oryx
---Oryx build logs---


Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20231128.3, Commit: 0b76566110f0db32097b869761e056fd9b01848d, ReleaseTagName: 20231128.3

Build Operation ID: 9e031150521ee3ec
OS Type           : bullseye
Image Type        : jamstack

Detecting platforms...
Detected following platforms:
  hugo: 0.112.5
Version '0.112.5' of platform 'hugo' is not installed. Generating script to install it...
Detected the following frameworks: hugo


Source directory     : /github/workspace
Destination directory: /bin/staticsites/8a595931-5f5e-4c8a-949c-87d8627be49d-swa-oryx/app

retry 0

Downloading and extracting hugo version 0.112.5 to /opt/hugo/0.112.5...
Downloaded in 0 sec(s).
Extracting contents...
Done in 0 sec(s).

Installing golang tooling and language...
1.15.8
go1.15.8.linux-amd64.tar.gz
retry 0

Using Hugo version:
hugo v0.112.5-48e33e10af2feb2a0e1c32d04880ed016619f2d8+extended linux/amd64 BuildDate=2023-05-29T07:27:36Z VendorInfo=gohugoio

WARN 2024/10/12 11:20:30 Module "ananke" is not compatible with this Hugo version; run "hugo mod graph" for more information.
Start building sites … 
hugo v0.112.5-48e33e10af2feb2a0e1c32d04880ed016619f2d8+extended linux/amd64 BuildDate=2023-05-29T07:27:36Z VendorInfo=gohugoio
ERROR 2024/10/12 11:20:30 render of "taxonomy" failed: "/github/workspace/themes/ananke/layouts/_default/baseof.html:29:7": execute of template failed: template: _default/terms.html:29:7: executing "_default/terms.html" at <partial "site-style.html" .>: error calling partial: "/github/workspace/themes/ananke/layouts/partials/site-style.html:1:8": execute of template failed: template: partials/site-style.html:1:8: executing "partials/site-style.html" at <partialCached "func/style/GetMainCSS" "style/GetMainCSS">: error calling partialCached: "/github/workspace/themes/ananke/layouts/partials/func/style/GetMainCSS.html:69:23": execute of template failed: template: partials/func/style/GetMainCSS.html:69:23: executing "partials/func/style/GetMainCSS.html" at <css>: can't evaluate field Sass in type interface {}
ERROR 2024/10/12 11:20:30 render of "taxonomy" failed: "/github/workspace/themes/ananke/layouts/_default/baseof.html:29:7": execute of template failed: template: _default/terms.html:29:7: executing "_default/terms.html" at <partial "site-style.html" .>: error calling partial: "/github/workspace/themes/ananke/layouts/partials/site-style.html:1:8": execute of template failed: template: partials/site-style.html:1:8: executing "partials/site-style.html" at <partialCached "func/style/GetMainCSS" "style/GetMainCSS">: error calling partialCached: "/github/workspace/themes/ananke/layouts/partials/func/style/GetMainCSS.html:69:23": execute of template failed: template: partials/func/style/GetMainCSS.html:69:23: executing "partials/func/style/GetMainCSS.html" at <css>: can't evaluate field Sass in type interface {}
Total in 28 ms
Error: error building site: render: failed to render pages: render of "home" failed: "/github/workspace/themes/ananke/layouts/_default/baseof.html:29:7": execute of template failed: template: index.html:29:7: executing "index.html" at <partial "site-style.html" .>: error calling partial: "/github/workspace/themes/ananke/layouts/partials/site-style.html:1:8": execute of template failed: template: partials/site-style.html:1:8: executing "partials/site-style.html" at <partialCached "func/style/GetMainCSS" "style/GetMainCSS">: error calling partialCached: "/github/workspace/themes/ananke/layouts/partials/func/style/GetMainCSS.html:69:23": execute of template failed: template: partials/func/style/GetMainCSS.html:69:23: executing "partials/func/style/GetMainCSS.html" at <css>: can't evaluate field Sass in type interface {}


---End of Oryx build logs---
Oryx has failed to build the solution.

For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/en-us/azure/static-web-apps/
If you believe this behavior is unexpected, please raise a GitHub issue at https://github.com/azure/static-web-apps/issues/
Exiting

@cchessnz
Copy link
Author

I have tried creating an Environment Variable under the SWA , HUGO_VERSION = 0.135.0 . However this causes no change; the build log still fails and says that it detected hugo version 0.112.5 .

@cchessnz
Copy link
Author

I have found that I can work around the problem by adding env: and HUGO_VERSION = 0.135.0 to the .yml file under .github/workflows/ , instead of adding Environment Variables through the Azure Portal.

This means my site is now usable, although it'd still be good if the default behaviour is fixed or gives a useful message (there's no reason for it to say "detected 0.112.5" when I am not using that version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant