EACCES: permission denied - How to solve?

Hi there,

Issue at https://github.com/jpvalery/yarn-percy-ci/issues/3

Running into an issue trying to build an action that basically does yarn install && yarn build && yarn percy snapshot.
This works perfectly well if I get the command in the workflow .yml file, but trying to get it as a all-in-one docker action, i’m running into a permission issue. 

2019-10-09T17:52:44.6376949Z error Could not write file "/github/workspace/yarn-error.log": "EACCES: permission denied, open '/github/workspace/yarn-error.log'"
2019-10-09T17:52:44.6377340Z info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
2019-10-09T17:52:44.6377957Z error An unexpected error occurred: "EACCES: permission denied, mkdir '/github/workspace/node_modules'".

GH Support reply was

I would check to see what user id you are running as inside the container. It is likely that user does not have permissions to write to the filesystem. By default we expect all containers to run as UI 0 inside the container. If you are running as something else you will need to make sure you chown the files.

In this particluar case it looks like you are trying to use a container that CircleCI has optimized to work in their infrastructure.

I’m using the CircleCI container based on Percy support suggestion to fix an issue with puppeteer and browsers.

I’m a bit lost as to how I could check which user id i’m running at in this container and how I could switch to another. 

Any help here or on the issue in the repo would be greatly appreciated :slight_smile:



added this in my entrypoint.sh

sh -c "sudo chown -R circleci /github"
sh -c "sudo chmod -R 777 /github"

This will work for circleci images. For other images, check the user and adapt the command if needed

1 Like