-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 cannot delete profileDir on exit because it creates files with only read permissions. #31300
Comments
@ValJed Could you try updating to latest in Firefox and see if this issue still persists? We made a lot of changes to how we interact with Firefox in 14.1.0 and I just want to see if this may already be fixed. Thanks! |
@jennifer-shehane Thanks for the quick feedback, cypress 14 is still not available on nix but I'll try as soon as I can. In the case of firefox and chromium I can fix it by manually deleting the content of |
This is very similar to the issue on Windows with the same error message
Reproducible with Cypress git clone --branch firefox-profile https://github.com/MikeMcC399/cypress-test-tiny
cd cypress-test-tiny
npm ci
./firefox-loop.sh Log example
|
@ValJed thank you for opening an issue! We currently don't modify the copied extension directory contents except for background.js. I am working on building a Cypress pre-release binary that you and @MikeMcC399 can try that might resolve the issue. Right now its a bit aggresive, but its giving read, write, and execute permissions to the extension directory when we copy it over. Binaries should be available on this commit shortly. Are you both able to give the binary a try? |
The beta binary doesn't resolve the issue unfortunately. Perhaps it is a timing issue since in some runs there was no issue, and then in others it failed to delete the profile on exit. These are my steps: git clone --branch firefox-profile https://github.com/MikeMcC399/cypress-test-tiny
cd cypress-test-tiny
npm ci
./firefox-loop.sh # fails sporadically
npm install npm install https://cdn.cypress.io/beta/npm/14.2.1/win32-x64/chore/FF-investigation-6286411864a452664012a221430bc3af8e10e0f4/cypress.tgz
./firefox-loop.sh with logs attached: |
This original issue from @ValJed is for Nix, which has its own special challenges. My repro is on Windows and on Linux it works fine. I think there are perhaps two related problems, so I'm going to submit a new issue for Windows. From previous issues, I know that it is difficult for NixOS users to update, so that would be another reason to split the troubleshooting. |
Windows is showing the following, which is a different
|
Hey @AtofStryker thanks for your investigation. |
You can find the binaries on 6286411#comments I'm not sure if @AtofStryker is still waiting for feedback on this one though. |
@ValJed the binaries would be available in the comments of 6286411#comments. I closed the PR since the binaries built and we need a PR to run CI |
@AtofStryker Ok I tried to test but I don't think this is the right binary since it's node code. I tried running it with the variable:
I tried simply renaming the binary with a capital C I got
|
The binaries have the version
Unfortunately I don't know if you can directly use this under NixOS, since the Nix organization repackages Cypress. You might need to go through the packaging process to integrate the binary I guess. It looks like you are using Cypress 13.17.0 from the nixpkgs so-called |
Current behavior
Whenever I run tests on a specific browser, I get the linked error when stopping the process.
So pretty clear, it just has no permission to delete some files it created earlier. So I have to do it manually then it works again.
The problem is that even if I change manually the permissions of the entire folder, cypress creates files with only read permission:
~/.config/Cypress/cy/production/browsers/firefox-stable/interactive/CypressExtension

So later, it's unable to delete them.
I'm not sure what I can do to change this behavior. Also I'm wondering why putting these files into
.config
when it's seems like cache files to me?Is this problem linked to the fact that I use
CYPRESS_RUN_BINARY
?Thanks in advance for any input.
Desired behavior
Cypress should create files with delete permission to be able later to delete them.
Test code to reproduce
Nothing special except I use
CYPRESS_RUN_BINARY
that runs a binary from nix.Cypress Version
13.17.0
Node version
v20.18.3
Operating System
nix (Nix) 2.24.12
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: