static-web-apps-cli: Deployment Failure Reason: spawn EBUSY

Before filing this issue, please ensure you’re using the latest CLI by running swa --version and comparing to the latest version on npm.

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
  • 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 Sometimes the deployment via swa deploy fails on CI.

##[debug]Evaluating: secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_PEBBLE_0224C3803
##[debug]Evaluating Index:
##[debug]..Evaluating secrets:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'AZURE_STATIC_WEB_APPS_API_TOKEN_MANGO_PEBBLE_0224C3803'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating condition for step: 'Deploy Web App'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Deploy Web App
##[debug]Loading inputs
##[debug]Evaluating: format('# Delete old deployment (otherwise we get a spawn EBUSY error when running the workflow again)
##[debug]az staticwebapp environment delete --name jabref-online --environment-name {0} --yes || true
##[debug]
##[debug]yarn swa deploy .output\public --env {1}
##[debug]', matrix.deployment_environment, matrix.deployment_environment)
##[debug]Evaluating format:
##[debug]..Evaluating String:
##[debug]..=> '# Delete old deployment (otherwise we get a spawn EBUSY error when running the workflow again)
##[debug]az staticwebapp environment delete --name jabref-online --environment-name {0} --yes || true
##[debug]
##[debug]yarn swa deploy .output\public --env {1}
##[debug]'
##[debug]..Evaluating Index:
##[debug]....Evaluating matrix:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'deployment_environment'
##[debug]..=> 'default'
##[debug]..Evaluating Index:
##[debug]....Evaluating matrix:
##[debug]....=> Object
##[debug]....Evaluating String:
##[debug]....=> 'deployment_environment'
##[debug]..=> 'default'
##[debug]=> '# Delete old deployment (otherwise we get a spawn EBUSY error when running the workflow again)
##[debug]az staticwebapp environment delete --name jabref-online --environment-name default --yes || true
##[debug]
##[debug]yarn swa deploy .output\public --env default
##[debug]'
##[debug]Result: '# Delete old deployment (otherwise we get a spawn EBUSY error when running the workflow again)
##[debug]az staticwebapp environment delete --name jabref-online --environment-name default --yes || true
##[debug]
##[debug]yarn swa deploy .output\public --env default
##[debug]'
##[debug]Loading env
Run # Delete old deployment (otherwise we get a spawn EBUSY error when running the workflow again)
##[debug]C:\Program Files\PowerShell\7\pwsh.EXE -command ". 'D:\a\_temp\962b834b-afe0-484e-8e84-9c35b7e02f5a.ps1'"
ERROR: Operation returned an invalid status 'Bad Request'

Welcome to Azure Static Web Apps CLI (1.1.2)

Deploying front-end files from folder:
  D:\a\JabRefOnline\JabRefOnline\.output\public

Consider providing api-language and version using --api-language and --api-version flags,
    otherwise default values apiLanguage: node and apiVersion: 16 will apply

Deploying to environment: default


Found configuration file:
  D:\a\JabRefOnline\JabRefOnline\staticwebapp.config.json

Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary
- Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.023421/windows/StaticSitesClient.exe@1.0.023421
[swa] ✔ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.023421/windows/StaticSitesClient.exe@1.0.023421
- Preparing deployment. Please wait...

✖ 
✖ Deployment Failed :(
✖ Deployment Failure Reason: spawn EBUSY
✖ For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/azure/static-web-apps/
✖ If you believe this behavior is unexpected, please raise a GitHub issue at:
  https://github.com/Azure/static-web-apps-cli/issues/new/choose
Error: Process completed with exit code 1.
##[debug]Finishing: Deploy Web App

e.g. https://github.com/JabRef/JabRefOnline/actions/runs/5480147768/jobs/9989069413

To Reproduce Steps to reproduce the behavior:

  1. Run swa deploy in CI.

Expected behavior Deployment is successful.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Github CI, Windows Server 2022
  • Version [e.g. 22]

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 9
  • Comments: 28 (3 by maintainers)

Most upvoted comments

This has got dramatically worse. I am now running my 5th straight attempt to release some code to two static web apps, after 4 failures on each one due to this issue. It is now effectively not possible for me to do emergency releases. This needs to be fixed immediately.

Any updates on this issue? This is becoming really annoying.

+1. We also noticed this problem, and re-run the job can help. We will investigate it.

We’re also seeing occasional failures due to ETXTBUSY. Not sure if it’s the same bug as the one that returns EBUSY but it’s definitely a bug.

We’re using ubuntu-24.04 which is the same image as ubuntu-latest (for now).

As a workaround, you can add automatic retries using https://github.com/marketplace/actions/retry-step

I have switched to ubuntu-latest and the issue has completely cleared for me so far (only a few deploys so far). It is now possible for me to release at least! Thanks for suggestion

A year since this… still with the same issue… unbelievable

FWIW, we are seeing this issue more often than not when attempting to deploy.

If it helps, we are using a “swa deploy” AZ CLI command on a windows-latest Microsoft-hosted agent. The agents appear to be running AZ CLI version 2.52.0 and SWA CLI version 1.1.4.

So anyone got a solution / workaround aside from CallAzureThingyInLoopBecauseOfRandomFailures()?

+1. Observed this issue in our deployment pipeline today (azure devops)

+1. also run into this issue pretty often. the only clue I have found, is that for some reason the error seems less prevalent when I tell everyone to close the app. Given that our swa runs on a windows license makes me suspect that it could be windows file locking. But I would like to say this is mostly just a guess