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

Deploy failing without any additional info #781

Open
OskarKlintrot opened this issue Nov 13, 2023 · 4 comments
Open

Deploy failing without any additional info #781

OskarKlintrot opened this issue Nov 13, 2023 · 4 comments

Comments

@OskarKlintrot
Copy link

Describe the bug
When I try to deploy static files to a SWA that have been deployed to before via Azure DevOps the CLI fails (silently unless I add --dry-run). I tried to detach the SWA but got the same result.

C:\repos\Arkitektur> swa deploy --env production --deployment-token $env:SWA_CLI_DEPLOYMENT_TOKEN --dry-run --verbose=silly

Welcome to Azure Static Web Apps CLI (1.1.6)

Getting config file options from "swa-cli.config.json"...
(node:18256) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Changed directory to C:\repos\Arkitektur
Using configuration "arkitektur" from file:
  C:\repos\Arkitektur\swa-cli.config.json

***********************************************************************
* WARNING: Running in dry run mode. This project will not be deployed *
***********************************************************************

Resolving outputLocation=Site full path...
Deploying front-end files from folder:
  C:\repos\Arkitektur\Site

Consider providing api-language and version using --api-language and --api-version flags,
    otherwise default values apiLanguage: node and apiVersion: 16 will apply
Deployment token provided via flag
 - --deployment-token: <hidden>

Deploying to environment: production

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

Deploying project to Azure Static Web Apps...
Fetching release metadata for version: stable. Please wait...
 - version: stable
 - buildId: 1.0.024941
 - publishDate: 2023-10-31T04:54:50.5527205Z
- files:
 - linux-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.024941/linux/StaticSitesClient
   - sha: bea23499732d615698baf4c9dcafe717fdd4ba8344f2d96740233b0380df79b6
 - win-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.024941/windows/StaticSitesClient.exe
   - sha: a93aa5ec2a17280f3c9c8252948f8c68050c8852770322758ffa3187b6bce1dd
 - osx-x64:
   - url: https://swalocaldeploy.azureedge.net/downloads/1.0.024941/macOS/StaticSitesClient
   - sha: 57ea66c930aafbf4dea82216e51128b3315ec2db3ab385d41e8d912a3adab2c0
Local client binary is up to date. Skipping download.
Deploying using C:\Users\oskkli\.swa\deploy\1.0.024941\StaticSitesClient.exe@1.0.024941
Deploying using the following options:
- env:
  - SWA_CLI_DEBUG: silly
  - SWA_RUNTIME_WORKFLOW_LOCATION: <undefined>
  - SWA_RUNTIME_CONFIG_LOCATION: C:\repos\Arkitektur\Site
  - SWA_RUNTIME_CONFIG: C:\repos\Arkitektur\Site\staticwebapp.config.json
  - SWA_CLI_VERSION: 1.1.6
  - SWA_CLI_DEPLOY_DRY_RUN: true
  - SWA_CLI_DEPLOY_BINARY: C:\Users\oskkli\.swa\deploy\1.0.024941\StaticSitesClient.exe@1.0.024941
  - DEPLOYMENT_ACTION: close
  - DEPLOYMENT_PROVIDER: SwaCli
  - REPOSITORY_BASE: C:\repos\Arkitektur\Site
  - SKIP_APP_BUILD: true
  - SKIP_API_BUILD: true
  - DEPLOYMENT_TOKEN: <hidden>
  - APP_LOCATION: C:\repos\Arkitektur\Site
  - API_LOCATION: <undefined>
  - DATA_API_LOCATION: <undefined>
  - CONFIG_FILE_LOCATION: C:\repos\Arkitektur\Site
  - VERBOSE: true
  - FUNCTION_LANGUAGE: node
  - FUNCTION_LANGUAGE_VERSION: 16
ℹ DeploymentId: 2e4e99b7-0432-43d5-b266-1ae631c67d1f
ℹ Verbose logging enabled
ℹ Looking for event info
ℹ Could not get event info. Proceeding
ℹ The content server has rejected the request with: BadRequest
ℹ Reason: Missing request content.
ℹ 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/

The only thing that I notice is that REPOSITORY_BASE is C:\repos\Arkitektur\Site when the repo is actually at C:\repos\Arkitektur.

swa-cli.config.json
{
  "$schema": "https://aka.ms/azure/static-web-apps-cli/schema",
  "configurations": {
    "arkitektur": {
      "appLocation": "Site",
      "outputLocation": "Site",
      "subscription": "<redacted>",
      "resourceGroup": "<redacted>",
      "appName": "<redacted>"
    }
  }
}

Desktop (please complete the following information):

  • OS: Windows
  • Version 10

Additional context
I didn't try to deploy manually before I already had deployed from Azure DevOps.

@cjk7989
Copy link
Contributor

cjk7989 commented Nov 14, 2023

Hi @OskarKlintrot, could your try removing --dry-run from the command?

@OskarKlintrot
Copy link
Author

Then the exact same thing seems to happen but the last log messages (from Looking for...) overwrite each other until it just disappeares just before it exits. It's impossible to manage to read them before they get replaced with the next message but the behavior seems to be the same.

@cjk7989
Copy link
Contributor

cjk7989 commented Dec 18, 2023

Hi @OskarKlintrot, sorry for the delay. There was a known bug about the deployment of swa in DevOps, which has been fixed in Nov. If this issue still happens, it will be helpful if you can share a demo repo for reproducing it, thanks.

@OskarKlintrot
Copy link
Author

I run into Azure/static-web-apps#1096 so I had to switch to using App Service instead, unfortunately.

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

2 participants