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

Error after running a test using the Firefox browser on the CLI in Windows. #30916

Open
Lorenzras opened this issue Jan 20, 2025 · 5 comments
Open

Comments

@Lorenzras
Copy link

Current behavior

Using the commandline, test itself succeeds but throws the following error.

[firefox-profile] cannot delete profileDir on exit

Here is what we did so far to no avail.

  1. Delete node_modules, then reinstall packages.
  2. Clone the test repository on a different Windows computer.

Desired behavior

No response

Test code to reproduce

I was able to reproduce it with sample repo .

npx cypress run --browser firefox

Image

Image

Cypress Version

13.17.0

Node version

v20.10.0

Operating System

Windows 11 Pro

Debug Logs

npx cypress run --browser firefox

[firefox-profile] cannot delete profileDir on exit C:\Users\raslo\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-8308 Error: EPERM: operation not permitted, unlink '\\?\C:\Users\raslo\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-8308\rust_mozprofilefECWUR\cookies.sqlite-shm'
    at unlinkSync (node:fs:1883:3)
    at _unlinkSync (node:internal/fs/rimraf:214:14)
    at unlinkSync (node:fs:1883:3)
    at _unlinkSync (node:internal/fs/rimraf:214:14)
    at fixWinEPERMSync (node:internal/fs/rimraf:306:5)
    at rimrafSync (node:internal/fs/rimraf:200:14)
    at node:internal/fs/rimraf:253:9
    at Array.forEach (<anonymous>)
    at _rmdirSync (node:internal/fs/rimraf:250:7)
    at fixWinEPERMSync (node:internal/fs/rimraf:304:5)
    at rimrafSync (node:internal/fs/rimraf:200:14)
    at node:internal/fs/rimraf:253:9
    at Array.forEach (<anonymous>)
    at _rmdirSync (node:internal/fs/rimraf:250:7)
    at fixWinEPERMSync (node:internal/fs/rimraf:304:5)
    at rimrafSync (node:internal/fs/rimraf:200:14)
    at Object.rmSync (node:fs:1278:10)
    at v._cleanOnExit (<embedded>:777:119095)
    at process.onExit (<embedded>:777:117974)
    at process.emit (node:events:526:35)
    at App.<anonymous> (node:electron/js2c/browser_init:2:119065)
    at App.emit (node:events:514:28)
    at b (<embedded>:3031:2271)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -4048,
  syscall: 'unlink',
  code: 'EPERM',
  path: '\\\\?\\C:\\Users\\raslo\\AppData\\Roaming\\Cypress\\cy\\production\\browsers\\firefox-stable\\run-8308\\rust_mozprofilefECWUR\\cookies.sqlite-shm'
}

Other

There was no problem running on Mac or in GUI mode.

@Lorenzras Lorenzras changed the title Firefox throws error after test using command line on windows. Error after running a test using the Firefox browser on the CLI in Windows. Jan 20, 2025
@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Jan 20, 2025

@Lorenzras

In your screenshot Windows is showing an issue because the resource is busy. You may want to reboot your system and see if that clears the issue.

@YukeySnowHarry
Copy link

I have encountered the similar issue from chrome, and I deleted this file and launch cypress again, it is normal now.

@MikeMcC399
Copy link
Contributor

I am seeing it as well on Windows 11 24H2 with Cypress 14.1.0, Node.js 22.14.0 LTS and Firefox 136.0 and if I simply execute

npx cypress run -b firefox

If I repeatedly execute the above command, sometimes there is an error, sometimes there is no error. This is a sporadic issue.

On repeat runs, the directory and filename changes each time:

\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-4424\rust_mozprofileMwXaVr\cert9.db
\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-17760\rust_mozprofiledBbG19\favicons.sqlite-shm
\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-15560\rust_mozprofilefihkhd\favicons.sqlite-shm
\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-17056\rust_mozprofilexCXXUB\favicons.sqlite-shm

In each case, the error message is similar to the one in the original report, for example:

[firefox-profile] cannot delete profileDir on exit C:\Users\mikem\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-17056 Error: EPERM: operation not permitted, unlink 'C:\Users\mikem\AppData\Roaming\Cypress\cy\production\browsers\firefox-stable\run-17056\rust_mozprofilexCXXUB\favicons.sqlite-shm'

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Mar 11, 2025

Steps to reproduce

The following fails sporadically on Windows 11 24H2 (Node.js 22.14.0 LTS), running Cypress 14.2.0 10 times against Firefox 136.0.1:

git clone --branch firefox-profile https://github.com/MikeMcC399/cypress-test-tiny
cd cypress-test-tiny
npm ci
./firefox-loop.sh

On Ubuntu 24.04.2 LTS there are no failures.

@MikeMcC399
Copy link
Contributor

@Lorenzras

From what I can see, Cypress is having sporadic problems to delete a temporary Firefox profile on Windows. It doesn't happen all the time and it doesn't stop Cypress from working.

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

3 participants