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

EACCES: permission denied when running in a container w/ non-default user #98

Open
FFdhorkin opened this issue Sep 9, 2023 · 0 comments

Comments

@FFdhorkin
Copy link

FFdhorkin commented Sep 9, 2023

Cypress docs recommend that if you want to run in a container, you use

container:
   image: cypress/browsers:latest
   options: --user 1001

in your job.

However, this results in a permissions error w/ the pnpm/action-setup github action:

Run pnpm/action-setup@v2
  with:
    version: 8
    dest: ~/setup-pnpm
    run_install: null
    package_json_file: package.json
/usr/local/bin/docker exec  6686201126ed5c34125a267c0082d372fd0e529f00478b06bffe9160dc7665b9 sh -c "cat /etc/*release | grep ^ID"
Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/save_state_c75dc5bb-ff9a-48d3-a0fe-ce5c45a0281e'
    at Object.openSync (node:fs:590:3)
    at Object.writeFileSync (node:fs:2202:35)
    at Object.appendFileSync (node:fs:2264:6)
    at Object.issueFileCommand (/__w/_actions/pnpm/action-setup/v2/dist/index.js:1:13826)
    at saveState (/__w/_actions/pnpm/action-setup/v2/dist/index.js:1:11983)
    at main (/__w/_actions/pnpm/action-setup/v2/dist/index.js:1:426)
    at Object.9450 (/__w/_actions/pnpm/action-setup/v2/dist/index.js:1:540)
    at __nccwpck_require__ (/__w/_actions/pnpm/action-setup/v2/dist/index.js:10:34263)
    at /__w/_actions/pnpm/action-setup/v2/dist/index.js:10:34448
    at Object.<anonymous> (/__w/_actions/pnpm/action-setup/v2/dist/index.js:10:34492) {
  errno: -13,
  syscall: 'open',
  code: 'EACCES',
  path: '/__w/_temp/_runner_file_commands/save_state_c75dc5bb-ff9a-48d3-a0fe-ce5c45a0281e'
}
Error: Error: EACCES: permission denied, open '/__w/_temp/_runner_file_commands/save_state_c75dc5bb-ff9a-48d3-a0fe-ce5c45a0281e'

Removing options: --user 1001 solves this, but goes against Cypress's advice regarding permissions.

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

1 participant