question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swa deploy fails with an unknown exception has occurred

See original GitHub issue

Describe the bug When running swa deploy to deploy a frontend app without an API, it fails with the error “An unknown exception has occurred”

To Reproduce

  1. Configure the following environment variables;
  • AZURE_REGION_LOCATION
  • AZURE_RESOURCE_GROUP
  • AZURE_SUBSCRIPTION_ID
  • SWA_CLI_APP_NAME
  • SWA_CLI_DEPLOYMENT_TOKEN
  1. Type in command ‘swa deploy’

Expected behaviour The app is deployed to the configured location.

Verbose Log


Welcome to Azure Static Web Apps CLI (1.0.2)

Getting config file options from swa-cli.config.json...
Config file does not exist at C:\Users\Joe\Development\external\dist\swa-cli.config.json
Deploying front-end files from folder:
  C:\Users\Joe\Development\external\dist

Deployment token found in Environment Variables:
 - SWA_CLI_DEPLOYMENT_TOKEN: <hidden>

Deploying to environment: preview

Trying to read workflow config with values:
 - appLocation: C:\Users\Joe\Development\external\dist
 - outputLocation: C:\Users\Joe\Development\external\dist
 - apiLocation: <undefined>
No workflow config folder found at C:\Users\Joe\Development\external\dist\.github\workflows
Validating user workflow config (BEFORE):
 - appLocation: C:\Users\Joe\Development\external\dist
 - outputLocation: C:\Users\Joe\Development\external\dist
 - apiLocation: <undefined>
Validating user workflow config (AFTER):
 - appLocation: C:\Users\Joe\Development\external\dist
 - apiLocation: <undefined>
 - outputLocation: C:\Users\Joe\Development\external\dist
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:
  C:\Users\Joe\Development\external\dist\staticwebapp.config.json

Deploying project to Azure Static Web Apps...
Fetching release metadata for version: stable. Please wait...
 - version: stable
 - buildId: 1.0.019361
 - publishDate: 2022-04-20T15:35:50.4947355Z
- files:
 - linux-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.019361/linux/StaticSitesClient
   - sha: 24baa1cedd45b7b029f3ee502265de940383fab940e0bed75842cbf7f9030080
 - win-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.019361/windows/StaticSitesClient.exe
   - sha: 66c529754df158761523aeffcc5f278d14205f6b51afec913ba113edc3caa681
 - osx-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.019361/macOS/StaticSitesClient
   - sha: ec26ca4e7a12f46cee93b5d0b2128f79f18a3ff9875d7276a837ca94c16be854
Local client binary is up to date. Skipping download.
Deploying using C:\Users\Joe\.swa\deploy\1.0.019361\StaticSitesClient.exe@1.0.019361
Deploying using the following options:
- env:
  - SWA_CLI_DEBUG: silly
  - SWA_RUNTIME_WORKFLOW_LOCATION: <undefined>
  - SWA_RUNTIME_CONFIG_LOCATION: C:\Users\Joe\Development\external\dist
  - SWA_RUNTIME_CONFIG: C:\Users\Joe\Development\external\dist\staticwebapp.config.json
  - SWA_CLI_VERSION: 1.0.2
  - SWA_CLI_DEPLOY_DRY_RUN: false
  - SWA_CLI_DEPLOY_BINARY: C:\Users\Joe\.swa\deploy\1.0.019361\StaticSitesClient.exe@1.0.019361
  - DEPLOYMENT_ACTION: upload
  - DEPLOYMENT_PROVIDER: swa-cli-1.0.2
  - REPOSITORY_BASE: C:\Users\Joe\Development\external\dist
  - SKIP_APP_BUILD: true
  - SKIP_API_BUILD: true
  - DEPLOYMENT_TOKEN: <hidden>
  - APP_LOCATION: C:\Users\Joe\Development\external\dist
  - API_LOCATION: <undefined>
  - CONFIG_FILE_LOCATION: C:\Users\Joe\Development\external\dist
  - VERBOSE: true
  - DEPLOYMENT_ENVIRONMENT: preview
ℹ DeploymentId: da6fb4cc-1baf-4ba2-b72c-698a2a43d1b3
ℹ
ℹ Verbose logging enabled
ℹ Build timeout not specified, defaulting to 15 minutes
ℹ App Directory Location: 'C:\Users\Joe\Development\external\dist' was found.
ℹ No Api directory specified. Azure Functions will not be created.
ℹ config_file_location: config file 'C:\Users\Joe\Development\external\dist\staticwebapp.config.json' was found.
ℹ Looking for event info
ℹ Event info parsed from action options.
ℹ Could not get repository branch. Proceeding
ℹ Could not get repository url. Proceeding
ℹ Skipping step to build C:\Users\Joe\Development\external\dist with Oryx
ℹ Didn't find Oryx manifest file under location: C:\Users\Joe\Development\external\dist\ss-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.
ℹ Either no Api directory was specified, or the specified directory was not found. Azure Functions will not be created.
ℹ Zipping App Artifacts
ℹ App Zip will be created from directory: C:\Users\Joe\Development\external\dist
✖ 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/

Desktop (please complete the following information):

  • OS: Windows
  • Version 11

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Reshmi-Sriramcommented, Jul 1, 2022

Got it! Thanks for clarifying, we will investigate this further! Meanwhile could you please confirm if swa deploy ./dist (Option 2 in the doc) does not work either??

Also, much appreciated if you could share your project (without sensitive content) so that we could try reproducing it on our ends. Sorry for the experience!

0reactions
Reshmi-Sriramcommented, Jul 5, 2022

Thanks for the confirmation! Looks like there is a bug, related to #514 Closing this issue and continuing the bug fix in the other issue. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swa deploy fails with an unknown exception has occurred #500
Describe the bug Running swa deploy always fails with: Welcome to Azure Static Web Apps CLI (1.0.1) Deploying front-end files from folder: ...
Read more >
Troubleshooting | Static Web Apps CLI - Azure documentation
When a user tries to swa deploy from within the app-location , the deploy command currently fails with an unknown error. This is...
Read more >
Troubleshooting Azure Static Web Apps - Microsoft Learn
This article features step-by-step guides to troubleshooting deployment and other issues for your static web app. Retrieve deployment error ...
Read more >
WebLogic Server Known and Resolved Issues
Change Request Number Found In Fixed In CR200627 9.0 CR208373 9.0 9.2 CR214481 9.0 9.2
Read more >
Troubleshoot instances with failed status checks
If an instance status check fails, you can reboot the instance and retrieve the system logs. The logs may reveal an error that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found