Azure / Azure/static-web-apps-cli

Deployment in CD-Pipeline fails with "An unknown exception has occurred"

Abierto
#666 4 comentarios 0 reacciones 1 asignado Reclamado por @Reshmi-Sriram Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
668
Forks
156
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**Are you accessing the CLI from the default port `:4280` ?**

- [ ] No, I am using a different port number (`--port`) and accessing the CLI from that port
- [X] Yes, I am accessing the CLI from port `:4280`

> Make sure you are accessing the URL printed in the console when running `swa start`!

**ℹ️ NOTE: Make sure to enable debug logs when running any `swa` commands using `--verbose=silly`**

**Describe the bug**
When trying to deploy a website that is built inside our CI/CD-Pipeline using the `swa`command fails with the following error message: "An unknown exception has occurred". The same project using the same commands can be deployed from my computer. The page has been built with hugo.

**To Reproduce**
I don't exactly know how to reproduce this. If this becomes relevant, i can try to provide a minimal example. Another Pipeline that deploys and Gatsby project exactly the same way does succeed.

**Expected behavior**
I expect a succeeding deployment or at least a error message that describes the error.

**Additional context**
Log output

```
$ swa deploy --verbose silly -d ${DEPLOYMENT_TOKEN} --env production --swa-config-location ./ ./public
Welcome to Azure Static Web Apps CLI (1.0.6)
Getting config file options from swa-cli.config.json...
Changed directory to
Deploying front-end files from folder:
/public
Deployment token provided via flag
- --deployment-token:
Deploying to environment: production
Trying to read workflow config with values:
- appLocation:
- outputLocation: /public
- apiLocation:
No workflow config folder found at /.github/workflows
Validating user workflow config (BEFORE):
- appLocation:
- outputLocation: /public
- apiLocation:
Validating user workflow config (AFTER):
- appLocation:
- apiLocation:
- outputLocation: /public
Loading staticwebapp.config.json schema...
Schema loaded successfully from https://json.schemastore.org/staticwebapp.config.json
Compiling schema...
Reading content from staticwebapp.config.json...
Parsing staticwebapp.config.json...
Validating staticwebapp.config.json...
File validated successfully. Continuing with configuration!
Content parsed successfully
Found configuration file:
/staticwebapp.config.json
Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary
Fetching release metadata for version: stable. Please wait...
- version: stable
- buildId: 1.0.022431
- publishDate: 2023-02-21T18:46:09.9616432Z
- files:
- linux-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.022431/linux/StaticSitesClient
- sha: a0424f02b72b0e292e23fa1774a579f3a83cc2280af46a19682c11423e55a134
- win-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.022431/windows/StaticSitesClient.exe
- sha: 78476f93e8357ebd5b6676c66747c6f0432084615a5cecaa43e4afbda2533176
- osx-x64:
- url: https://swalocaldeploy.azureedge.net/downloads/1.0.022431/macOS/StaticSitesClient
- sha: 0f2dc106903167d5900d9875321fd99a11349d21177b4794495b45e3df175755
- Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.022431/linux/StaticSitesClient@1.0.022431
[swa] ✔ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.022431/linux/StaticSitesClient@1.0.022431
Checksum match: a0424f02b72b0e292e23fa1774a579f3a83cc2280af46a19682c11423e55a134
Saved binary to /home/swa-cli/.swa/deploy/1.0.022431/StaticSitesClient
Saved metadata to /home/swa-cli/.swa/deploy/StaticSitesClient.json
Deploying using /home/swa-cli/.swa/deploy/1.0.022431/StaticSitesClient@1.0.022431
Deploying using the following options:
- env:
- SWA_CLI_DEBUG: silly
- SWA_RUNTIME_WORKFLOW_LOCATION:
- SWA_RUNTIME_CONFIG_LOCATION:
- SWA_RUNTIME_CONFIG: /staticwebapp.config.json
- SWA_CLI_VERSION: 1.0.6
- SWA_CLI_DEPLOY_DRY_RUN: false
- SWA_CLI_DEPLOY_BINARY: /home/swa-cli/.swa/deploy/1.0.022431/StaticSitesClient@1.0.022431
- DEPLOYMENT_ACTION: upload
- DEPLOYMENT_PROVIDER: SwaCli
- REPOSITORY_BASE:
- SKIP_APP_BUILD: true
- SKIP_API_BUILD: true
- DEPLOYMENT_TOKEN:
- APP_LOCATION: /public
- API_LOCATION:
- CONFIG_FILE_LOCATION:
- VERBOSE: true
- Preparing deployment. Please wait...
ℹ DeploymentId: 32e5ae21-65da-4799-b9de-35704456f028
ℹ Verbose logging enabled
ℹ Build timeout not specified, defaulting to 15 minutes
ℹ App Directory Location: '/public' was found.
ℹ config_file_location: config file '/staticwebapp.config.json' was found.
ℹ Looking for event info
ℹ Could not get event info. Proceeding
ℹ Skipping step to build /public with Oryx
ℹ Didn't find Oryx manifest file under location: /32e5ae21-65da-4799-b9de-35704456f028-swa-oryx/app-manifest/oryx-manifest.toml
ℹ Determined default file to be: index.html
ℹ Using 'staticwebapp.config.json' file for configuration information, 'routes.json' will be ignored.
✖ An unknown exception has occurred

ℹ 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/

```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.