Azure / Azure/static-web-apps

GitHub action deploying Hugo to Azure Static web apps failed with Error: Oops... An unexpected error has occurred

Open
#893 1 comment 0 reactions 0 assignees View on GitHub
oryx
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

## What happened?
A recent attempt to deploy the Hugo site failed through GitHub actions.
Re-deployment of the old build that was successful 4 days back failed today. 😞

![image](https://user-images.githubusercontent.com/2056238/185640623-499a75f2-eb36-41fc-a00a-1ee313d6045e.png)

## GitHub action Log
```
Run Azure/static-web-apps-deploy@v1
with:
action: upload
app_location: /
azure_static_web_apps_api_token: ***
output_location: public
app_build_command: hugo --minify
repo_token: ***
/usr/bin/docker run --name ba713ef70036947ea8471e7079af87ce8_ff5813 --label 94859b --workdir /github/workspace --rm -e INPUT_ACTION -e INPUT_APP_LOCATION -e INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN -e INPUT_API_LOCATION -e INPUT_OUTPUT_LOCATION -e INPUT_APP_BUILD_COMMAND -e INPUT_REPO_TOKEN -e INPUT_API_BUILD_COMMAND -e INPUT_APP_ARTIFACT_LOCATION -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 HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -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_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 RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_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/TechNews/TechNews":"/github/workspace" 94859b:a713ef70036947ea8471e7079af87ce8
DeploymentId: ac8e5f44-9a77-4577-98d5-e5709673483[2](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:2)

App Directory Location: '/' was found.
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 will build app with the following custom override command: hugo --minify
---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.20220621.1, Commit: 82ed84f0f[3](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:3)fd3a25ded3029f137601f5[4](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:4)e7a1d0[5](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:5), ReleaseTagName: 20220[6](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:6)21.1

Build Operation ID: |I8gjcsRM0+8=.66cd0583_
Repository Commit : [7](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:7)902a7e911bcea50bc0[8](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:8)8e285fd2dae[9](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:10)96d73[13](https://github.com/NivraSoft/TechNews/runs/7919969352?check_suite_focus=true#step:4:14)2

Detecting platforms...
Error: Oops... An unexpected error has occurred.

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

- Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.
Azure static web app deployed by Github Actions.

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

```

## Github Action

```
name: Azure Static App
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

- name: Azure Static Web Apps Deploy
uses: Azure/static-web-apps-deploy@v1
with:
# Action to perform
action: "upload"
# Directory location of the application source code
app_location: "/" # App source code path
# Required token
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_XXXXXXXXXX }}
# Custom command for Oryx to run when building Azure Functions source code
# api_build_command: # optional
# Directory location of the Azure Functions source code
api_location: "" # Api source code path - optional
# Identical in use to output_location
# app_artifact_location: # optional
# Directory location of the compiled application code after building
output_location: "public" # Built app content directory -
# Custom command for Oryx to run when building application source code
app_build_command: "hugo --minify"
# Token for interacting with the Github repository. Currently used only for commenting on Pull Requests.
repo_token: ${{ secrets.GITHUB_TOKEN }}
# Directory location where the routes.json file can be found in the source code
# routes_location: # optional
# Skips the build step for the application source code if set to true.
# skip_app_build: # optional
```

It would be extremely helpful to see something more than "Error: Oops... An unexpected error has occurred."

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.