Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
318 stars 53 forks source link

Deployment using pipeline script (sometimes) fails #1467

Closed negreamihneavlad closed 3 weeks ago

negreamihneavlad commented 1 month ago

The deployment script (.yml file) encounters a failure at the "AzureStaticWebApp@0" step, displaying the following message:

docker: error parsing HTTP 429 response body: invalid character 'R' looking for beginning of value: "Ref A: D77096961A1D40AA89AD0A17A9D88F37 Ref B: DM2EDGE0811 Ref C: 2024-05-08T12:09:41Z".

##[debug]Exit code 125 received from tool '/usr/bin/bash'
##[debug]STDIO streams have closed for tool '/usr/bin/bash'
##[debug]task result: Failed
##[error]Error: The process '/usr/bin/bash' failed with exit code 125

Additional information:

In Azure DevOps, approximately 20 deployment pipelines are triggered, but they start executing in pair being processed by two agents concurrently. I tried changing this to only one, executing them sequentially, without success.

The error mentioned above occurs randomly and affects various pipelines at different times. However, there hasn't been a complete deployment (involving all 20 pipelines) without encountering this issue at least once.

This issue started occurring recently without any recent changes being made.

Deployment script:

pool:
  vmImage: ubuntu-latest

stages:
- stage: Deploy

  jobs:
  - job: deploy
    displayName: Deploy App

    steps:
      - download: none
      - task: DownloadPipelineArtifact@2
        inputs:
         ...... (irrelevant)

      - task: Bash@3
        ......(irrelevant)

      - task: FileTransform@1
        displayName: 'File transformation: appConfig.json and staticwebapp.config.json'
        inputs:
          folderPath: 'build'
          fileType: 'json'
          targetFiles: |
            **/appConfig.json
            **/staticwebapp.config.json

      - task: AzureStaticWebApp@0
        inputs:
          app_location: 'build'
          output_location: ''
          skip_app_build: true
          azure_static_web_apps_api_token: '$(deployment_token)'

Static web app config json:

{
  "routes": [],
  "navigationFallback": {
    "rewrite": "/index.html"
  },
  "globalHeaders": {
    "Access-Control-Allow-Origin": "*"
  }
}
mikereman commented 1 month ago

I work with a very similar setup and experience the same issue. Usually 2-3 pipelines fail randomly and it takes several retries for it to succeed.

rrussell0 commented 1 month ago

Can confirm this is happening to us as well. We're using the Azure CLI step to do docker build/deploy and it seems to just randomly happen, though we are not deploying a static web app.