cypress: Cypress cannot open firefox - getaddrinfo EAI_AGAIN error
I am working on a new project. The web application is accessed via a VM through a proxy and without internet access.
I installed the latest version of Cypress (14.1.0) using the CYPRESS_INSTALL_BINARY environment variable and Artifactory. Cypress launches with Edge but not with firefox.
When I run the command npx cypress run -b firefox, the following error messages are displayed How to work around the getaddrinfo EAI_AGAIN error raw.githubusercontent.com and get firefox launch?
C:\Users\secret\Documents\cy>npx cypress run -b firefox
DevTools listening on ws://127.0.0.1:54013/devtools/browser/1b8de19e-d2ff-48ae-9231-84d4725fa517
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 14.1.0 │
│ Browser: Firefox 128 (headless) │
│ Node Version: v22.14.0 (C:\Users\secret\Downloads\node-v22.14.0-win-x64\node.exe) │
│ │
│ Specs: 20 found (1-getting-started/todo.cy.js, 2-advanced-examples/actions.cy.js, 2-a │
│ dvanced-examples/aliasing.cy.js, 2-advanced-examples/assertions.cy.js, 2-advan │
│ ced-examples/connectors.cy.js, 2-advanced-examples/cookies.cy.js, 2-advanced-e │
│ xamples/cypress_api.cy....) │
│ Searched: cypress/e2e/**/*.cy.{js,jsx,ts,tsx} │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: 1-getting-started/todo.cy.js (1 of 20)
Since Firefox 129, Chrome DevTools Protocol (CDP) has been deprecated in Firefox. In Firefox 135 and above, Cypress defaults to automating the Firefox browser with WebDriver BiDi. Cypress will no longer support CDP within Firefox in the future and is planned for removal in Cypress 15.
**Cypress failed to make a connection to Firefox.**
This usually indicates there was a problem opening the Firefox browser.
FetchError: request to https://raw.githubusercontent.com/mozilla/geckodriver/release/Cargo.toml failed, reason: getaddrinfo EAI_AGAIN raw.githubusercontent.com
at ClientRequest.<anonymous> (file:///C:/Users/secret/AppData/Local/Cypress/Cache/14.1.0/Cypress/resources/app/packages/server/node_modules/node-fetch/src/index.js:108:11)
at ClientRequest.emit (node:events:518:28)
at emitErrorEvent (node:_http_client:101:11)
at TLSSocket.socketErrorListener (node:_http_client:504:5)
at TLSSocket.emit (node:events:518:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
_Originally posted by @wildnano in https://github.com/cypress-io/cypress/discussions/31223_
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (8 by maintainers)
@MikeMcC399 Removing the profile file was not the solution.
There is a conf file for Mozilla. I removed some lines. It works perfectly now.
To sum up, depending on your Cypress version, in an air-gapped environment you may have to put geckodriver.exe in AppData/Local/Temp But this is not ideal because after a while it gets deleted… I assume I need to implement a script to check whether the file exists before Firefox launch and paste it into the Temp folder if it doesn’t.
Thank you!
@wildnano
Since cypress@13.15.1 released Oct 24, 2024:
So if you were testing one year ago, you would have been using a version of Cypress which did not use the geckodriver.
The npm package geckodriver by default dynamically downloads and caches an architecture-dependent geckodriver from GitHub. This default behavior requires an Internet connection.
You may be able to work around this issue in an air-gapped environment by downloading the geckodriver from the releases page and then unzipping the
geckodriver.exeinto the Windows temporary directory (usually%TEMP%or%TMP%).This is something that you might like to try.
Regarding browser versions - independent of the geckodriver / air-gap issue:
Firefox 128 from the Rapid Release Channel is no longer supported by Cypress, although judging by the fact that Firefox 128 ESR still works, I would expect Firefox 128 in general also to work.
Firefox 102 ESR entered End-of-Life in Sep 2023. It is no longer supported by Firefox, nor by Cypress. Don’t try to use this version with current versions of Cypress. Firefox 128 ESR is the current ESR version. There is an open request in https://github.com/cypress-io/cypress-documentation/issues/6083 concerning a Cypress support statement for this version.