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

XDG_RUNTIME_DIR error in Debian 12.x headless #29554

Open
MikeMcC399 opened this issue May 22, 2024 · 49 comments
Open

XDG_RUNTIME_DIR error in Debian 12.x headless #29554

MikeMcC399 opened this issue May 22, 2024 · 49 comments
Labels
stage: needs investigating Someone from Cypress needs to look at this type: error message

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented May 22, 2024

Current behavior

Running Cypress default scaffolded tests on Debian 12.x in a headless environment (server with no GPU) may result in the error:

error: XDG_RUNTIME_DIR is invalid or not set in the environment

It may occur with Electron, Chrome, Edge for Firefox browsers and may be associated with a test failure or not. For example

  Running:  2-advanced-examples/files.cy.js                                                (8 of 20)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.

Timed out waiting for the browser to connect. Retrying...
Missing browserCriClient in connectToNewSpec
Error: Missing browserCriClient in connectToNewSpec
    at Object.connectToNewSpec (<embedded>:4413:48840)
    at Object.connectToNewSpec (<embedded>:4413:27125)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async v.relaunchBrowser (<embedded>:4498:37708)

Desired behavior

Cypress should run the default scaffolded tests reliably under Debian 12.5 and later on a server with no GPU.

The issue is not reproducible on Debian 12.5 where a GPU (graphics processing unit) is installed.

Test code to reproduce

This is a sporadic error, not a hard error.
Check tests on https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images?branch=master for examples

Last example Dec 6, 2024.

Cypress Version

First reported on 13.10.0
Also reproducible on 13.16.1

Node version

v20.13.1 v20.17.0

Operating System

Debian 12.5 12.7 & 12.8

Debug Logs

See https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images

Other

@estefafdez
Copy link

any update on this error? thanks!

@MikeMcC399
Copy link
Contributor Author

@estefafdez

any update on this error? thanks!

Are you also seeing this error or are you just interested in the outcome?

@estefafdez
Copy link

@estefafdez

any update on this error? thanks!

Are you also seeing this error or are you just interested in the outcome?

I'm seeing the error on the logs at the moment with the latest version of cypress (13.10.0)

@MikeMcC399
Copy link
Contributor Author

@estefafdez

I'm seeing the error on the logs at the moment with the latest version of cypress (13.10.0)

Are you also running under Debian 12.5 or is it a different environment? Could you also explain whether this is in a local system or a CI system and if it's CI please give some details about the provider and the exact runner type. Also if you are running in Docker or not. All details will be helpful.

@MikeMcC399
Copy link
Contributor Author

The error XDG_RUNTIME_DIR may be another garbage error resulting from Electron.

The fact that it is sometimes occurs with a test failure may or may not be coincidence.

@maximegheraille
Copy link

maximegheraille commented Jun 5, 2024

Hi, we are also experiencing the same on issue on version 13.10.0 of cypress when a test is failing.

We run our test in a docker container that uses cypress/factory.

Tried with version 13.8.1 and the issue is also present

@MikeMcC399
Copy link
Contributor Author

@maximegheraille

Which version of cypress/factory are you basing your Docker container on?

What output does the following command yield?

docker run --entrypoint cat <your Docker image> /etc/debian_version

@maximegheraille
Copy link

Hi @MikeMcC399

We use the latest version cypress/factory:latest and the debian version is 12.5

@MikeMcC399
Copy link
Contributor Author

@maximegheraille

If the failures are repeatable, then you may like to try with
DEBUG=cypress:*
to see if there are any other relatable errors.

In the test runs of the Docker repo https://github.com/cypress-io/cypress-docker-images I am seeing the error happening quite often, but without test failure:

error: XDG_RUNTIME_DIR

@maximegheraille
Copy link

Hi @MikeMcC399

I did investigate a few non failing runs, and it is also showing it.
This means that it is not related to failing test.

I will try with the debug option and see if I can find anything useful

@EtienneBruines
Copy link

EtienneBruines commented Jun 11, 2024

Also experiencing this issue (but with the cypress/browsers:latest docker image).

@MikeMcC399 Here are the logs surrounding the XDG_RUNTIME_DIR error. After the error, it only repeats the memory/cpu usage periodically, basically 'hanging' and not running any tests.

Difference with me: It's reproducible 100% of the time.


  │ Cypress:        13.11.0                                                                        │
  │ Browser:        Chrome 124 (headless)                                                          │
  │ Node Version:   v22.0.0 (/usr/local/bin/node)                                                  │
  cypress:https-proxy received error on client browserSocket { err: Error: write EPIPE     at afterWriteDispatched (node:internal/stream_base_commons:160:15)     at writeGeneric (node:internal/stream_base_commons:151:3)     at Socket._writeGeneric (node:net:931:11)     at Socket._write (node:net:943:8)     at writeOrBuffer (node:internal/streams/writable:392:12)     at _write (node:internal/streams/writable:333:10)     at Socket.write (node:internal/streams/writable:337:10)     at Socket.ondata (node:internal/streams/readable:766:22)     at Socket.emit (node:events:514:28)     at addChunk (node:internal/streams/readable:324:12)     at readableAddChunk (node:internal/streams/readable:297:9)     at Socket.push (node:internal/streams/readable:234:10)     at TCP.onStreamRead (node:internal/stream_base_commons:190:23) { errno: -32, code: 'EPIPE', syscall: 'write' }, url: 'optimizationguide-pa.googleapis.com:443' } +2s
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 50262 } +299ms
  cypress:server:request received an error on request after response started { browserPreRequest: undefined, timeout: undefined, retryIntervals: [], url: '[https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION'](https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION%27), time: false, requestId: 'request150', retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, delaysRemaining: [], err: Error: aborted     at connResetException (node:internal/errors:720:14)     at TLSSocket.socketCloseListener (node:_http_client:461:19)     at TLSSocket.emit (node:events:526:35)     at node:net:323:12     at TCP.done (node:_tls_wrap:588:7) { code: 'ECONNRESET' } } +1ms
  cypress:proxy:http:util:prerequests Never received pre-request or url without pre-request for request GET-https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION after waiting 2000ms. Continuing without one. +61ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +40ms
  cypress:server:util:resource-type-and-credential credentials request received for request url https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION, hashKey 57d076d8888ceb613df46a85d1778a12 +61ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +1ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:server:remote-states getting remote state: undefined for: https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION +41ms
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +0ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +0ms
  cypress:server:stream_buffer stream buffer writeable final called +61ms
  cypress:network:agent addRequest called { isHttps: true, href: '[https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION'](https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION%27) } +61ms
  cypress:network:agent got family { family: 4, href: '[https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION'](https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION%27) } +0ms
  cypress:server:request received status code & headers on request { requestId: 'request151', statusCode: 200, headers: { 'content-type': 'text/html; charset=UTF-8' } } +39ms
  cypress:server:request successful response received { requestId: 'request151' } +1ms
  cypress:net-stubbing:server:intercept-response InterceptResponse { req: { url: '/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION' }, request: undefined } +46ms
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +3ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +3ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:server:remote-states getting primary remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +1ms
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +0ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +1ms
  cypress:https-proxy received error on client browserSocket { err: Error: read ECONNRESET     at TCP.onStreamRead (node:internal/stream_base_commons:217:20) { errno: -104, code: 'ECONNRESET', syscall: 'read' }, url: 'optimizationguide-pa.googleapis.com:443' } +43ms
  cypress:server:request received status code & headers on request { requestId: 'request152', statusCode: 200, headers: { 'content-type': 'text/html; charset=UTF-8' } } +54ms
  cypress:server:request successful response received { requestId: 'request152' } +0ms
  cypress:net-stubbing:server:intercept-response InterceptResponse { req: { url: '/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION' }, request: undefined } +54ms
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +54ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +54ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:server:remote-states getting primary remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'optimizationguide-pa', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +0ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +0ms
  cypress:https-proxy received error on client browserSocket { err: Error: write EPIPE     at afterWriteDispatched (node:internal/stream_base_commons:160:15)     at writeGeneric (node:internal/stream_base_commons:151:3)     at Socket._writeGeneric (node:net:931:11)     at Socket._write (node:net:943:8)     at writeOrBuffer (node:internal/streams/writable:392:12)     at _write (node:internal/streams/writable:333:10)     at Socket.write (node:internal/streams/writable:337:10)     at Socket.ondata (node:internal/streams/readable:766:22)     at Socket.emit (node:events:514:28)     at addChunk (node:internal/streams/readable:324:12)     at readableAddChunk (node:internal/streams/readable:297:9)     at Socket.push (node:internal/streams/readable:234:10)     at TCP.onStreamRead (node:internal/stream_base_commons:190:23) { errno: -32, code: 'EPIPE', syscall: 'write' }, url: 'optimizationguide-pa.googleapis.com:443' } +56ms
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 50274 } +99ms
  cypress:server:request aborting { requestId: 'request152' } +5ms
  cypress:server:request aborting { requestId: 'request152' } +0ms
  cypress:server:request received an error on request after response started { browserPreRequest: undefined, timeout: undefined, retryIntervals: [], url: '[https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION'](https://optimizationguide-pa.googleapis.com/downloads?name=1689043206&target=OPTIMIZATION_TARGET_VISUAL_SEARCH_CLASSIFICATION%27), time: false, requestId: 'request152', retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, delaysRemaining: [], err: Error: aborted     at connResetException (node:internal/errors:720:14)     at TLSSocket.socketCloseListener (node:_http_client:461:19)     at TLSSocket.emit (node:events:526:35)     at node:net:323:12     at TCP.done (node:_tls_wrap:588:7) { code: 'ECONNRESET' } } +1ms
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    2.6     │      11.8      │  882.63  │    890.72    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    2.58    │     10.16      │  474.3   │    450.31    │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │     0      │       0        │  245.65  │    294.84    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │    0.85    │      1.56      │  126.32  │    130.73    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1503, 1504'                      │     50     │      62.5      │   5.2    │    41.91     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │   56.03    │     79.73      │  1734.1  │   1350.59    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 50250 } +5s
  cypress:server:server-base Got CONNECT request from safebrowsingohttpgateway.googleapis.com:443 +12s
  cypress:https-proxy Writing browserSocket connection headers { url: 'safebrowsingohttpgateway.googleapis.com:443', headLength: 0, headers: { host: 'safebrowsingohttpgateway.googleapis.com:443', 'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/125.0.0.0 Safari/537.36' } } +10s
  cypress:https-proxy Got first head bytes { url: 'safebrowsingohttpgateway.googleapis.com:443', head: '\x16\x03\x01\x070\x01\x00\x07,\x03\x03IU[_\x07�f\x1E��Ѫ��Q��G싏��^��+��\x06\x1A9 Yb�$�\x06���Gd��Fd\\�\x15U�d�\f' } +0ms
  cypress:https-proxy Making intercepted connection to 41673 +54ms
  cypress:network:connect successfully connected { opts: { port: 41673, host: 'localhost', getDelayMsForRetry: [Function: h] }, iteration: 0 } +12s
  cypress:https-proxy received upstreamSocket callback for request { port: 41673, hostname: 'localhost', err: undefined } +2ms
  cypress:server:util:socket_allowed allowing socket { localPort: 33752 } +5s
  cypress:launcher:browsers chrome stderr: [1215:1233:0611/105732.491350:ERROR:cert_verify_proc_builtin.cc(1051)] CertVerifyProcBuiltin for safebrowsingohttpgateway.googleapis.com failed:
----- Certificate i=0 (OU=Cypress Proxy Server Certificate,O=Cypress Proxy CA,L=Internet,ST=Internet,C=Internet,CN=safebrowsingohttpgateway.googleapis.com) -----
ERROR: No matching issuer found +22s
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    2.46    │      8.69      │  876.91  │    886.11    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    0.35    │      8.2       │  449.23  │    450.09    │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │     0      │       0        │  247.23  │    285.32    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │     0      │      1.17      │  126.32  │    129.63    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1539, 1540'                      │     50     │       60       │   5.18   │    34.56     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │    52.8    │     74.35      │ 1704.88  │   1421.45    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
  cypress:proxy:http:util:prerequests Never received pre-request or url without pre-request for request GET-https://safebrowsingohttpgateway.googleapis.com/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw after waiting 2000ms. Continuing without one. +12s
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +12s
  cypress:server:util:resource-type-and-credential credentials request received for request url https://safebrowsingohttpgateway.googleapis.com/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw, hashKey 3dd49b057297dc81ebe26a7a54700525 +12s
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'safebrowsingohttpgateway', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: 'secure8', domain: 'datev', tld: 'de' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'safebrowsingohttpgateway', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'safebrowsingohttpgateway', tld: 'googleapis.com' } +1ms
  cypress:server:remote-states getting remote state: undefined for: https://safebrowsingohttpgateway.googleapis.com/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw +12s
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +0ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +0ms
  cypress:server:stream_buffer stream buffer writeable final called +12s
  cypress:network:agent addRequest called { isHttps: true, href: '[https://safebrowsingohttpgateway.googleapis.com/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw'](https://safebrowsingohttpgateway.googleapis.com/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw%27) } +12s
  cypress:network:connect beginning getAddress { hostname: 'safebrowsingohttpgateway.googleapis.com', port: 443 } +2s
  cypress:network:connect got addresses { hostname: 'safebrowsingohttpgateway.googleapis.com', port: 443, addresses: [ { address: '142.250.181.202', family: 4 }, { address: '172.217.16.74', family: 4 }, { address: '142.251.209.138', family: 4 }, { address: '172.217.19.74', family: 4 }, { address: '2a00:1450:4005:801::200a', family: 6 }, { address: '2a00:1450:4005:80b::200a', family: 6 }, { address: '2a00:1450:4005:802::200a', family: 6 } ] } +33ms
  cypress:network:agent got family { family: 4, href: '[https://safebrowsingohttpgateway.googleapis.com/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw'](https://safebrowsingohttpgateway.googleapis.com/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw%27) } +37ms
  cypress:server:request received status code & headers on request { requestId: 'request153', statusCode: 200, headers: { 'content-type': 'application/ohttp-keys' } } +12s
  cypress:server:request successful response received { requestId: 'request153' } +0ms
  cypress:net-stubbing:server:intercept-response InterceptResponse { req: { url: '/v1/ohttp/hpkekeyconfig?key=AIzaSyBOti4mM-6x9WDnZIjIeyEU21OpBXqWBgw' }, request: undefined } +12s
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +68ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +68ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'safebrowsingohttpgateway', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'safebrowsingohttpgateway', tld: 'googleapis.com' } +0ms
  cypress:server:remote-states getting primary remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'safebrowsingohttpgateway', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '443', protocol: 'https:', subdomain: null, domain: 'safebrowsingohttpgateway', tld: 'googleapis.com' } +0ms
  cypress:network:cors Parsed URL { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } +1ms
  cypress:server:remote-states getting remote state: { auth: null, origin: 'http://localhost'/, strategy: 'http', fileServer: null, domainName: 'localhost', props: { port: '80', protocol: 'http:', subdomain: null, domain: '', tld: 'localhost' } } for: http://localhost/ +1ms
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 33752 } +7s
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    2.84    │      7.22      │  831.93  │    872.57    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    1.37    │      7.06      │  437.47  │    447.99    │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │     0      │       0        │  247.23  │    278.97    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │     0      │      0.94      │  126.32  │    128.97    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1575, 1576'                      │     0      │       50       │   5.19   │    29.67     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │    4.21    │     62.66      │ 1648.15  │   1459.23    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    2.2     │      6.22      │  837.3   │    865.51    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    0.2     │      6.08      │  438.21  │    446.59    │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │     0      │       0        │  247.23  │    274.43    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │     0      │      0.78      │  126.32  │    128.53    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1611, 1612'                      │    100     │     57.14      │   5.13   │    26.16     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │   102.4    │     68.34      │  1654.2  │   1487.09    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    2.51    │      5.6       │  838.23  │    860.97    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    0.2     │      5.35      │  437.87  │    445.5     │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │     0      │       0        │  247.23  │    271.03    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │     0      │      0.67      │  126.32  │    128.21    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1647, 1648'                      │     0      │       50       │   5.24   │    23.55     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │    2.71    │     60.13      │  1654.9  │   1508.06    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    6.09    │      5.67      │  792.82  │    851.23    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    0.17    │      4.77      │  437.9   │    444.66    │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │     0      │       0        │  247.23  │    268.39    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │     0      │      0.59      │  126.32  │    127.98    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1683, 1684'                      │     0      │     44.44      │   5.21   │    21.51     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │    6.27    │     54.15      │ 1609.49  │   1519.33    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    1.88    │      5.2       │  775.97  │    841.82    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    0.17    │      4.31      │   438    │    443.99    │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │     0      │       0        │  247.23  │    266.27    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │     0      │      0.52      │  126.32  │    127.79    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1720, 1721'                      │     0      │       40       │   5.21   │    19.88     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │    2.05    │     48.94      │ 1592.74  │   1526.67    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────────────────────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │                         pids                          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────────────────────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'Chrome'      │      9       │ '1215, 1219, 1220, 1229, 1248, 1230 ... 3 more items' │    2.46    │      4.89      │  776.21  │    834.53    │    898.8    │
  cypress:server:util:process_profiler │    1    │     'cypress'     │      1       │                         '906'                         │    0.22    │      3.94      │  438.96  │    443.53    │   508.84    │
  cypress:server:util:process_profiler │    2    │ 'electron-shared' │      4       │                '910, 1062, 911, 1068'                 │    0.12    │      0.01      │  248.74  │    264.68    │   591.35    │
  cypress:server:util:process_profiler │    3    │     'plugin'      │      1       │                        '1112'                         │     0      │      0.47      │  126.32  │    127.64    │   169.17    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │                     '1756, 1757'                      │     50     │     40.91      │   5.26   │    18.55     │   152.41    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      17      │                          '-'                          │   52.81    │     49.29      │  1595.5  │   1532.93    │   1779.67   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────────────────────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s

@MikeMcC399
Copy link
Contributor Author

@EtienneBruines

I suspect that these are two different errors. This is however just "gut feel". It needs more investigation to find out.

@AndyClifford
Copy link

AndyClifford commented Jun 17, 2024

Hey is there any update on this issue? Cheers !

@MikeMcC399
Copy link
Contributor Author

The browser: chromium label can be removed, as this issue also occurs with Electron.

See https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images/2035/workflows/0b0791df-55ea-4811-a494-1111e289d282/jobs/61974

@craigmiller160
Copy link

craigmiller160 commented Jun 19, 2024

I can also say that I am seeing this reliably with certain tests in my GitLab CI pipeline using cypress/included:13.11.0. It's using chrome 125.

@pitgrap
Copy link
Contributor

pitgrap commented Jun 26, 2024

We see the error error: XDG_RUNTIME_DIR is invalid or not set in the environment. in our pipelines too. We use the docker image cypress/factory with

NODE_VERSION=20.14.0
CHROME_VERSION=118.0.5993.70-1

@jimmigit
Copy link

Also seeing this issue.

error: XDG_RUNTIME_DIR is invalid or not set in the environment.

Running:
Cypress: 13.12.0
Browser: Chrome 126 (headless) │
Node Version: v20.14.0

@serhatgemici
Copy link

serhatgemici commented Jul 1, 2024

Having the same issue on Azure Pipelines:
Docker Image: cypress/base:latest
Cypress version: 13.12.0
Browser: Chrome 126 (headless)
Node Version: v20.14.0

 Running:  Tests.spec.js                                                        (1 of 5)
  Tests
    (Attempt 1 of 3) test one
    (Attempt 2 of 3) test one
    1) test one
    (Attempt 1 of 3) test two
    (Attempt 2 of 3) test two
    2) test two
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
    (Attempt 1 of 3) test three
    (Attempt 2 of 3) test three
    3) test three


  0 passing (2m)
  3 failing
...
...
...
##[error]error: XDG_RUNTIME_DIR is invalid or not set in the environment.
##[error]error: XDG_RUNTIME_DIR is invalid or not set in the environment.
##[error]The process '/usr/bin/docker' failed with exit code 7
Finishing: Start Container

Dockerfile

# Use the cypress/base image as the base
FROM cypress/base:latest AS base

ARG environment_group_arg
ENV ENV_GROUP_ARG=$environment_group_arg
ARG CYPRESS_TESTRAIL_PASSWORD
ENV CYPRESS_TESTRAIL_PASSWORD=$CYPRESS_TESTRAIL_PASSWORD

# Install necessary dependencies
RUN apt-get update
RUN apt-get -y install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb libu2f-udev libvulkan1
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get -y install fonts-liberation xdg-utils man-db
RUN dpkg -i google-chrome-stable_current_amd64.deb

# Copy your application's files into the container
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci && npm cache clean --force
COPY . .

# Copy the entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# Specify the entrypoint script
ENTRYPOINT ["/entrypoint.sh"]

RUN echo "Environment group: ${environment_group_arg} is built. {Legend:[1: Dev, 2: Stage, 3: Prod, 4: feature environment 5: feature env. in ci] }"

@MikeMcC399
Copy link
Contributor Author

@serhatgemici

It's difficult to know if Cypress failures are related to the XDG_RUNTIME_DIR or not.

Just as a comment on the way you are building your Docker image: you might find it easier to use cypress/factory which already adds the Linux prerequisites for Cypress and makes it easy to just add a selected version of Chrome. This comment is however off-topic for the current issue 🙂 If you want to discuss, then Discord chat (click on button) is a better place.

@MikeMcC399 MikeMcC399 changed the title XDG_RUNTIME_DIR error in Debian 12.5 headless XDG_RUNTIME_DIR error in Debian 12.x headless Jul 3, 2024
@theTestingApproach
Copy link

Just updated to 13.13.0 and seeing the error error: XDG_RUNTIME_DIR is invalid or not set in the environment.

Cypress: 13.13.0
Browser: Chrome 126 (headless)
Node Version: v20.14.0

@MikeMcC399
Copy link
Contributor Author

@theTestingApproach

  • The issue hasn't been addressed so far and it looks like it may just be a "garbage error". It's possible it may go away (or be replaced by a different garbage error) when Cypress updates Electron (see PR fix(dep): Upgrade Electron 28 #28959).

@jpierson-at-riis
Copy link

According to #29554 (comment), version 13.8.1 seems to be the earliest reported version where this has been reproduced. Is there any indication from the CI/CD logs which may indicate when this issue was introduced?

@jpierson-at-riis
Copy link

After testing with 13.6.4, which appears to be the last time electron was upgraded, I'm no longer seeing the XDG_RUNTIME_DIR related errors but I'm still getting the indefinite hanging in one of my failing tests. I'm guessing that the failing test issue is just a problem in our codebase at the moment though. I'm going to continue with 13.6.4 as an attempted workaround for now.

@MikeMcC399
Copy link
Contributor Author

@jpierson-at-riis

Due to the nature of this issue there are different root causes emerging which are difficult to split out. As far as the original subject of this issue is concerned "XDG_RUNTIME_DIR error in Debian 12.x headless" the first official Cypress Docker image to be based on Debian 12 was cypress/included:13.11.0

cypress/factory:4.0.0 was released on May 30, 2024.

@jpierson-at-riis
Copy link

Thank you for the details @MikeMcC399, according to your original post though it seems that you are indicating that this was first reported for 13.10.0 though or am I misunderstanding?

image

I've also been able to avoid the XDG_RUNTIME_DIR from showing in my case by toggling the chromeWebSecurity setting off in my case. I believe this is just avoiding the underlying test failure which was leading to scenario where that error would be printed normally but since it could be relevant to understanding the section of code which may be responsible for reproducing the issue I figured I'd share.

@MikeMcC399
Copy link
Contributor Author

@jpierson-at-riis

Sorry for the confusing details! I was actually testing the Debian 12 image on Cypress 13.10.0 before the official Docker image was released for Cypress 13.11.0.

It doesn't look like anybody has dug into the code at this stage, so thanks for your additional details!

@MikeMcC399

This comment was marked as outdated.

@gilgold
Copy link

gilgold commented Aug 27, 2024

Happens to me when running in the CI using the cypress/browsers docker images, cypress v13.13.3 and cypress.config has chromeWebSecurity set to false

@bolemeus
Copy link

bolemeus commented Aug 27, 2024

Im using the cypress/included:13.13.3 in my pipeline in gitlab and I'm also running into this issue.

I'm seeing the issue randomly while running my specs, but I'm able to consitently reproduce the error message by replacing the ENTRYPOINT with

cypress run --spec /cypress/e2e/my-spec.cy.js,

The --spec argument is determined dynamically in my pipeline, and it has always worked like this in cypress/included:8.3.1.
Adding a trailing comma confuses cypress somehow. It tells me it is starting to listen to the browser, then after some waiting I see this error, and after some more waiting the container crashes because of an outofmemory error.

DevTools listening on ws://127.0.0.1:36285/devtools/browser/bf1edf95-66bf-4c44-ae82-d789cb41ecbb
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.

<--- Last few GCs --->

[194:0x3f00001cc000]   160122 ms: Scavenge (reduce) 3941.4 (4091.7) -> 3941.0 (4091.7) MB, 14.68 / 0.00 ms  (average mu = 0.669, current mu = 0.408) task; 
[194:0x3f00001cc000]   160166 ms: Scavenge (reduce) 3941.7 (4091.7) -> 3941.4 (4091.7) MB, 32.82 / 0.00 ms  (average mu = 0.669, current mu = 0.408) allocation failure; 
[194:0x3f00001cc000]   160325 ms: Scavenge (reduce) 3942.1 (4091.7) -> 3941.8 (4091.7) MB, 147.72 / 0.00 ms  (average mu = 0.669, current mu = 0.408) allocation failure; 


<--- JS stacktrace --->

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
The Test Runner unexpectedly exited via a exit event with signal SIGABRT

denis-yuen added a commit to dockstore/dockstore-ui2 that referenced this issue Sep 5, 2024
@MikeMcC399
Copy link
Contributor Author

Issue is still occurring with Cypress 13.14.2 and Debian 12.7.

Last example https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images/2248/workflows/3e0039cf-477d-45e9-b8b8-6c0e0ff35ca5/jobs/68749 Sep 10, 2024 with Edge browser.

@theTestingApproach
Copy link

Do we have an update regarding this issue please? we are stuck at version 13.10.0..Thank you

@MikeMcC399
Copy link
Contributor Author

@theTestingApproach

Do we have an update regarding this issue please? we are stuck at version 13.10.0..Thank you

I haven't seen any feedback from the Cypress.io team so far.

https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images/2276/workflows/915912c6-727a-4e36-8ed3-04ae68e8abe8/jobs/69680 running with Cypress 13.15.0 shows the error message occurring without causing the test to fail. This is just a random selection of a test using the cypress/included Docker image on Firefox with Node v20.17.0.

image

If you are stuck at 13.10.0 it may not be due to this error message. You might want to try 13.15.0 and see if it works for you.

@can-angun
Copy link

Hello,

I am experiencing the same issue. After this error, the tests are being skipped, and the action is failing.

image

@MikeMcC399
Copy link
Contributor Author

MikeMcC399 commented Oct 8, 2024

@markrity
Copy link

We are experiencing the same issue with the following setup:

Cypress:        13.15.0                                                                        
Browser:        Chrome 130 (headless)                                                          
Node Version:   v20.18.0 (/usr/local/bin/node)             

Occasionally, some containers hang without any response. We're not certain if this is directly related to the error mentioned in this thread.

@OleksiiKachan
Copy link

after some long investigation we figured out that on our end this error message is not related to any hangs
In our case it was cypress cloud + circleci. we have autocancel on circleci jobs if they exceed timeout. so one of new tests was taking longer than that timeout. circleci kills the job which was causing cypress to keep hanging that test. fixing the test to be faster resolved our issue.

would still be great if cypress would handle ci cancellation more gracefully

@Maksym-Bov
Copy link

We have the same problems
Checked chromeWebSecurity true and false don't help

│ Cypress: 13.15.0 │
│ Browser: Chrome 129 (headless) │
│ Node Version: v20.18.0 (/usr/local/bin/node)

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Oct 29, 2024

I imagine this is an erroneous error, that is not impacting the runs and can be safely ignored. We'll try to look and see if our Electron upgrade in Cy 14 would fix this.

@MikeMcC399
Copy link
Contributor Author

Also here
Debian 12.8, CircleCI ubuntu-2204:2024.08.1, running tests on cypress/factory:5.1.0

┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress:        13.16.0                                                                        │
│ Browser:        Chrome 131 (headless)                                                          │
│ Node Version:   v22.11.0 (/usr/local/bin/node)                                                 │
│ 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:  2-advanced-examples/storage.cy.js                                             (15 of 20)


  Local Storage / Session Storage
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: XDG_RUNTIME_DIR is invalid or not set in the environment.

Too long with no output (exceeded 10m0s): context deadline exceeded

Coincidence or is the error message linked to the cause of failure?

@ryanthemanuel
Copy link
Collaborator

@MikeMcC399 do you have a link to the build? The times I've seen it, it's definitely been extraneous and hasn't really caused problems.

@MikeMcC399
Copy link
Contributor Author

MikeMcC399 commented Nov 21, 2024

@ryanthemanuel

The link is https://app.circleci.com/pipelines/github/cypress-io/cypress-docker-images/2342/workflows/0d0533e6-e547-4910-95e6-bc348c66a2ac/jobs/71800

... and if you happen to open up the CircleCI web UI, perhaps you could also rerun the failed jobs so that cypress/factory will get published? 🙂

@ryanthemanuel
Copy link
Collaborator

@MikeMcC399, I rebuilt and all went well this time around.

@MikeMcC399
Copy link
Contributor Author

@ryanthemanuel

I rebuilt and all went well this time around.

Excellent! Thank you very much! 🎉

@theTestingApproach
Copy link

theTestingApproach commented Nov 29, 2024

Hello, do we know when the fix for the message "error: XDG_RUNTIME_DIR is invalid or not set in the environment." will be released please?

Thank you

@MikeMcC399
Copy link
Contributor Author

@theTestingApproach

Hello, do we know when the fix for the message "error: XDG_RUNTIME_DIR is invalid or not set in the environment." will be released please?

Do you have a shareable example where this message always occurs?

The difficulty so far has been to reproduce the error. In the instances that I have seen, the issue is sporadic only. There hasn't been any root cause identified, and without a root cause there is no guarantee that the error message will stop, although there is some hope that it might go away with the future Cypress 14 release. (See also #29554 (comment) response from the Cypress.io team.)

As an example of the sporadic nature:

In the cypress-docker-images repo, the pipeline for test-image-medium-factory-test-factory-chrome:

then with no changes, re-running the workflow:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: error message
Projects
None yet
Development

No branches or pull requests