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 failed to make a connection to the Chrome DevTools Protocol #19122

Closed
Svetlana0107 opened this issue Nov 26, 2021 · 16 comments
Closed

Cypress failed to make a connection to the Chrome DevTools Protocol #19122

Svetlana0107 opened this issue Nov 26, 2021 · 16 comments

Comments

@Svetlana0107
Copy link

Svetlana0107 commented Nov 26, 2021

Current behavior

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 56204.

Error details:

Error: connect ECONNREFUSED 127.0.0.1:56204 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)

Stack trace

Desired behavior

connect without any issues

Test code to reproduce

demo codes from examples

Cypress Version

9.1.0

Other

No response

@rcauquil
Copy link

rcauquil commented Dec 8, 2021

I have the same issue for both firefox and chromium.

Cypress Version

9.1.1

@PolinaLyzenkova
Copy link

same for me

@rcauquil
Copy link

@PolinaLyzenkova I solved it this morning, for me it was a typo inside my /etc/hosts
and for another guy I found on a blog post he was missing 127.0.0.1 localhost
let me know how it goes for you

@matiaso
Copy link

matiaso commented Dec 15, 2021

I had the same issue and I solved it by changing the /etc/nsswitch.conf file on linux to make sure that the files were prioritized over DNS:

hosts: files dns

To check, you can ping localhost and make sure it resolve to 127.0.0.1

In my case, the router's DNS was resolving localhost to 127.0.0.2 which is also a local address, but doesn't work.

@onthespotqa
Copy link

@Svetlana0107 did this happen for you locally or in ci? i've been having this issue a lot in ci. i'm on version 9.5.3 now.

@Svetlana0107
Copy link
Author

@Svetlana0107 did this happen for you locally or in ci? i've been having this issue a lot in ci. i'm on version 9.5.3 now.

@onthespotqa it’s reproduced locally in my case

@sarthak-verma-bcg
Copy link

@Svetlana0107 Any update on this issue? Facing the same issue

@mauro-mendaro-lmnd
Copy link

Having the same on my side, any updates on the issue?

@MikeMcC399
Copy link
Contributor

@Svetlana0107

The original issue here referred to

Test code to reproduce
demo codes from examples

Are you still seeing this issue? Which examples are you referring to? Could you provide a URL?

@MikeMcC399
Copy link
Contributor

@mauro-mendaro-lmnd

Having the same on my side, any updates on the issue?

Which version of Cypress are you using? This issue refers to an old version 9.1.0.

Are you also using examples provided by Cypress? If not do you have a public repo where you can show the problem?

@nagash77
Copy link
Contributor

Looking over this thread I don't see any details about which examples folks are referring to. This ticket is also for a quite old version of Cypress. As such I am going to close this issue. If anyone in this thread is still experiencing this issue on the latest versions of Cypress please open a new ticket and we will be happy to investigate.

@nagash77 nagash77 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2023
@lucasbatier
Copy link

lucasbatier commented Sep 20, 2023

Hi there, the same issues happened today for me on my GitHub action CI. Can you help me on that ?

Cypress version 12.7.0

Here is the workflow file :

name: On Approved PR Cypress Tests

on:
    pull_request_review:
        types: [submitted]

jobs:
    cypress-run:
        if: github.event.review.state == 'approved'
        runs-on: ubuntu-latest
        steps:
            - name: Checkout
              uses: actions/checkout@v3

            - name: Cypress run
              uses: cypress-io/github-action@v4
              env:
                  CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
              with:
                  config: "viewportWidth=${{ matrix.viewport[0] }},viewportHeight=${{ matrix.viewport[1] }}"
                  browser: ${{ matrix.browser }}
                  group: ${{ matrix.browser }}-${{ matrix.viewport[0] }}x${{ matrix.viewport[1] }}
                  build: yarn run build
                  start: yarn start_dev
                  wait-on: "http://localhost:3000"
                  wait-on-timeout: 300
                  record: true
                  parallel: true
        strategy:
            matrix:
                browser: [chrome]
                viewport: [[1920, 1080], [375, 667]]
                include:
                    - browser: chrome
                    - viewport: [1920, 1080]

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Sep 20, 2023

@MikeMcC399
Copy link
Contributor

@lucasbatier

If you see runner-image Version: 20230917.1.0 in your log file, then this image includes Chrome 117 which has a bug that causes Cypress < 12.15.0 to fail.

If possible, update to cypress@^12.15.0 or later.

image

@ssteezens
Copy link

Just commenting in case it helps anyone else. This issue would randomly happen to us (using cypress v13.3.3) in our azure devops pipeline jobs but only when using the windows-2019 image. We have our tests split up to run in 20 different parallel jobs and inevitably at least one of the agents would get this issue. Switching to ubuntu-20.04 fixed the issue for us.

@ritikb01
Copy link

Just commenting in case it helps anyone else. This issue would randomly happen to us (using cypress v13.3.3) in our azure devops pipeline jobs but only when using the windows-2019 image. We have our tests split up to run in 20 different parallel jobs and inevitably at least one of the agents would get this issue. Switching to ubuntu-20.04 fixed the issue for us.

Thanks, It helped.

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

No branches or pull requests