microsoft / Oryx

Build your repo automatically.
Other
769 stars 176 forks source link

Hugo version detected incorrectly #2533

Closed cchessnz closed 1 month ago

cchessnz commented 1 month ago

Bug Report

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 commented 1 month ago

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 commented 1 month ago

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).