Cypress: Error: could not find CRI target

Created on 20 Feb 2020  ยท  14Comments  ยท  Source: cypress-io/cypress

Current behavior:

Error: could not find CRI target when running on chrome

Note : Tests run successfully in electron and firefox

Desired behavior:

Tests should run in Chome browser

Test code to reproduce

Run Integration/example tests using command

 node_modules\.bin\cypress run  --browser chrome
could not find CRI target
Error: could not find CRI target
    at lazyAssLogic (C:\Users\nidhi\AppData\Local\Cypress\Cache\4.0.2\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:110:14)
    at lazyAss (C:\Users\nidhi\AppData\Local\Cypress\Cache\4.0.2\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:115:28)
    at findStartPage (C:\Users\nidhi\AppData\Local\Cypress\Cache\4.0.2\Cypress\resources\app\packages\server\lib\browsers\protocol.js:55:3)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)

Versions


Cypress: 4.0.2
Browser: Chrome 80
Windows 10

chrome

Most helpful comment

This issue is occurring for me when I am running more than once spec file in chrome headless mode.

if I run the specs individually, the issue does not occur.

All 14 comments

Could you run Cypress in debug mode mode and print the entire set of logs here?

Specifically run:

set DEBUG=cypress:server:protocol
node_modules\.bin\cypress run  --browser chrome
PS C:\Users\nidhi\CypressWorkspace> set DEBUG=cypress:server:protocol
PS C:\Users\nidhi\CypressWorkspace> node_modules\.bin\cypress run  --browser chrome


====================================================================================================

  (Run Starting)

  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ Cypress:    4.0.2                                                                              โ”‚
  โ”‚ Browser:    Chrome 80                                                                          โ”‚
  โ”‚ Specs:      20 found (examples\actions.spec.js, examples\aliasing.spec.js, examples\assertions โ”‚
  โ”‚             .spec.js, examples\connectors.spec.js, examples\cookies.spec.js, examples\cypress_ โ”‚
  โ”‚             api.spec.js, examples\files.spec.js, examples\local_storage.spec.js, examples\loca โ”‚
  โ”‚             tion.spec.j...)                                                                    โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜


โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

  Running:  examples\actions.spec.js                                                       (1 of 20)
Failed to connect to Chrome, retrying in 1 second (attempt 18/32)
Failed to connect to Chrome, retrying in 1 second (attempt 19/32)
Failed to connect to Chrome, retrying in 1 second (attempt 20/32)
Failed to connect to Chrome, retrying in 1 second (attempt 21/32)
Failed to connect to Chrome, retrying in 1 second (attempt 22/32)
Failed to connect to Chrome, retrying in 1 second (attempt 23/32)
Failed to connect to Chrome, retrying in 1 second (attempt 24/32)
Failed to connect to Chrome, retrying in 1 second (attempt 25/32)
Failed to connect to Chrome, retrying in 1 second (attempt 26/32)
Failed to connect to Chrome, retrying in 1 second (attempt 27/32)
Failed to connect to Chrome, retrying in 1 second (attempt 28/32)
Failed to connect to Chrome, retrying in 1 second (attempt 29/32)
Failed to connect to Chrome, retrying in 1 second (attempt 30/32)
Failed to connect to Chrome, retrying in 1 second (attempt 31/32)
Failed to connect to Chrome, retrying in 1 second (attempt 32/32)
could not find CRI target
Error: could not find CRI target
    at lazyAssLogic (C:\Users\nidhi\AppData\Local\Cypress\Cache\4.0.2\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:110:14)
    at lazyAss (C:\Users\nidhi\AppData\Local\Cypress\Cache\4.0.2\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:115:28)
    at findStartPage (C:\Users\nidhi\AppData\Local\Cypress\Cache\4.0.2\Cypress\resources\app\packages\server\lib\browsers\protocol.js:55:3)
    at processTicksAndRejections (internal/process/task_queues.js:85:5)

Sorry, I don't see the logs I'm looking for here, it doesn't look like the DEBUG logs are taking effect. Can you actually try the below:

set DEBUG=cypress:*
node_modules\.bin\cypress run  --browser chrome

Same error again

image

@Snidhi-92 Yes, my previous comment and requests will not fix your issue.

The DEBUG logs just give us more information about your run to help fix your issue, but they are not being properly set so we are not seeing the logs. The logs should look something like below if they are set properly with new logs coming from cypress:cli etc:

Screen Shot 2020-02-26 at 3 53 57 PM

Im experiencing the same issues. See attached logs.
cyrpress_chrome_crash_logs.txt

Relevant logs from @mobileappd logs. Basically continues to log it's failure to connect over and over again until it gets to retryIndex: 19

  cypress:launcher launching browser { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.132', path: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', majorVersion: 80, isHeadless: false, isHeaded: true } to open about:blank +1s
  cypress:launcher spawning browser { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.132', path: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe', majorVersion: 80, isHeadless: false, isHeaded: true } 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 --proxy-server=http://localhost:51998 --proxy-bypass-list=<-loopback> --remote-debugging-port=52001 --remote-debugging-address=127.0.0.1 --load-extension=C:\Users\dmarle\AppData\Roaming\Cypress\cy\production\browsers\chrome-stable\run-17656\CypressExtension,C:\Users\dmarle\AppData\Local\Cypress\Cache\4.1.0\Cypress\resources\app\packages\extension\theme --user-data-dir=C:\Users\dmarle\AppData\Roaming\Cypress\cy\production\browsers\chrome-stable\run-17656 --disk-cache-dir=C:\Users\dmarle\AppData\Roaming\Cypress\cy\production\browsers\chrome-stable\run-17656\CypressCache +0ms
  cypress:server:browsers:chrome connecting to Chrome remote interface at random port 52001 +2ms

---

  cypress:server:protocol attempting to find CRI target... { retryIndex: 0 } +502ms
  cypress:server:protocol CRI.List { 
    host: '127.0.0.1', 
    port: 52001, 
    getDelayMsForRetry: [Function: getDelayMsForRetry] 
  } +0ms
  cypress:server:protocol CRI List { 
    numTargets: 0, 
    targets: [] 
  } +8ms
  cypress:server:protocol error finding CRI target, maybe retrying { 
    delay: 100, 
    err: Error: could not find CRI target at lazyAssLogic (C:\Users\dmarle\AppData\Local\Cypress\Cache\4.1.0\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:110:14) 
    at lazyAss (C:\Users\dmarle\AppData\Local\Cypress\Cache\4.1.0\Cypress\resources\app\packages\server\node_modules\lazy-ass\index.js:115:28) 
    at findStartPage (C:\Users\dmarle\AppData\Local\Cypress\Cache\4.1.0\Cypress\resources\app\packages\server\lib\browsers\protocol.js:55:3)     
    at processTicksAndRejections (internal/process/task_queues.js:85:5) 
  } +0ms

Then it starts to log this error over and over, while still throwing errs to connect to CRI target occasionally until it gets to retryIndex: 32, and then the delay on the retry is undefined at this point for some reason. cypress:server:protocol error finding CRI target, maybe retrying { delay: undefined,

  cypress:network:connect error getting address {
  hostname: 'mqitnybaa',
  port: 80,
  err: OperationalError: getaddrinfo ENOTFOUND mqitnybaa
      at GetAddrInfoReqWrap.onlookupall [as oncomplete] (dns.js:72:26)
   {
    cause: Error: getaddrinfo ENOTFOUND mqitnybaa
        at GetAddrInfoReqWrap.onlookupall [as oncomplete] (dns.js:72:26)
     {
      errno: 'ENOTFOUND',
      code: 'ENOTFOUND',
      syscall: 'getaddrinfo',
      hostname: 'mqitnybaa'
    },
    isOperational: true,
    errno: 'ENOTFOUND',
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'mqitnybaa'
  }
} +2s

Then a bunch of these errors:

cypress:network:connect received error on connect, retrying { iteration: 1, delay: 100, err: Error: connect ECANCELED 172.217.17.67:443     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECANCELED', code: 'ECANCELED', syscall: 'connect', address: '172.217.17.67', port: 443 } } +15ms

@jennifer-shehane Do we know what is the cause of this issue and how to resolve this?

No, we haven't been able to reproduce it reliably on our side.

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

Released in 4.6.0.

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

Just wanted to followup to see if this issue has been resolved for others here. We've seen a new report of the same issue in 4.6.0 and want to verify if the fix has worked or not for others. #7450

This issue is occurring for me when I am running more than once spec file in chrome headless mode.

if I run the specs individually, the issue does not occur.

Its not fix either in release 4.6.0

Was this page helpful?
0 / 5 - 0 ratings