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

Error: could not find CRI target #6518

Closed
Snidhi-92 opened this issue Feb 20, 2020 · 16 comments · Fixed by #7368
Closed

Error: could not find CRI target #6518

Snidhi-92 opened this issue Feb 20, 2020 · 16 comments · Fixed by #7368

Comments

@Snidhi-92
Copy link

Snidhi-92 commented Feb 20, 2020

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

@jennifer-shehane
Copy link
Member

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

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Feb 24, 2020
@Snidhi-92
Copy link
Author

Snidhi-92 commented Feb 24, 2020

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)

@jennifer-shehane
Copy link
Member

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

@Snidhi-92
Copy link
Author

Same error again

image

@jennifer-shehane
Copy link
Member

@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

@mobileappd
Copy link

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

@jennifer-shehane
Copy link
Member

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

@Snidhi-92
Copy link
Author

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

@jennifer-shehane
Copy link
Member

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

flotwig added a commit that referenced this issue May 15, 2020
Moving this .catch statement to clean up errors, for example, the error that occurs in #6518 will now be wrapped by this.
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: work in progress There is an open PR for this issue [WIP] and removed stage: needs information Not enough info to reproduce the issue stage: needs review The PR code is done & tested, needs review labels May 15, 2020
@cypress-bot cypress-bot bot added stage: pending release There is a closed PR for this issue and removed stage: work in progress There is an open PR for this issue [WIP] labels May 15, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 15, 2020

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.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 20, 2020

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.

@cypress-bot cypress-bot bot removed the stage: pending release There is a closed PR for this issue label May 20, 2020
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 20, 2020
@cypress-io cypress-io unlocked this conversation May 22, 2020
@jennifer-shehane
Copy link
Member

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

@symon-skelly
Copy link

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.

@wasiqkhan786
Copy link

Its not fix either in release 4.6.0

@kawerewagaba
Copy link

kawerewagaba commented Oct 27, 2021

Still an issue in cypress ^8.7.0. It's in Chrome. Firefox works!

@frontendflorian
Copy link

I saw this issue in last 2 weeks twice with Cypress v9.7.0 and Firefox v101 in CI. Is this thread still up to date? Are there any other issues you can recommend for solving this issue? I already checked out #7450, but it seems to be mainly about Chrome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants