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

Cypress run won’t finish, stuck while making connection to Chrome #6540

Closed
filiphric opened this issue Feb 24, 2020 · 42 comments · Fixed by #14348
Closed

Cypress run won’t finish, stuck while making connection to Chrome #6540

filiphric opened this issue Feb 24, 2020 · 42 comments · Fixed by #14348

Comments

@filiphric
Copy link

Current behavior:

I’m getting error: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying during my tests. Usually happens during one of last tests (probably the last). I have multiple Cypress projects, happens on all of them. Tests are running in parallel, on Chrome.

Test code to reproduce

Issue happens quite randomly, I’m sorry, but I cannot really give a reproducible example, since this happens in CI only. Sending screenshots.

Snímka obrazovky 2020-02-24 o 9 24 54

Snímka obrazovky 2020-02-24 o 9 24 46

Versions

Cypress 4.0.2
CI: Bitbucket Pipelines
Image: cypress/browsers:node13.6.0-chrome80-ff72

@jennifer-shehane
Copy link
Member

Oof, yeah, these are difficult to track down.

@flotwig will cases like this get any benefit from #6532 or is this a whole new case again?

@bsodmike
Copy link

@filiphric Can you also try running with DEBUG=cypress:*? Thanks!

@filiphric
Copy link
Author

Here it is:

 Running:  polls/survey.js                                                               (38 of 43)
  Estimated: 11 seconds
  cypress:server:run about to run spec { spec: { name: 'polls/survey.js', relative: 'tests/polls/survey.js', absolute: '/opt/atlassian/pipelines/agent/build/regression-wall/tests/polls/survey.js' }, isHeadless: true, browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.87', path: 'google-chrome', majorVersion: 80, isHeadless: true, isHeaded: false } } +273ms
  cypress:server:run video recording has been enabled. video: true +0ms
  cypress:server:video capture started { command: 'ffmpeg -n 20 /root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/@ffmpeg-installer/linux-x64/ffmpeg -f image2pipe -use_wallclock_as_timestamps 1 -i pipe:0 -y -vcodec libx264 -preset ultrafast /opt/atlassian/pipelines/agent/build/regression-wall/videos/polls/survey.js.mp4' } +296ms
  cypress:server:run waiting for socket to connect and browser to launch... +23ms
  cypress:server:run waiting for socket connection... { id: 'vq2u9' } +0ms
  cypress:server:run setting Chrome properties { shouldWriteVideo: true } +1ms
  cypress:server:open_project resetting project state, preparing to launch browser +30s
  cypress:server:project resetting project instance /opt/atlassian/pipelines/agent/build/regression-wall +1s
  cypress:proxy:http:util:buffers resetting buffers +6s
  cypress:server:server Setting remoteAuth undefined +3s
  cypress:network:cors Parsed URL { port: '443', tld: 'com', domain: 'slido-staging' } +4s
  cypress:server:server Setting remoteOrigin https://sli.do +0ms
  cypress:server:server Setting remoteHostAndPort { port: '443', tld: 'com', domain: 'slido-staging' } +0ms
  cypress:server:server Setting remoteDocDomain sli.do +0ms
  cypress:server:server Getting remote state: { auth: undefined, props: { port: '443', tld: 'com', domain: 'slido-staging' }, origin: 'https://sli.do', strategy: 'http', visiting: false, domainName: 'sli.do', fileServer: null } +0ms
  cypress:server:open_project launching browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.87', path: 'google-chrome', majorVersion: 80, isHeadless: true, isHeaded: false }, spec: tests/polls/survey.js +1ms
  cypress:server:browsers getBrowserLauncher { browser: { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.87', path: 'google-chrome', majorVersion: 80, isHeadless: true, isHeaded: false } } +427ms
  cypress:server:browsers opening browser { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.87', path: 'google-chrome', majorVersion: 80, isHeadless: true, isHeaded: false } +0ms
  cypress:server:browsers:chrome reading chrome preferences... { userDir: '/root/.config/Cypress/cy/production/browsers/chrome-stable/run-192', CHROME_PREFERENCE_PATHS: { default: 'Default/Preferences', defaultSecure: 'Default/Secure Preferences', localState: 'Local State' } } +446ms
  cypress:server:video capture stderr log { message: 'ffmpeg version N-47683-g0e8eb07980-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2018 the FFmpeg developers' } +3ms
  cypress:server:video capture stderr log { message: '  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516' } +0ms
  cypress:server:video capture stderr log { message: '  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg' } +0ms
  cypress:server:video capture stderr log { message: '  libavutil      56. 24.101 / 56. 24.101' } +0ms
  cypress:server:video capture stderr log { message: '  libavcodec     58. 42.100 / 58. 42.100' } +0ms
  cypress:server:video capture stderr log { message: '  libavformat    58. 24.100 / 58. 24.100' } +0ms
  cypress:server:video capture stderr log { message: '  libavdevice    58.  6.101 / 58.  6.101' } +0ms
  cypress:server:video capture stderr log { message: '  libavfilter     7. 46.101 /  7. 46.101' } +0ms
  cypress:server:video capture stderr log { message: '  libswscale      5.  4.100 /  5.  4.100' } +0ms
  cypress:server:video capture stderr log { message: '  libswresample   3.  4.100 /  3.  4.100' } +0ms
  cypress:server:video capture stderr log { message: '  libpostproc    55.  4.100 / 55.  4.100' } +0ms
  cypress:server:plugins plugin event registered? { event: 'before:browser:launch', isRegistered: false } +29s
  cypress:server:browsers:chrome chrome is running headlessly, not installing extension +5ms
  cypress:server:appdata path: /root/.config/Cypress/cy/production/extensions +29s
  cypress:server:browsers:chrome launching in chrome with debugging port {
  url: 'https://sli.do/__/#/tests/integration/polls/survey.js',
   args: [
    '--test-type',
    '--ignore-certificate-errors',
    '--start-maximized',
    '--silent-debugger-extension-api',
    '--no-default-browser-check',
    '--no-first-run',
    '--noerrdialogs',
    '--enable-fixed-layout',
    '--disable-popup-blocking',
    '--disable-password-generation',
    '--disable-save-password-bubble',
    '--disable-single-click-autofill',
    '--disable-prompt-on-repos',
    '--disable-background-timer-throttling',
    '--disable-renderer-backgrounding',
    '--disable-renderer-throttling',
    '--disable-restore-session-state',
    '--disable-translate',
    '--disable-new-profile-management',
    '--disable-new-avatar-menu',
    '--allow-insecure-localhost',
    '--reduce-security-for-testing',
    '--enable-automation',
    '--disable-device-discovery-notifications',
    '--disable-infobars',
    '--autoplay-policy=no-user-gesture-required',
    '--disable-site-isolation-trials',
    '--metrics-recording-only',
    '--disable-prompt-on-repost',
    '--disable-hang-monitor',
    '--disable-sync',
    '--disable-web-resources',
    '--safebrowsing-disable-auto-update',
    '--safebrowsing-disable-download-protection',
    '--disable-client-side-phishing-detection',
    '--disable-component-update',
    '--disable-default-apps',
    '--use-fake-ui-for-media-stream',
    '--use-fake-device-for-media-stream',
    '--disable-ipc-flooding-protection',
    '--disable-backgrounding-occluded-window',
    '--disable-breakpad',
    '--password-store=basic',
    '--use-mock-keychain',
    '--disable-gpu',
    '--no-sandbox',
    '--proxy-server=http://localhost:34615',
    '--proxy-bypass-list=<-loopback>',
    '--headless',
    '--remote-debugging-port=39999',
    '--remote-debugging-address=127.0.0.1',
    '--user-data-dir=/root/.config/Cypress/cy/production/browsers/chrome-stable/run-192',
    '--disk-cache-dir=/root/.config/Cypress/cy/production/browsers/chrome-stable/run-192/CypressCache'
  ],
  port: 39999
} +0ms
cypress:launcher launching browser { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.87', path: 'google-chrome', majorVersion: 80, isHeadless: true, isHeaded: false } to open about:blank +30s
  cypress:launcher spawning browser { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.87', path: 'google-chrome', majorVersion: 80, isHeadless: true, isHeaded: false } with args about:blank --test-type --ignore-certificate-errors --start-maximized --silent-debugger-extension-api --no-default-browser-check --no-first-run --noerrdialogs --enable-fixed-layout --disable-popup-blocking --disable-password-generation --disable-save-password-bubble --disable-single-click-autofill --disable-prompt-on-repos --disable-background-timer-throttling --disable-renderer-backgrounding --disable-renderer-throttling --disable-restore-session-state --disable-translate --disable-new-profile-management --disable-new-avatar-menu --allow-insecure-localhost --reduce-security-for-testing --enable-automation --disable-device-discovery-notifications --disable-infobars --autoplay-policy=no-user-gesture-required --disable-site-isolation-trials --metrics-recording-only --disable-prompt-on-repost --disable-hang-monitor --disable-sync --disable-web-resources --safebrowsing-disable-auto-update --safebrowsing-disable-download-protection --disable-client-side-phishing-detection --disable-component-update --disable-default-apps --use-fake-ui-for-media-stream --use-fake-device-for-media-stream --disable-ipc-flooding-protection --disable-backgrounding-occluded-window --disable-breakpad --password-store=basic --use-mock-keychain --disable-gpu --no-sandbox --proxy-server=http://localhost:34615 --proxy-bypass-list=<-loopback> --headless --remote-debugging-port=39999 --remote-debugging-address=127.0.0.1 --user-data-dir=/root/.config/Cypress/cy/production/browsers/chrome-stable/run-192 --disk-cache-dir=/root/.config/Cypress/cy/production/browsers/chrome-stable/run-192/CypressCache +0ms
  cypress:server:browsers:chrome connecting to Chrome remote interface at random port 39999 +21ms
  cypress:server:protocol Getting WS connection to CRI on port 39999 +30s
  cypress:network:connect received error on connect, retrying { iteration: 0, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +4s
  cypress:network:connect received error on connect, retrying { iteration: 1, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +102ms
  cypress:network:connect received error on connect, retrying { iteration: 2, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +102ms
  cypress:network:connect received error on connect, retrying { iteration: 3, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +101ms
  cypress:network:connect received error on connect, retrying { iteration: 4, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +101ms
  cypress:network:connect received error on connect, retrying { iteration: 5, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +102ms
  cypress:network:connect received error on connect, retrying { iteration: 6, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +103ms
  cypress:network:connect received error on connect, retrying { iteration: 7, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +106ms
  cypress:network:connect received error on connect, retrying { iteration: 8, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +101ms
  cypress:network:connect received error on connect, retrying { iteration: 9, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +103ms
  cypress:network:connect received error on connect, retrying { iteration: 10, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +101ms
  cypress:network:connect received error on connect, retrying { iteration: 11, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +501ms
  cypress:network:connect received error on connect, retrying { iteration: 12, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +501ms
  cypress:network:connect received error on connect, retrying { iteration: 13, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +501ms
  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    │     'cypress'     │      1       │      '192'      │   15.32    │      8.16      │  357.09  │    323.73    │   385.18    │
  cypress:server:util:process_profiler │    1    │ 'electron-shared' │      3       │ '204, 362, 387' │     0      │      0.06      │  140.2   │    143.83    │    340.4    │
  cypress:server:util:process_profiler │    2    │     'plugin'      │      1       │      '442'      │     0      │       0        │  73.74   │    73.76     │    74.75    │
  cypress:server:util:process_profiler │    3    │     'ffmpeg'      │      1       │     '1901'      │     0      │      2.2       │  13.13   │     54.7     │   176.23    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │  '1926, 1927'   │     0      │      0.1       │   3.32   │     6.49     │    86.53    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      8       │       '-'       │   15.32    │     19.74      │  587.48  │   1125.07    │   1475.57   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴─────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
  cypress:network:connect received error on connect, retrying { iteration: 14, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +501ms
  cypress:network:connect received error on connect, retrying { iteration: 15, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +501ms
  cypress:network:connect received error on connect, retrying { iteration: 16, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +502ms
  cypress:network:connect received error on connect, retrying { iteration: 17, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +502ms
Failed to connect to Chrome, retrying in 1 second (attempt 18/32)
  cypress:network:connect received error on connect, retrying { iteration: 18, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +503ms
Failed to connect to Chrome, retrying in 1 second (attempt 19/32)
  cypress:network:connect received error on connect, retrying { iteration: 19, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 20/32)
  cypress:network:connect received error on connect, retrying { iteration: 20, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 21/32)
  cypress:network:connect received error on connect, retrying { iteration: 21, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 22/32)
  cypress:network:connect received error on connect, retrying { iteration: 22, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 23/32)
cypress:network:connect received error on connect, retrying { iteration: 23, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
  cypress:network:connect received error on connect, retrying { iteration: 24, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 24/32)
Failed to connect to Chrome, retrying in 1 second (attempt 25/32)
  cypress:network:connect received error on connect, retrying { iteration: 25, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 26/32)
  cypress:network:connect received error on connect, retrying { iteration: 26, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
  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    │     'cypress'     │      1       │      '192'      │    0.2     │      7.88      │  356.4   │    324.89    │   385.18    │
  cypress:server:util:process_profiler │    1    │ 'electron-shared' │      3       │ '204, 362, 387' │     0      │      0.06      │  140.2   │    143.71    │    340.4    │
  cypress:server:util:process_profiler │    2    │     'plugin'      │      1       │      '442'      │     0      │       0        │  73.74   │    73.76     │    74.75    │
  cypress:server:util:process_profiler │    3    │     'ffmpeg'      │      1       │     '1901'      │     0      │      2.12      │  13.13   │    53.16     │   176.23    │
  cypress:server:util:process_profiler │    4    │      'other'      │      2       │  '1979, 1980'   │     0      │      0.1       │   3.47   │     6.38     │    86.53    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      8       │       '-'       │    0.2     │     19.04      │  586.94  │   1105.85    │   1475.57   │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴─────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +10s
Failed to connect to Chrome, retrying in 1 second (attempt 27/32)
  cypress:network:connect received error on connect, retrying { iteration: 27, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 28/32)
  cypress:network:connect received error on connect, retrying { iteration: 28, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 29/32)
  cypress:network:connect received error on connect, retrying { iteration: 29, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 30/32)
  cypress:network:connect received error on connect, retrying { iteration: 30, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 31/32)
  cypress:network:connect received error on connect, retrying { iteration: 31, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
Failed to connect to Chrome, retrying in 1 second (attempt 32/32)
  cypress:network:connect received error on connect, retrying { iteration: 32, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
  cypress:network:connect retries exhausted, bubbling up error { iteration: 33, err: Error: connect ECONNREFUSED 127.0.0.1:39999     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 39999 } } +1s
  cypress:server:protocol failed to connect to CDP { connectOpts: { host: '127.0.0.1', port: 39999, getDelayMsForRetry: [Function: getDelayMsForRetry] }, err: Error: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds. This usually indicates there was a problem opening the Chrome browser. The CDP port requested was 39999. Error details: Error: connect ECONNREFUSED 127.0.0.1:39999 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) at get (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/lib/errors.js:344:11) at Object.throwErr [as throw] (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/lib/errors.js:359:11) at /root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/lib/browsers/protocol.js:95:17 at tryCatcher (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18) at _drainQueueStep (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues [as _onImmediate] (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)     at processImmediate (internal/timers.js:439:21) { isCypressErr: true, type: 'CDP_COULD_NOT_CONNECT', details: undefined } } +20s
  cypress:server:cypress exiting with err Error: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.
This usually indicates there was a problem opening the Chrome browser.
The CDP port requested was 39999.
Error details:
Error: connect ECONNREFUSED 127.0.0.1:39999
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

    at get (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/lib/errors.js:344:11)
    at Object.throwErr [as throw] (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/lib/errors.js:359:11)
    at /root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/lib/browsers/protocol.js:95:17
    at tryCatcher (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/root/.cache/Cypress/4.0.2/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:439:21)
 {
  isCypressErr: true,
  type: 'CDP_COULD_NOT_CONNECT',
  details: undefined
} +5m
Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.
This usually indicates there was a problem opening the Chrome browser.
The CDP port requested was 39999.
Error details:
Error: connect ECONNREFUSED 127.0.0.1:39999
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)
  cypress:server:cypress calling exit 1 +1ms
  cypress:server:cypress about to exit with code 1 +0ms
2020-02-24T19:00:53.240Z cypress:cli child event fired { event: 'exit', code: 1, signal: null }
2020-02-24T19:00:53.240Z cypress:cli child event fired { event: 'close', code: 1, signal: null }
2020-02-24T19:00:53.240Z cypress:cli Stopping Xvfb
[percy] stopping percy...
[percy] waiting for 0 snapshots to complete...
[percy] done.

@adomyaty55foundry
Copy link

adomyaty55foundry commented Mar 4, 2020

@jennifer-shehane

Reporting in, I'm running into the same issue. using WSL 2 on Windows

`Title: Error launching browser

Message: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was 36647.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:36647
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

Stack trace:

Error: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was �[33m36647�[39m.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:36647
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14)

    at get (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/lib/errors.js:344:11)
    at Object.throwErr [as throw] (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/lib/errors.js:359:11)
    at /home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/lib/browsers/protocol.js:95:17
    at tryCatcher (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/adomyaty/.cache/Cypress/4.1.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:439:21)

Let me know if DEBUG is needed as well and I can provide. FYI this problem only happens when running chrome. Headless works fine. I had this problem since Cypress 3.8 or so after upgrading to 4.1 issue still persists. It working before 3.8 as far as I recall

@limonte
Copy link

limonte commented Mar 6, 2020

This issue is the follow-up for #6053 and its fix #6133 (cc @bahmutov)

happened for me as well, here's the build: https://github.com/sweetalert2/sweetalert2/commit/7d31830a6f7a9757e6a9efff56087f8501cd0e84/checks?check_suite_id=504036788

@filiphric

This comment has been minimized.

@tipsey
Copy link

tipsey commented Mar 23, 2020

Ubuntu 19, Chromium, Version 80.0.3987.149 (Official Build) snap (64-bit)
-hosts file is only 127.0.0.1 #commented out everything else
Title: Error launching browser

Message: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was 36771.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:36771
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14)

Stack trace:

Error: Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 20 seconds.

This usually indicates there was a problem opening the Chrome browser.

The CDP port requested was �[33m36771�[39m.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:36771
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14)

    at get (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/lib/errors.js:348:11)
    at Object.throwErr [as throw] (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/lib/errors.js:363:11)
    at /home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/lib/browsers/protocol.js:95:17
    at tryCatcher (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/sqa/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:439:21)

@noor-tg
Copy link

noor-tg commented Mar 29, 2020

@tipsey same config . how to fix it ?

@tipsey

This comment has been minimized.

@tipsey
Copy link

tipsey commented Mar 29, 2020

@tipsey same config . how to fix it ?

I think the problem on Ubuntu 19 is Chromium is installed via SNAP process. Cypress works on Electron and Firefox(Beta) but I don't want to try a Deb install on Ubuntu because it may break future Chromium releases. I found a Link to do this but don't want to toast my Ubunut: https://shevchuk.co/notes/2019/12/13/install-chromium-on-ubuntu-1910-from-debian-instead-of-snap

@lonewarrior556
Copy link

lonewarrior556 commented Apr 8, 2020

I have the same problem when I do cypress open

:~$ lsb_release -d
Description:	Ubuntu 18.04.3 LTS

:~$ chromium --version
Chromium 80.0.3987.163 snap

:~$ which chromium
/snap/bin/chromium

what's interesting is the tests run fine doing cypress run --headed

@cypress-bot cypress-bot bot added the stage: needs investigating Someone from Cypress needs to look at this label Apr 10, 2020
@leorigon

This comment has been minimized.

@79it
Copy link

79it commented Apr 20, 2020

I've had this problem with Chrome too and after a bit of investigation I'm wondering if it has something to do with a change in Chrome itself. I've had this or similar issues definitely on Chrome 80 and 81 and different versions of Cypress with the latest 4.4.1 still an issue.

When Cypress opens Chrome it does so with a large number of parameters. One of those parameters is proxy-bypass-list

Using a simplified version, when Chrome is opened like this it fails:
chrome.exe "about:blank" --enable-automation --safebrowsing-disable-auto-update --test-type --proxy-bypass-list=<-loopback>

However, if the loopback value is quoted then Chrome starts quite happily:
chrome.exe "about:blank" --enable-automation --safebrowsing-disable-auto-update --test-type --proxy-bypass-list="<-loopback>"

Is there a simple workaround by setting the proxy bypass list?

@leorigon
Copy link

leorigon commented Apr 22, 2020

I tested the 4.2.0 version and the error does not occur anymore. So, like @79it said, I think that problem is related to Chrome.

Editing, the error happened again in the old Cypress version. :(

@jennifer-shehane
Copy link
Member

jennifer-shehane commented May 6, 2020

@79it You can modify the launch args sent to Chrome by following the instructions here: https://on.cypress.io/browser-launch-api#Modify-browser-launch-arguments

I've reviewed the comments/logs here and have not found many commonalities between the environments across people reporting this problem. A couple of things that are common:

  1. All running in Chrome headless
  2. Reported in Cypress versions 4+
  3. Error appears after running a large number of spec files?

I haven't fully verified the 3rd assertion, but from the few logs provided, they all indicated that the error occurred after a large number of spec files ran (38+).

Some questions:

Please if you can answer the questions below if you're experiencing this issue.

  • How many spec files run on a single machine until this error occurs?
  • How much time does cypress run on the single machine until this error occurs?
  • Has anyone ever seen this error on the first specfile launch?

I guess my theory is that this may be related to longer runs or runs that connect to the CDP several times over several spec files.

Also, tracking these debug logs specifically may be helpful in seeing if any leftover processes haven't existed properly. DEBUG=cypress:*,cypress-verbose:server:util:process_profiler

@filiphric
Copy link
Author

Hey @jennifer-shehane thank you for taking a look into it. I have been experiencing this lot less recently, but I can’t put my finger down on what might have caused this.

to answer your questions:

  • yes, our runs usually have around 15 specs on each machine, 10 machines in total
  • each machine runs for about 8 to 10 minutes
  • no, I haven’t seen this on first spec ever. it was always on the last test of very last spec on very last machine

I’ll make sure to run with a debug if it might happen in close future

@tipsey
Copy link

tipsey commented May 7, 2020

@tipsey same config . how to fix it ?

@tipsey same config . how to fix it ?

Okay it's working now with Cyoress 4.5.0 and Chromium 81.0.4044.138. Just running the spec files that came with a typical Cypress Install.

@haikyuu
Copy link

haikyuu commented May 14, 2020

I have found a workaround that worked in my Mac.

I run cypress through the API:

const cypress = require("cypress");
const path = require("path");
const configFile = path.resolve("cypress.json");
cypress.open({ configFile });

@simisimon
Copy link

I face a similar issue running my tests in browser edge 83. It is hard to reproduce the issue, since it happens quite randomly. Like mentioned above, usually one of the last tests fails. When I'm running my tests in egde in mode headed, all tests running fine.

Current Setup:

  • Windows 10
  • Cypress Version 4.7.0
  • Browser Edge 83

I'm running my tests local with the command: npx cypress run --browser edge --headless

I get the following error:
Error_Msg

Browser launch arguments:

Browser_Args

@simisimon
Copy link

simisimon commented Jun 9, 2020

I assume that this problem is a copy of #7450. I solved my problem by adding the following workaround provided by @stevejefferies.

Should have added to my comment above, for those looking for a potential workaround adding the disable-gpu flag on browser launch (plugins/index.js) seems stable for me at least locally:
Cypress 4+:

module.exports = (on, config) => {
  on('before:browser:launch', (browser, launchOptions) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      launchOptions.args.push('--disable-gpu');
      return launchOptions
    }
  });
}

Or before Cypress 4:

module.exports = (on, config) => {
  on('before:browser:launch', (browser, args) => {
    if (browser.name === 'chrome' && browser.isHeadless) {
      args.push(
        '--disable-gpu'
      );
      return args;
    }
  });
}

To run all test in edge without problems, you have to extend the if condition by adding the following:

browser.name === 'edge'

Now, tests are running fine in chrome as well as in egde using headless mode.

@Raven808
Copy link

Raven808 commented Jun 9, 2020

@simisimon that fixed worked for me. Thank you! :)

@juliusortiz
Copy link

@simisimon that fixed worked for me. Thank you! :)

Me too! Thanks! :D

@mikila85
Copy link

@simisimon !!! now we can finally run in chrome! every test file now runs 10-20 seconds faster THX 👍 🥇

@paulbrittain
Copy link

@simisimon That doesn't work for me, unfortunately

@d0utone
Copy link

d0utone commented Sep 1, 2020

I was missing the line

127.0.0.1 localhost
in my /etc/hosts file. Afterwards it worked perfectly!

@stephenfairchild
Copy link

I was missing the line

127.0.0.1 localhost
in my /etc/hosts file. Afterwards it worked perfectly!

This was the fix for me! Thank you!

@bahmutov
Copy link
Contributor

bahmutov commented Sep 3, 2020

@flotwig why would 127.0.0.1 localhost be important for some situations?

@xialonglee
Copy link

I was missing the line

127.0.0.1 localhost
in my /etc/hosts file. Afterwards it worked perfectly!

this solve my problem too, very much Thanks to you!

@flotwig
Copy link
Contributor

flotwig commented Sep 29, 2020

why would 127.0.0.1 localhost be important for some situations?

@bahmutov not sure, as of 3.8.1 we explicitly connect to 127.0.0.1 to avoid this exact situation:

const connectOpts = {
host: '127.0.0.1',
port,
getDelayMsForRetry: (i) => {
retryIndex = i
return _getDelayMsForRetry(i)
},
}

@ConstantineSF
Copy link

ConstantineSF commented Oct 5, 2020

@flotwig @bahmutov
hi, I'm starting to facing this issue again while execute with "-b chrome --headless"
previously, that fix worked for me :

module.exports = (on, config) => {
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--disable-gpu');
return launchOptions
}
});
}

now I'm getting the same error

"Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.
This usually indicates there was a problem opening the Chrome browser.
The CDP port requested was 52419.
Error details: Error: could not find CRI target"

also added 127.0.0.1 localhost - not helped(also tried to add my test domains to localhost file)

@DogaruRaluca
Copy link

CYPRESS NOT BEING ABLE TO CONNECT TO CHROME 86

Hi, I am facing the same issue of Cypress not being able to connect to Chrome. If I try to run my tests using Firefox Beta or Electron, it works. What's the problem with Chrome?

I have added the following code, but the problem persists. I mention the fact that everything worked fine until yesterday.
module.exports = (on, config) => {
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--disable-gpu');
return launchOptions
}
});
}

@krapstuke
Copy link

Same with me.. tests doesn't not start to run on Windows 10, Chrome Version 86.0.4240.183 (Official Build) (64-bit). With Firefox everything works

@denispalii
Copy link

Hi,
any news on this, please?

@DogaruRaluca
Copy link

Well, for me it just started to work magically without changing anything. During the period of time when cypress was not working with Chrome I have used Brave and everything was fine.

@krapstuke
Copy link

krapstuke commented Dec 4, 2020 via email

@olivierleblancg
Copy link

Hi,

Any news on this issue?

Previously this fix seemed to fix the issue for us but it stopped working again.
module.exports = (on, config) => {
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--disable-gpu');
return launchOptions
}
});
}

We keep getting this error:
"Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds.
This usually indicates there was a problem opening the Chrome browser.
The CDP port requested was 58032.
Error details:
Error: could not find CRI target"

@pav-elis
Copy link

Also facing the same problem and at this point I have a question: as long as this happens on headless chrome, and in fact CI/CD pipelines usually use headless chrome runs, could they also fail due to this error?
P.S.: we are using CircleCI, maybe that helps answering my question.

@cypress-bot cypress-bot bot added stage: work in progress and removed stage: needs investigating Someone from Cypress needs to look at this labels Dec 29, 2020
@danmoez
Copy link

danmoez commented Dec 30, 2020

Facing the same - upgrading to using the 6.2.0 image seemed to fix the issue temporarily but facing the issue again.

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress and removed stage: work in progress stage: needs review The PR code is done & tested, needs review labels Jan 11, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 19, 2021

The code for this is done in cypress-io/cypress#14348, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jan 20, 2021

Released in 6.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v6.3.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jan 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.