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

Suddenly getting 'Deployment Failure Reason: spawn ETXTBSY' on Github Actions #916

Open
1 of 2 tasks
dvasdekis opened this issue Jan 23, 2025 · 6 comments
Open
1 of 2 tasks

Comments

@dvasdekis
Copy link

dvasdekis commented Jan 23, 2025

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
Intermittently during deployment on Github Actions, we get an error out with the output "Deployment Failure Reason: spawn ETXTBSY"

To Reproduce
Our script is:

npm install -g @azure/static-web-apps-cli
az login
npm ci
npm run build
$swakey = az staticwebapp secrets list --name "$webAppName" --query "properties.apiKey" --output tsv
swa deploy --subscription-id $subscriptionId --resource-group $resourceGroup --app-name "$webAppName" --app-location "./out" --deployment-token $swakey --env production --api-language "node" --api-version "20" --verbose "silly"

Script has been working fine for months.

Expected behavior
Deploys app

Screenshots
Output from swa deploy below:

Welcome to Azure Static Web Apps CLI (2.0.2)
Getting config file options from "swa-cli.config.json"...
Config file does not exist at "swa-cli.config.json"
Resolving outputLocation=. full path...
Deploying front-end files from folder:
  /home/runner/work/platform/platform/platform/staticwebapp/ui/out
Deployment token provided via flag
 - --deployment-token: <hidden>
Deploying to environment: production
Trying to read workflow config with values:
 - appLocation: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
 - outputLocation: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
 - apiLocation: <undefined>
 - dataApiLocation: <undefined>
No workflow config folder found at /home/runner/work/platform/platform/platform/staticwebapp/ui/out/.github/workflows
Validating user workflow config (BEFORE):
 - appLocation: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
 - outputLocation: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
 - apiLocation: <undefined>
 - dataApiLocation: <undefined>
Validating user workflow config (AFTER):
 - appLocation: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
 - apiLocation: <undefined>
 - outputLocation: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
 - dataApiLocation: <undefined>
No staticwebapp.config.json found in current project
Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary
Fetching release metadata for version: stable. Please wait...
GET https://aka.ms/swalocaldeploy
Decode JSON: [
  {
    "version": "latest",
    "buildId": "53b7d0e07fe5c34bf68929fab92f87ce910[288](https://github.com/[REDACTED]/platform/actions/runs/12920432105/job/36035810699?pr=3214#step:9:289)dc",
    "publishDate": "2024-10-24T20:43:23.5850191Z",
    "files": {
      "linux-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/linux/StaticSitesClient",
        "sha": "66fca4b42cbc64d451097931ca4ed75649233bd818f97f0c3f6d1d75cff61413"
      },
      "win-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/windows/StaticSitesClient.exe",
        "sha": "fc949fb19d29cce1e8b74cf1e2c31706426d46b3e03d830d601524cee63faa0b"
      },
      "osx-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/macOS/StaticSitesClient",
        "sha": "89ec4fe61217325e89ed849a564ffe4cc51b61c325abdca82e8e441a4959ec92"
      }
    }
  },
  {
    "version": "stable",
    "buildId": "53b7d0e07fe5c34bf68929fab92f87ce910288dc",
    "publishDate": "2024-10-24T20:43:23.5850191Z",
    "files": {
      "linux-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/linux/StaticSitesClient",
        "sha": "66fca4b42cbc64d451097931ca4ed75649233bd818f97f0c3f6d1d75cff61413"
      },
      "win-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/windows/StaticSitesClient.exe",
        "sha": "fc949fb19d29cce1e8b74cf1e2c31706426d46b3e03d830d601524cee63faa0b"
      },
      "osx-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/macOS/StaticSitesClient",
        "sha": "89ec4fe61217325e89ed849a564ffe4cc51b61c325abdca82e8e441a4959ec92"
      }
    }
  },
  {
    "version": "backup",
    "buildId": "c25b033e400580829b0fea1fc7fb566139ab61c0",
    "publishDate": "2024-10-16T22:53:44.2035066Z",
    "files": {
      "linux-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/c25b033e400580829b0fea1fc7fb566139ab61c0/linux/StaticSitesClient",
        "sha": "25a33db34c0647e1225755fb65a441c3ccfe523523f54a38f85c3ff6531aa475"
      },
      "win-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/c25b033e400580829b0fea1fc7fb566139ab61c0/windows/StaticSitesClient.exe",
        "sha": "40e9339b57c2df7fafdddb73cee5f5ed10ad03841bd25796b3ea81b793b4bf66"
      },
      "osx-x64": {
        "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/c25b033e400580829b0fea1fc7fb566139ab61c0/macOS/StaticSitesClient",
        "sha": "aac8b80f43a40714f1d38a0c8c23752aaec5fc4cb32e05cd2c38ff9ef0a60f32"
      }
    }
  }
]
Release Metadata for stable: {
  "version": "stable",
  "buildId": "53b7d0e07fe5c34bf68929fab92f87ce910288dc",
  "publishDate": "2024-10-24T20:43:23.5850191Z",
  "files": {
    "linux-x64": {
      "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/linux/StaticSitesClient",
      "sha": "66fca4b42cbc64d451097931ca4ed75649233bd818f97f0c3f6d1d75cff61413"
    },
    "win-x64": {
      "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/windows/StaticSitesClient.exe",
      "sha": "fc949fb19d29cce1e8b74cf1e2c[317](https://github.com/[REDACTED]/platform/actions/runs/12920432105/job/36035810699?pr=3214#step:9:318)06426d46b3e03d830d601524cee63faa0b"
    },
    "osx-x64": {
      "url": "https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/macOS/StaticSitesClient",
      "sha": "89ec4fe61217[325](https://github.com/[REDACTED]/platform/actions/runs/12920432105/job/36035810699?pr=3214#step:9:326)e89ed849a564ffe4cc51b61c325abdca82e8e441a4959ec92"
    }
  }
}
- Downloading https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/linux/StaticSitesClient@53b7d0e07fe5c34bf68929fab92f87ce910288dc
[swa] ✔ Downloading https://swalocaldeployv2-bndtgugjgqc3dhdx.b01.azurefd.net/downloads/53b7d0e07fe5c34bf68929fab92f87ce910288dc/linux/StaticSitesClient@53b7d0e07fe5c34bf68929fab92f87ce910288dc
Checksum match: 66fca4b42cbc64d451097931ca4ed75649233bd818f97f0c3f6d1d75cff61413
Saved binary to /home/runner/.swa/deploy/53b7d0e07fe5c34bf68929fab92f87ce910288dc/StaticSitesClient
Saved metadata to /home/runner/.swa/deploy/StaticSitesClient.json
Deploying using /home/runner/.swa/deploy/53b7d0e07fe5c34bf68929fab92f87ce910288dc/StaticSitesClient@53b7d0e07fe5c34bf68929fab92f87ce910288dc
Deploying using the following options:
- env:
  - SWA_CLI_DEBUG: silly
  - SWA_RUNTIME_WORKFLOW_LOCATION: <undefined>
  - SWA_RUNTIME_CONFIG_LOCATION: <undefined>
  - SWA_RUNTIME_CONFIG: <undefined>
  - SWA_CLI_VERSION: 2.0.2
  - SWA_CLI_DEPLOY_DRY_RUN: false
  - SWA_CLI_DEPLOY_BINARY: /home/runner/.swa/deploy/53b7d0e07fe5c34bf68929fab92f87ce910288dc/StaticSitesClient@53b7d0e07fe5c34bf68929fab92f87ce910288dc
  - DEPLOYMENT_ACTION: upload
  - DEPLOYMENT_PROVIDER: SwaCli
  - REPOSITORY_BASE: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
  - SKIP_APP_BUILD: true
  - SKIP_API_BUILD: true
  - DEPLOYMENT_TOKEN: <hidden>
  - APP_LOCATION: /home/runner/work/platform/platform/platform/staticwebapp/ui/out
  - API_LOCATION: <undefined>
  - DATA_API_LOCATION: <undefined>
  - CONFIG_FILE_LOCATION: <undefined>
  - VERBOSE: true
  - FUNCTION_LANGUAGE: node
  - FUNCTION_LANGUAGE_VERSION: 20
- 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/

Desktop (please complete the following information):

Additional context
Not sure what else to add! Let me know if there's anything I can help with.

@mohamedfarees
Copy link

We are facing same issue from Today

@Timothyw0
Copy link
Member

This seemed to be a transient issue in the Github runner linux image. Even our e2e tests were failing using node 20 in our Github action runner but it seems to be passing now.

Could you both please try re-running and seeing if the issue still exists?

@dvasdekis
Copy link
Author

dvasdekis commented Jan 27, 2025

It was transient for us too, but switching to npm install --no-bin-links -g @azure/static-web-apps-cli seemed to fix the issue.
Let's close it for now, but apparently adding the above line is recommended for CI pipelines.

Edit: No it did not fix it for us, ignore this. Instead we got:

npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm error code 1
npm error path /usr/local/lib/node_modules/@azure/static-web-apps-cli/node_modules/keytar
npm error command failed
npm error command sh -c prebuild-install || npm run build
npm error > [email protected] build
npm error > node-gyp rebuild
npm error sh: 1: prebuild-install: not found
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | linux | x64
npm error gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
npm error gyp http GET https://nodejs.org/download/release/v20.18.1/node-v20.18.1-headers.tar.gz
npm error gyp http 200 https://nodejs.org/download/release/v20.18.1/node-v20.18.1-headers.tar.gz
npm error gyp http GET https://nodejs.org/download/release/v20.18.1/SHASUMS256.txt
npm error gyp http 200 https://nodejs.org/download/release/v20.18.1/SHASUMS256.txt
npm error gyp info spawn /usr/bin/python3
npm error gyp info spawn args [
npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm error gyp info spawn args 'binding.gyp',
npm error gyp info spawn args '-f',
npm error gyp info spawn args 'make',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/local/lib/node_modules/@azure/static-web-apps-cli/node_modules/keytar/build/config.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm error gyp info spawn args '-I',
npm error gyp info spawn args '/home/runner/.cache/node-gyp/20.18.1/include/node/common.gypi',
npm error gyp info spawn args '-Dlibrary=shared_library',
npm error gyp info spawn args '-Dvisibility=default',
npm error gyp info spawn args '-Dnode_root_dir=/home/runner/.cache/node-gyp/20.18.1',
npm error gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
npm error gyp info spawn args '-Dnode_lib_file=/home/runner/.cache/node-gyp/20.18.1/<(target_arch)/node.lib',
npm error gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/@azure/static-web-apps-cli/node_modules/keytar',
npm error gyp info spawn args '-Dnode_engine=v8',
npm error gyp info spawn args '--depth=.',
npm error gyp info spawn args '--no-parallel',
npm error gyp info spawn args '--generator-output',
npm error gyp info spawn args 'build',
npm error gyp info spawn args '-Goutput_dir=.'
npm error gyp info spawn args ]
npm error Package libsecret-1 was not found in the pkg-config search path.
npm error Perhaps you should add the directory containing `libsecret-1.pc'
npm error to the PKG_CONFIG_PATH environment variable
npm error Package 'libsecret-1', required by 'virtual:world', not found
npm error gyp: Call to 'pkg-config --cflags libsecret-1' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm error gyp ERR! configure error 
npm error gyp ERR! stack Error: `gyp` failed with exit code: 1
npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:297:18)
npm error gyp ERR! stack at ChildProcess.emit (node:events:518:28)
npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm error gyp ERR! System Linux 6.8.0-1020-azure
npm error gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm error gyp ERR! cwd /usr/local/lib/node_modules/@azure/static-web-apps-cli/node_modules/keytar
npm error gyp ERR! node -v v20.18.1
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2025-01-27T23_23_01_6[91](https://github.com/our-repo/actions/runs/13000230471/job/36257291488?pr=3219#step:9:92)Z-debug-0.log

@dvasdekis dvasdekis reopened this Jan 28, 2025
@Timothyw0
Copy link
Member

@dvasdekis It looks like the Ubuntu 24.04 image does not contain the libsecret package pre-installed. Can you please try either using an earlier image of Ubuntu or adding a line in the script to apt-get libsecret-1-dev?

https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md

@Timothyw0
Copy link
Member

Hi @dvasdekis did you get a chance to test if my previous message resolves the npm error you were seeing?

@virzak
Copy link

virzak commented Feb 6, 2025

I'm getting the same: does anyone know if how I can modify yarn dlx @azure/static-web-apps-cli deploy packages?

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

4 participants