Azure/static-web-apps-cli

Can't deploy my static app to an staticwebapp with configuration Alpine 3.18 // npm 9.6.6-r0 // SWA 1.1.8

ju-ge opened this issue · 7 comments

Describe the bug
Hello.
I'd like to push a static application with swa.
I had no trouble doing this in my previous configuration (alpine 3.15, npm 8.1.3-r0, SWA 1.0.6) but for technical reasons I need to use a more up-to-date alpine image.

I've tried with older version of SWA on my Alpine 3.18 but it doesn't work.

To Reproduce
Steps to reproduce the behavior, I prepare my Alpine image :

  1. apk update
  2. apk add --update npm
  3. npm install -g @azure/static-web-apps-cli

My app test name is TerrariumAPI, my deploy command is :
swa deploy /terrariumAPI --api-location /terrariumAPI/api -w /terrariumAPI --verbose=silly --env=production --deployment-token <my_token>

Expected behavior
this is what I had in the configuration on alpine 3.15
image

Errors screenshots
image
image
it's a loop from there.
I've already checked, the file /root/.swa/deploy/1.0.026911/StaticSitesClient exists and is accessible by the user (root) who launches the "swa deploy" command.

Thanks in advance to anyone who can take a look at my problem.

Validates on Alpine 3.19 and swa-cli 1.1.10.

Interestingly:

/workspaces/alpine-tests/swa-vanilla-demo $ ls -la /home/vscode/.swa/deploy/1.0.026911/StaticSitesClient 
-rwxr-xr-x 1 vscode vscode 68620667 Jul  1 17:24 /home/vscode/.swa/deploy/1.0.026911/StaticSitesClient
/workspaces/alpine-tests/swa-vanilla-demo $ /home/vscode/.swa/deploy/1.0.026911/StaticSitesClient 
/bin/ash: /home/vscode/.swa/deploy/1.0.026911/StaticSitesClient: not found

Hi @adrianhall,

I have the same problem, I getting recently this error message:

`Deploying project to Azure Static Web Apps...
Could not find StaticSitesClient local binary

I use the image: "node:18.20-alpine". Before I had to use the node 16 image, it worked perfectly with that. Due to an update of Angular I have to switch to Node 18.20, since then this does not work. What can I do? Is there perhaps a workaround?

Thanks and Bests,
Ismail

No workaround as yet - I'm still investigating.

Getting the same issue using node:16-alpine, node:18-alpine and node:20-alpine

Is there any alpine based image we can use to deploy?

I think it is related to the Alpine Image?! I tried it with a Debian Image and it worked fine again, in this case with "node:20.15.0-bullseye". Maybe this is a temporary workaround until it works again with the Alpine Linux.

The problem is that Alpine uses MUSL, which means the binary can't locate some necessary shared libraries. Literally anything OTHER THAN alpine will work with the currently released version.

Hello.
A colleague (thanks to him) found a solution to my problem : install 'gcompat'

So step by step :

  • apk update
  • apk add --update npm
  • apk add gcompat
  • npm install -g @azure/static-web-apps-cli
  • swa deploy /terrariumAPI --api-location /terrariumAPI/api -w /terrariumAPI --verbose=silly --env=production --deployment-token <my_token>

image
image

Thanks for the investigations !