cypress: Cypress tests fail in air-gapped network on Firefox
Current behavior
In an air gapped network, running a component or e2e tests using cypress on Firefox using the cypress/included docker image fails with the following error:
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: read ECONNRESET
at ClientRequest.<anonymous> (file:///root/.cache/Cypress/14.0.2/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)
This is likely a regression introduced in release 13.15.1 which started using geckodriver.
Desired behavior
I expect the test to run in an air gapped network. It should not send any request to the internet.
Test code to reproduce
Any test in Firefox in an air-gapped network.
Cypress Version
14.0.2
Node version
v22.13.1
Operating System
Debian bookworm
Debug Logs
Other
I also attempted to override the environment variables supported by geckodriver to use a local path
GECKODRIVER_VERSION = '0.35.0'
GECKODRIVER_CDNURL = 'file:///path/to/geckodriver/'
But it failed node-fetch does not support file:.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (15 by maintainers)
Thanks for the help and the analysis, @MikeMcC399 & @AtofStryker.
I created https://github.com/cypress-io/cypress-docker-images/issues/1298.
@AtofStryker
I see that would be complicated to do for Cypress in general. Let me open a new issue in the Cypress Docker repo and describe the issue testing Firefox ESR offline (available for amd64 and arm64). If a fix goes into the Docker images it would only need to be for Debian.
This issue should be closed, as it is resolved.
See previous https://github.com/cypress-io/cypress/issues/31036#issuecomment-2952514102 ⏫
The issue is reproducible with
cypress/includedandcypress/browsersDocker images. Edit:It does not appear to be an issue in native Ubuntu or Windows environments.Steps to reproduce
OR
docker runwith disconnected network