Getting error ✖ Deployment Failure Reason: spawn ETXTBSY while deploying using github actions to azure static web app

NEERAJ SINGH RAJPUT 40 Reputation points
2025-01-29T09:18:20.39+00:00

Deploying project to Azure Static Web Apps...

32Could not find StaticSitesClient local binary

33- Downloading https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/linux/StaticSitesClient@53b7d0e07fe5c34bf68929fab92f87ce910288dc

34[swa] ✔ Downloading https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/linux/StaticSitesClient@53b7d0e07fe5c34bf68929fab92f87ce910288dc

35- Preparing deployment. Please wait...

36✖

37

38✖ Deployment Failed :(

39✖ Deployment Failure Reason: spawn ETXTBSY

40✖ For further information, please visit the Azure Static Web Apps documentation at https://docs.microsoft.com/azure/static-web-apps/

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,065 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bhargavi Naragani 410 Reputation points Microsoft Vendor
    2025-02-03T07:06:15.2733333+00:00

    Hi @NEERAJ SINGH RAJPUT,
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Solution:
    I updated the GitHub Actions workflow to use a single deployment method with a retry loop. This retry loop mitigates transient errors (like spawn ETXTBUSY) by attempting the deployment multiple times before failing.

    Below is the updated build and deploy step in the GitHub Actions workflow:

    ``-`` ``name:`` ``Build`` ``And`` ``Deploy`` ``run:`` ``| RETRIES=3 DELAY=10 for i in $(seq 1 $RETRIES); do echo "Attempt $i of $RETRIES..." sudo npx @azure/static-web-apps-cli deploy \ --app-location "/" \ --output-location "build" \ --deployment-token ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_TREE_0AC894A00 }} \ --api-language node \ --api-version 16 \ --env "production" && break if [ $i -lt $RETRIES ]; then echo "Retrying in $DELAY seconds..." sleep $DELAY else echo "Deployment failed after $RETRIES attempts." exit 1 fi done

    Explanation:

    Retry Loop: The script retries the deployment up to 3 times with a 10-second delay between attempts. This approach handles transient errors like spawn ETXTBUSY that may occur due to resource conflicts when multiple binaries are being created.

    Single Deployment Method: By consolidating the deployment into one method (using the Azure Static Web Apps CLI), we avoid conflicts from simultaneous deployments, thereby preventing the creation of dual binaries.

    Context on Azure VS Code Extensions: It’s important to note that Azure Static Web Apps cannot be deployed from the Azure VS Code extensions. This solution is intended specifically for those using GitHub Actions in their Azure CI/CD workflow.

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Sina Salam 17,016 Reputation points
    2025-01-30T13:41:50.5966667+00:00

    Hello NEERAJ SINGH RAJPUT,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are getting error ✖ Deployment Failure Reason: spawn ETXTBSY while deploying using GitHub actions to azure static web app.

    There are couple of things you might need to do as listed here:

    • Make sure you're using latest CLI Version: npm install -g @azure/static-web-apps-cli
    • Make sure that the StaticSitesClient binary is correctly downloaded and accessible. Verify the download URL and check if the binary is present in the expected location and if the binary is not found, manually download it from the provided URL and place it in the appropriate directory.
    • Make sure that the downloaded binary has the correct permissions to be executed. You can set the permissions using bash command: chmod +x /path/to/StaticSitesClient
    • Delete old deployment environments to avoid conflicts and to clean up previous deployments:
        az staticwebapp environment delete --name <app-name> --environment-name <environment-name> --yes
        
      
    • Retry the deployment after ensuring the binary is correctly downloaded and has the right permissions.
    • Check the detailed logs in your GitHub Actions workflow to identify any specific issues. You can find these logs under the "Actions" tab in your GitHub repository - https://learn.microsoft.com/en-us/azure/static-web-apps/troubleshooting
    • Utilize the diagnose and solve tool in the Azure portal to troubleshoot deployment issues. This tool can guide you through steps to resolve problems:
      • Go to your static web app in the Azure portal.
      • Select "Diagnose and solve problems" from the menu.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


  2. NEERAJ SINGH RAJPUT 40 Reputation points
    2025-02-03T06:49:04.56+00:00

    I updated the GitHub Actions workflow to use a single deployment method with a retry loop. This retry loop mitigates transient errors (like spawn ETXTBUSY) by attempting the deployment multiple times before failing.

    Below is the updated build and deploy step in the GitHub Actions workflow:

    ``-`` ``name:`` ``Build`` ``And`` ``Deploy`` ``run:`` ``| RETRIES=3 DELAY=10 for i in $(seq 1 $RETRIES); do echo "Attempt $i of $RETRIES..." sudo npx @azure/static-web-apps-cli deploy \ --app-location "/" \ --output-location "build" \ --deployment-token ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_LIVELY_TREE_0AC894A00 }} \ --api-language node \ --api-version 16 \ --env "production" && break if [ $i -lt $RETRIES ]; then echo "Retrying in $DELAY seconds..." sleep $DELAY else echo "Deployment failed after $RETRIES attempts." exit 1 fi done

    Explanation:

    Retry Loop: The script retries the deployment up to 3 times with a 10-second delay between attempts. This approach handles transient errors like spawn ETXTBUSY that may occur due to resource conflicts when multiple binaries are being created.

    Single Deployment Method: By consolidating the deployment into one method (using the Azure Static Web Apps CLI), we avoid conflicts from simultaneous deployments, thereby preventing the creation of dual binaries.

    Context on Azure VS Code Extensions: It’s important to note that Azure Static Web Apps cannot be deployed from the Azure VS Code extensions. This solution is intended specifically for those using GitHub Actions in their Azure CI/CD workflow.


    This solution has resolved our deployment issues in our workflow. I hope this helps anyone facing similar challenges with Azure Static Web Apps deployments using GitHub Actions!

    Cheers

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.