static-web-apps-cli icon indicating copy to clipboard operation
static-web-apps-cli copied to clipboard

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

Open ju-ge opened this issue 1 year ago • 3 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.

ju-ge avatar Jun 12 '24 07:06 ju-ge

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

adrianhall avatar Jul 01 '24 17:07 adrianhall

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

  • Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.026911/linux/[email protected] [swa] ✔ Downloading https://swalocaldeploy.azureedge.net/downloads/1.0.026911/linux/[email protected]
  • Preparing deployment. Please wait... ✖ Error: spawn /root/.swa/deploy/1.0.026911/StaticSitesClient ENOENT`

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

ismailkocabiyik avatar Jul 02 '24 09:07 ismailkocabiyik

No workaround as yet - I'm still investigating.

adrianhall avatar Jul 02 '24 14:07 adrianhall

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?

gabrielpulga avatar Jul 09 '24 18:07 gabrielpulga

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.

ismailkocabiyik avatar Jul 10 '24 05:07 ismailkocabiyik

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.

adrianhall avatar Jul 10 '24 14:07 adrianhall

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 !

ju-ge avatar Jul 18 '24 10:07 ju-ge