-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 (Cypress 4.6.0) #7450
Comments
Oh, this is sad, we thought the increased timeout would help. Where are you running these tests when this typically happens? Locally? In a CI? Running Chrome 83 headless This happens at the very beginning of running the next spec (after the first spec has finished running), which is identical to #6518 We'll likely reopen that issue if others verify the fix did not work for them. |
Unfortunately both observed locally and in a CI environment |
For reference its more typically observed on running the second (or subsequent) specs. But has been observed on running the first spec on occasion. |
I have observed the same thing today. This started to occur after chrome update from 81 to 83. |
I also found the same error as @stevejefferies found |
We are also seeing this issue in CI. Chrome Version 83.0.4103.61 headless with Cypress 3.8.3 in Azure Devops Windows CMD agent. We also got same error with latest Cypress 4.6.0. In the meantime, we're using Electron 78 in CI - which is working. I do not have this issue locally on MacOSX Chrome Version 83.0.4103.61. |
This is happening in my github actions flow in a very inconsistent basis. Tried with the latest cypress version and also 3.8.3. Workflow:
package.json:
Also note it's running with Chrome 81 |
If it's happening with Chrome 83, this could be the cause: #7433 |
I also found the same error as @stevejefferies found I am facing this issue for both chrome and edge browser, It's working on cypress open UI but not able to run on the headless browser and not in CI environment also. Any update on this issue ? |
Since chrome 83 was installed we also have this issue.
|
Any update on this issue? We are also facing this issue on our local machines (win 10 - chrome 83.0.4103.61) when running headless. The workaround of @Diald to run on elektron is not an option for us. |
Experiencing this issue with Cypress 4.5.0 and HeadlessChrome 83.0.4103 (Windows 8.1.0.0). |
Experiencing this issue with Cypress 4.5.0 and headless Chrome 83.0.4103.61 (Windows 10) |
Experiencing this as well. Cypress 4.7.0 & headless chrome 83.0.4103.61 (Windows 10) |
Did some digging on this. This looks to be a Chrome issue in that the underlying issue observed (no targets returned from call to CDP.List in chrome remote interface) can be replicated outside of Cypress completely. e.g.: const CDP = require('chrome-remote-interface');
const { spawn } = require("child_process");
const port = 8004
const stable = "chrome.exe"
const chrome = spawn(stable, ['about:blank',
'--headless',
`--remote-debugging-port=${port}`,
'--remote-debugging-address=127.0.0.1'
]);
(function retryLoop(i) {
setTimeout(function() {
CDP.List({port: port}, (err, targets) => {
console.log(err)
if (!err) {
console.log(targets);
}
});
if (--i) retryLoop(i);
}, 3000)
})(10); results in an empty list - as you see when this fails in Cypress. Digging further, it appears to be down to the Chrome renderer child process crashing. There are numerous open tickets with the Chromium project which highlight this issue so its hard to determine the actual stability of this. But a few options I tried from the issues in the Chromium project do seem to have solved this from my limited local testing (Win 10 only):
Is there a reason why Cypress only sets |
@stevejefferies i am facing the same issue with edge browser as well . Do you think it’s same problem with all chromium related browsers ? |
Following this thread as it's affecting all my chrome headless tests with Cypress 4.7.0. |
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: 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;
}
});
} |
Experiencing the same problem on my Windows 10 laptop with Chrome 83 (headless) and Cypress 4.7.0. We haven't been seeing this issue in our CI, which runs Chrome 83 (headless) on Linux. The workaround mentioned above in #7450 (comment) (adding |
@stevejefferies Well, the original code/issue to add I'm not sure It would be ideal if we could track down what Chromium bug this is. |
We just ran into this problem in our CI, which runs on Linux and specifies the
|
I have update cypress to 4.6.0 but still facing the issue. Everytime on different test.please solve it . |
Any updates on this issue? I have been seeing it intermittently over the last few weeks, using Chrome 83 and cypress 4.12.1
|
@nids2307 try below code in Plugins/index.js its working module.exports = (on, config) => {
on('before:browser:launch', (browser, launchOptions) => {
if (browser.name === 'chrome' && browser.isHeadless) {
launchOptions.args.push('--disable-gpu');
return launchOptions
}
});
} |
Thank you Wasiq! |
@wasiqkhan786 : I have been seeing the same error again despite of adding the code you advised me to add. I am using Cypress 5.0.0 now. |
@nids2307 please try with cypress version 4.12.1 |
Does anyone know if there is a workaround available for versions higher than 4.12.1. I have made quite a few changes when I upgraded the version to 5.0.0. |
I still have the issue |
Experiencing this as well. Cypress 4.12.1 & Chrome 86. I see that the version of Chrome is newly upgraded. Could that be the problem? Cypress failed to make a connection to the Chrome DevTools Protocol after retrying for 50 seconds. |
The code for this is done in cypress-io/cypress#14348, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
cypress run
fails with the following error on Chrome:Full log is also attached.
Note that this doesn't appear to be 100% consistent. With the below example I am seeing this maybe 25% of the time.
We had previously observed this before, and upgraded to both 3.8.3 as a result of: #6053
Then more recently, upgraded to 4.6.0 as a result of: #6518
Still observing on 4.6.0 as below though
Desired behavior:
Execution should not fail in this manner.
Test code to reproduce
cypress:run
as defined in package.json e.g.npm run cypress:run
Versions
Cypress: 4.6.0
Browser: Chrome 83
OS: Windows 10
Debug Log
debug_log.txt
The text was updated successfully, but these errors were encountered: