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

Flaky CLI deployment #799

Open
rhuanbarreto opened this issue Feb 5, 2024 · 3 comments
Open

Flaky CLI deployment #799

rhuanbarreto opened this issue Feb 5, 2024 · 3 comments

Comments

@rhuanbarreto
Copy link

Describe the bug

I'm using the CLI to manually deploy the websites in CI. But the process is flaky. It throws an error (spawn ETXTBSY) which means in some sources that the file descriptor is being accessed from two different processes, therefore throwing an error. Rerunning it sometimes solves the problem. But this is very flaky.

Console output:

Welcome to Azure Static Web Apps CLI (1.1.6)

Using configuration "app" from file:
  swa-cli.config.json

Deploying front-end files from folder:
/home/runner/work/typescript/typescript/packages/xxxxx/dist
Deploying to environment: pr19

Found configuration file:
  /home/runner/work/typescript/typescript/packages/xxxxx/staticwebapp.config.json

Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary
- Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.025241/linux/[email protected]
[swa] ✔ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.025241/linux/[email protected]
- Preparing deployment. Please wait...
✖ 
✖ Deployment Failed :(
✖ Deployment Failure Reason: spawn ETXTBSY
✖ 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

To Reproduce
Steps to reproduce the behavior:

Run swa deploy --no-use-keychain --app-location "." --config-name "app" --output-location "dist" --env pr19 in Github Actions

Expected behavior

To work every time the command is run

@GregWoods
Copy link

GregWoods commented Apr 11, 2024

Same/Similar problem here. I am using the CLI inside a docker container from the image: swacli/static-web-apps-cli:latest

Running inside the container running locally is fine.
Running from the same image inside a Bitbucket pipeline fails every time.

+ swa deploy --deployment-token $SWA_CLI_DEPLOYMENT_TOKEN --app-location . --output-location build --env production
Welcome to Azure Static Web Apps CLI (1.1.7)
Deploying front-end files from folder:
  /opt/atlassian/pipelines/agent/build/build
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: production
Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary
- Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.026361/linux/[email protected]
[swa] ✔ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.026361/linux/[email protected]
- Preparing deployment. Please wait...
✖ 
✖ Deployment Failed :(
✖ Deployment Failure Reason: spawn ETXTBSY
✖ 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

@GregWoods
Copy link

I found the reason for my own problem...
In Azure Portal -> Static Web App Instance -> Environments, there was a Preview Environment which was stuck in the "uploading" state from a previous deployment attempt. I deleted this and the ETXTBSY error went away.

Next, I started getting a Bad Request error, but this was caused by the Deployment Token being removed. I presume it was deleted when I removed the Preview Environment. I certainly didn't delete the Token myself.

Once I recreated the Token and updated my BitBucket pipeline variable with the new value, it all started working.

@emt2dev
Copy link

emt2dev commented Apr 15, 2024

https://stackoverflow.com/questions/78328458/swacli-does-not-produce-error-and-does-not-deploy

I have an issue similiar to this. the script just stops running with no error output.

image

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

3 participants