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

'EACCES: permission denied' when trying to deploy via docker and 'swa deploy'

Open cosmadora opened this issue 3 years ago • 1 comments

Describe the bug I am trying to deploy my (pre-built) static website via swaCLI tool using woodpecker-CI and the swacli/static-web-apps-cli:latest docker image. However, on execution I get an EACCES error:

✖ Deployment Failed :(
✖ Deployment Failure Reason: EACCES: permission denied, mkdir '/root/.swa/deploy/1.0.020981'

To Reproduce execute the following within the CI environment using the above mentioned docker container:

swa deploy ./public --verbose=silly

Expected behavior Either there should be a way to manually set the (temp) folder that is causing the permission error, or the docker image should be altered to allow writing to the folder.

Screenshots image

Additional context The pipeline that is being run can be found at https://codeberg.org/lauralani/www-lauka-net/src/commit/fbd65ab17caa51b0b9f129505cf335edca6bb947/.woodpecker.yml , and the full output of the pipeline run that's failing - including the debug output of swa deploy --verbose=silly can be found at https://ci.codeberg.org/lauralani/www-lauka-net/pipeline/4/4

cosmadora avatar Nov 10 '22 19:11 cosmadora

I had the same issue with an azure pipeline and the AzureStaticWebApp@0 task. It boiled down to having the CLI installed as a devdependecy and the pipeline agent not having the correct permissions to install it on the host.

Removing the "@azure/static-web-apps-cli": "^1.0.6" entry in "devDependencies" fixed the issue.

I suggest adding a warning to (or remove) this part of the documentation

image

until the issue is fixed

noontz avatar Jan 25 '23 14:01 noontz