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

Cypress in docker fails to run with read-only project dir #686

Open
varac opened this issue Jun 24, 2022 · 10 comments
Open

Cypress in docker fails to run with read-only project dir #686

varac opened this issue Jun 24, 2022 · 10 comments

Comments

@varac
Copy link

varac commented Jun 24, 2022

Current behavior

Currently, when using the cypress/included docker image and mounting a project dir read-only, cypress fails to run.

Desired behavior

It should not fail and run the tests. It could issue a warning that it is not able to save screenshots or videos.

Test code to reproduce

❯ docker run --rm -it -v $PWD:/e2e:ro -w /e2e cypress/included:10.2.0
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[213:0624/072239.698161:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[213:0624/072239.700359:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
EROFS: read-only file system, access '/e2e'
Error: EROFS: read-only file system, access '/e2e'

Cypress Version

10.2.0

Other

These issues/PRs might be related, however I was not able to determine if this behaviour should be already fixed or not:

@varac
Copy link
Author

varac commented Jun 24, 2022

Interestingly, this seems to only happen in docker. Running is locally (installed with npm) leads to the desired result:

❯ touch /tmp/cytest/de
touch: cannot touch '/tmp/cytest/de': Permission denied

❯ ./node_modules/.bin/cypress run -P /tmp/cytest 
This folder is not writable: /tmp/cytest

Writing to this directory is required by Cypress in order to store screenshots and videos.

Enable write permissions to this directory to ensure screenshots and videos are stored.

If you don't require screenshots or videos to be stored you can safely ignore this warning.
Warning: We failed to trash the existing run results.

This error will not alter the exit code.

Error: EACCES: permission denied, unlink '/tmp/cytest/cypress/videos/test-nextcloud.cy.js.mp4'



====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        10.2.0                                                                         │
  │ Browser:        Electron 100 (headless)                                                        │
  │ Node Version:   v16.15.1 (/snap/node/6378/bin/node)                                            │
  │ Specs:          1 found (test-nextcloud.cy.js)                                                 │
  │ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  test-nextcloud.cy.js                                                            (1 of 1)
...

@varac
Copy link
Author

varac commented Jun 24, 2022

The use-case is that I want to run cypress in kubernetes, and the project dir is mounted from a readonly configmap.

@mjhenkes mjhenkes transferred this issue from cypress-io/cypress Jun 24, 2022
@hai-le-niteco
Copy link

I'm encountering this too. Desperately looking for a fix

@Tigatok
Copy link

Tigatok commented Aug 15, 2022

Encountering this in a gitlab pipeline, also see the error is related here as well: cypress-io/cypress#23326

@SvartAlfe
Copy link

SvartAlfe commented Sep 2, 2022

Similar errors displayed here, with Kubernetes. Surprisingly, the tests are working fine.
And I managed to remove the ALSA errors, but not yet the "libva error".
But I wish Cypress would not display "This folder is not writable" in quiet mode...

[14887:0901/193637.064164:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 15064: Permission denied (13)
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[15064:0901/193637.106703:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[15064:0901/193637.112561:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
This folder is not writable: /usr/src/app

Writing to this directory is required by Cypress in order to store screenshots and videos.

Enable write permissions to this directory to ensure screenshots and videos are stored.

If you don't require screenshots or videos to be stored you can safely ignore this warning.
[14887:0901/193640.509047:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 15243: Permission denied (13)
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default
[15394:0901/193650.405867:ERROR:alsa_util.cc(204)] PcmOpen: default,No such file or directory
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM default
[15394:0901/193650.406082:ERROR:alsa_util.cc(204)] PcmOpen: plug:default,No such file or directory

@immogish
Copy link

immogish commented Apr 3, 2024

I have this problem too, on Cypress version 12.17.4

@askhanna-mdsol
Copy link

Got this problem as well.

@MikeMcC399
Copy link
Collaborator

@askhanna-mdsol

Can you provide some more information?

Which Cypress Docker image are you using?
What is your host operating system for Docker?
Are you running Desktop Docker?
How are you running it? Locally or in CI?
Can you give the commands you use to run the container?
Are you using the default root user or a non-root user?
Is your project directory generally read-only or is it read-only, only for the user running the Docker container?

@askhanna-mdsol
Copy link

@askhanna-mdsol

Can you provide some more information?

Which Cypress Docker image are you using? What is your host operating system for Docker? Are you running Desktop Docker? How are you running it? Locally or in CI? Can you give the commands you use to run the container? Are you using the default root user or a non-root user? Is your project directory generally read-only or is it read-only, only for the user running the Docker container?

Cypress image : cypress/included:cypress-13.11.0
Yes, these tests are a running in github action CI pipeline on linux machines. These git runners are a part of the K8 infrastructure that the tests are running on, we are not Dockerizing the application to execute it inside the container.

@MikeMcC399
Copy link
Collaborator

@askhanna-mdsol

I understand that you are running your workflow through Kubernetes (K8s) under GitHub Actions.

If you would like this issue investigated further, please open a new issue.
Include your GitHub Actions workflow, any error message you are seeing and any other further details that could be helpful for troubleshooting, such as the name and version of the Linux operating system in use. I presume that these are self-hosted GitHub runners.

You can find an example workflow .github/workflows/example-cypress-github-action.yml showing Cypress Docker images running successfully under GitHub Actions on GitHub-hosted runners (no K8s involved).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants