cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Launching Webkit with docker against localhost throws Error: read ECONNRESET at TCP.onStreamRead

Open przemek-domain opened this issue 1 year ago • 11 comments

Current behavior

Setup

  1. experimentalWebKitSupport: true
  2. Docker running (CRA) application on http://server.local:3000
  3. Docker of cypress/base:18.16.0 running tests
  4. Docker bridge network
  5. /etc/hosts contains <app-server-ip> server.local
  6. Playwright version 1.34.2

Current behaviour

When running a test against CI/CD (Jenkins) or locally, I face the following error.

read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

Desired behavior

I would like Cypress to be able to run WebKit tests against localhost

Test code to reproduce

This repo with minimal setup to reproduce the issue https://github.com/psech/cypress-network-issue

Cypress Version

12.13.0

Node version

18.16.0

Operating System

macOS 13.3.1 arm64 + docker 23.0.5 or Jenkins agent AWS EC2 c5.9xlarge + docker

Debug Logs

> There was an error creating your issue: body is too long, body is too long (maximum is 65536 characters).

I'm happy to upload logs in a designated place.

Subset

read ECONNRESET[39m
[31mError: read ECONNRESET[39m
[31m    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)[39m
  [31;1mcypress:server:cloud:api [0mrequest to url: POST https://api.cypress.io/exceptions with params: {"body":{"err":{"name":"Error","message":"read ECONNRESET","stack":"Error: read ECONNRESET\n    at TCP.onStreamRead (node:internal<stripped-path>stream_base_commons:217:20)"},"version":"12.13.0","osName":"linux","osVersion":"Debian - ","osCpus":[{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3385,"times":{"user":8940,"nice":1470,"sys":4660,"idle":778770,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2570,"times":{"user":8860,"nice":510,"sys":4800,"idle":787100,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3197,"times":{"user":5890,"nice":320,"sys":3050,"idle":794120,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3113,"times":{"user":4220,"nice":0,"sys":2440,"idle":796610,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2742,"times":{"user":10340,"nice":0,"sys":2880,"idle":789550,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2173,"times":{"user":18620,"nice":0,"sys":3290,"idle":786200,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2570,"times":{"user":11510,"nice":0,"sys":4410,"idle":787380,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2978,"times":{"user":9140,"nice":0,"sys":2830,"idle":794030,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3187,"times":{"user":5350,"nice":0,"sys":2410,"idle":795860,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3239,"times":{"user":6030,"nice":0,"sys":2870,"idle":794630,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3219,"times":{"user":8820,"nice":0,"sys":4090,"idle":791630,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2772,"times":{"user":5400,"nice":0,"sys":2410,"idle":797540,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3139,"times":{"user":13980,"nice":0,"sys":3500,"idle":787510,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2797,"times":{"user":9910,"nice":0,"sys":2780,"idle":792380,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3214,"times":{"user":6170,"nice":0,"sys":3880,"idle":792910,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3215,"times":{"user":5620,"nice":0,"sys":2140,"idle":796450,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2536,"times":{"user":6500,"nice":0,"sys":2190,"idle":796260,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3302,"times":{"user":6450,"nice":0,"sys":3700,"idle":792290,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2111,"times":{"user":7900,"nice":0,"sys":2750,"idle":793780,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3093,"times":{"user":5840,"nice":510,"sys":1950,"idle":796450,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2559,"times":{"user":13110,"nice":260,"sys":4250,"idle":786530,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2660,"times":{"user":6670,"nice":20,"sys":3030,"idle":795340,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3045,"times":{"user":6930,"nice":0,"sys":2140,"idle":796410,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2497,"times":{"user":6350,"nice":0,"sys":2020,"idle":796600,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3228,"times":{"user":7560,"nice":0,"sys":2480,"idle":795130,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2632,"times":{"user":5200,"nice":0,"sys":1980,"idle":798160,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3220,"times":{"user":6120,"nice":0,"sys":3460,"idle":772650,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3013,"times":{"user":19330,"nice":19860,"sys":9020,"idle":752060,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2639,"times":{"user":4870,"nice":0,"sys":2590,"idle":792080,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3205,"times":{"user":3900,"nice":0,"sys":2800,"idle":794900,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3236,"times":{"user":8330,"nice":0,"sys":2480,"idle":790790,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3218,"times":{"user":5410,"nice":0,"sys":3080,"idle":794600,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2608,"times":{"user":8910,"nice":0,"sys":4090,"idle":791320,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3214,"times":{"user":7370,"nice":0,"sys":2850,"idle":794140,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":3216,"times":{"user":4230,"nice":60,"sys":2280,"idle":798390,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8124M CPU @ 3.00GHz","speed":2191,"times":{"user":8930,"nice":0,"sys":3310,"idle":769510,"irq":0}}],"osMemory":{"free":70389166080,"total":73652686848}},"headers":{"x-os-name":"linux","x-cypress-version":"12.13.0"}} and token: undefined

Other

The above setup helps to reproduce the https://github.com/cypress-io/cypress/issues/24704

A place in code I suspect to be involved https://github.com/cypress-io/cypress/blob/7fa5103f6734680df900ff9c071bbe1ef51a86d9/packages/server/lib/browsers/webkit.ts#L132-L143

przemek-domain avatar May 24 '23 08:05 przemek-domain

@przemek-domain For your docker container, it looks like in your container for testing (Dockerfile-test) you installed the additional linux dependencies, but not the browser itself. If you update the line in that docker file to be npx playwright install --with-deps webkit instead of just npx playwright install-deps webkit, then it should work.

Let me know if that works and I can look at updating our docs site to be more clear about getting this to work in CI.

See: https://playwright.dev/docs/browsers

warrensplayer avatar Jun 01 '23 19:06 warrensplayer

@warrensplayer thank you for getting back to me.

Unfortunately, the proposed solution does not work. I receive the same error

read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

However, I found it works when I run my CRA app over HTTPS, i.e. npx HTTPS=true react-scripts start

przemek-domain avatar Jun 02 '23 02:06 przemek-domain

You are right. I spoke too soon.

I reverted my Dockerfile-test file and rebuilt my image. When run the following: docker run --net=host --rm 26847test npx cypress run --headless --browser webkit it fails with the same error:

read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

Here is the entire output and notice the dri3 extension not supported error

DevTools listening on ws://127.0.0.1:38075/devtools/browser/4fd21ec8-f17e-4553-ba3b-a4c883dbcf6e
[212:0602/143040.249741:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.13.0                                                                        │
  │ Browser:        WebKit 16 (headless)                                                           │
  │ Node Version:   v18.16.0 (/usr/local/bin/node)                                                 │
  │ Specs:          1 found (cra-app.cy.js)                                                        │
  │ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            │
  │ Experiments:    experimentalWebKitSupport=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  cra-app.cy.js                                                                   (1 of 1)


  template spec
read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

When I run this command docker run --net=host --rm 26847test ls & npx cypress run --headless --browser webkit It works just fine and there is no dri3 extension not supported error.

[1] 16737
Dockerfile-test
Jenkinsfile
cypress
cypress.config.js
node_modules
package-lock.json
package.json
public
scripts
src
yarn.lock
[1]  + done       docker run --net=host --rm 26847test ls

DevTools listening on ws://127.0.0.1:59431/devtools/browser/f8f003f4-a794-4611-823b-9def776636c3

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.13.0                                                                        │
  │ Browser:        WebKit 16 (headless)                                                           │
  │ Node Version:   v16.18.1 (/Users/stokes/.nvm/versions/node/v16.18.1/bin/node)                  │
  │ Specs:          1 found (cra-app.cy.js)                                                        │
  │ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            │
  │ Experiments:    experimentalWebKitSupport=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  cra-app.cy.js                                                                   (1 of 1)


  template spec
    ✓ passes (140ms)


  1 passing (1s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     1 second                                                                         │
  │ Spec Ran:     cra-app.cy.js                                                                    │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started compressing: Compressing to 32 CRF                                                     
  -  Finished compressing: 0 seconds                                                 

  -  Video output: /Users/stokes/Development/firewatch/26847/cypress-network-issue/cypress/videos/cra-app.cy.js.mp4


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  cra-app.cy.js                            00:01        1        1        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:01        1        1        -        -        -  

The only difference is appending ls & to the command. I am going to have to ask around to see if someone more familiar with docker can understand this.

Can you try the same thing as I did above and see if you get the same result?

warrensplayer avatar Jun 02 '23 15:06 warrensplayer

Thank you @warrensplayer, for investing time in this. It is a very interesting finding.

I noticed a difference in how we set up the network. I updated the README with info on how I run the containers. 🙏🏻 Please provide the exact commands you run to set the environment, i.e. build, run, test.

When I try your way (no & ls), but with bridge network, I see the dri3 error.

[212:0605/011105.831045:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.

When I add the magical & ls, the error is gone, but I still get the ECONNREFUSED error.

[1] 11718
Dockerfile-test
Jenkinsfile
cypress
cypress.config.js
node_modules
package-lock.json
package.json
public
scripts
src
yarn-error.log
yarn.lock
[1]  + 11718 done       docker run --name test-container --add-host=server.local:172.18.0.2   ls

DevTools listening on ws://127.0.0.1:51315/devtools/browser/833922f1-e240-4f9a-94b6-c5eb8c2e97ce

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        12.13.0                                                                        │
  │ Browser:        WebKit 16 (headless)                                                           │
  │ Node Version:   v16.18.1 (/Users/przemek.sech/.nvm/versions/node/v16.18.1/bin/node)            │
  │ Specs:          1 found (cra-app.cy.js)                                                        │
  │ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            │
  │ Experiments:    experimentalWebKitSupport=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  cra-app.cy.js                                                                   (1 of 1)


  template spec
    1) passes


  0 passing (51s)
  1 failing

  1) template spec
       passes:
     CypressError: `cy.visit()` failed trying to load:

http://server.local:3000/

We attempted to make an http request to this URL but the request failed without a response.

We received this error at the network level:

  > Error: connect ECONNREFUSED 127.0.0.1:3000

Common situations why this would fail:
  - you don't have internet access
  - you forgot to run / boot your web server
  - your web server isn't accessible
  - you have weird network configuration settings on your computer
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:147677:96)
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:147676:27)
  at tryCatcher (http://localhost:51316/__cypress/runner/cypress_runner.js:18744:28)
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:16679:35)
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:16736:43)
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:16781:24)
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:16857:33)
  at _drainQueueStep (http://localhost:51316/__cypress/runner/cypress_runner.js:13451:27)
  at _drainQueue (http://localhost:51316/__cypress/runner/cypress_runner.js:13444:24)
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:13460:16)
  at <unknown> (http://localhost:51316/__cypress/runner/cypress_runner.js:13330:26)
  From Your Spec Code:
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:160646:122)
  @
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:160854:43)
      at callFn (http://localhost:51316/__cypress/runner/cypress_runner.js:114387:25)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:114374:13)
      at finallyHandler (http://localhost:51316/__cypress/runner/cypress_runner.js:15298:27)
      at tryCatcher (http://localhost:51316/__cypress/runner/cypress_runner.js:18744:28)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16679:35)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16736:43)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16781:24)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16861:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16805:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16749:29)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16781:24)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16861:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16805:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16691:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16736:43)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16781:24)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16861:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16805:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:17078:27)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:17096:22)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:17066:48)
      at init (http://localhost:51316/__cypress/runner/cypress_runner.js:17030:18)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16733:25)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16781:24)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16861:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16805:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:17078:27)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:17096:22)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16741:43)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16781:24)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16861:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16805:33)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:17078:27)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:15904:26)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16741:43)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16781:24)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:16861:33)
      at _drainQueueStep (http://localhost:51316/__cypress/runner/cypress_runner.js:13451:27)
      at _drainQueue (http://localhost:51316/__cypress/runner/cypress_runner.js:13444:24)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:13460:16)
      at  (http://localhost:51316/__cypress/runner/cypress_runner.js:13330:26)

  From Node.js Internals:
    Error: connect ECONNREFUSED 127.0.0.1:3000
        at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)




  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      0                                                                                │
  │ Failing:      1                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  1                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     50 seconds                                                                       │
  │ Spec Ran:     cra-app.cy.js                                                                    │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Screenshots)

  -  /Users/przemek.sech/Git/przemek-minimal-cypress-webkit-setup/cypress/screenshots     (1280x720)
     /cra-app.cy.js/template spec -- passes (failed).png


  (Video)

  -  Started compressing: Compressing to 32 CRF
  -  Finished compressing: 1 second

  -  Video output: /Users/przemek.sech/Git/przemek-minimal-cypress-webkit-setup/cypress/videos/cra-app.cy.js.mp4


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✖  cra-app.cy.js                            00:50        1        -        1        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✖  1 of 1 failed (100%)                     00:50        1        -        1        -        -

ℹ️ I tried the --net=host option and got the same response as above.

Debug connection

Please see README for network details.

To debug the connection between containers and ran the test-conatiner as

docker run -it --name test-container \                                                                                                                                                          
          --add-host=server.local:172.18.0.2 --network=network-cypress \
          test-image /bin/bash

and tested connection

root@82192f4c0983:/test# ping -c 4 server.local
PING server.local (172.18.0.2) 56(84) bytes of data.
64 bytes from server.local (172.18.0.2): icmp_seq=1 ttl=64 time=0.367 ms
64 bytes from server.local (172.18.0.2): icmp_seq=2 ttl=64 time=0.440 ms
64 bytes from server.local (172.18.0.2): icmp_seq=3 ttl=64 time=1.26 ms
64 bytes from server.local (172.18.0.2): icmp_seq=4 ttl=64 time=0.437 ms

--- server.local ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3014ms
rtt min/avg/max/mdev = 0.367/0.625/1.257/0.365 ms

and with curl

root@82192f4c0983:/test# curl -i http://server.local:3000
HTTP/1.1 200 OK
Content-Length: 644
Content-Disposition: inline; filename="index.html"
Accept-Ranges: bytes
ETag: "dc6657f4c6d7bb6254487d0bde156e51f59cd47d"
Content-Type: text/html; charset=utf-8
Vary: Accept-Encoding
Date: Mon, 05 Jun 2023 01:31:49 GMT
Connection: keep-alive
Keep-Alive: timeout=5

<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.7be9ec25.js"></script><link href="/static/css/main.073c9b0a.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>root@82192f4c0983:/test#

Summary

It looks like some network setup issue.

Please provide me with exact commands you ran including build, run and test so I can reproduce exactly the same on my end.

przemek-domain avatar Jun 05 '23 01:06 przemek-domain

+1 I'm having the same issue, as soon as webkit attempts to interact with the app it throws Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20)

Looking forward to a resolution on this because this is stopping us from running webkit tests in our pipeline

adam-wood-traka avatar Jun 09 '23 23:06 adam-wood-traka

@adam-wood-traka Are you trying to do the same thing as the original poster with sharing a network across docker images? If not, then please file a separate issue with a reproducible example for us to look at.

warrensplayer avatar Jun 19 '23 20:06 warrensplayer

@przemek-domain Thanks for the update detail on how you setup your docker containers. I had shared my exact commands above. I had just used --net=host to use the host network instead of the way you did it.

I will pass this along to get some more help internally and will get back with you.

warrensplayer avatar Jun 19 '23 20:06 warrensplayer

@przemek-domain I was able to reproduce your same scenario using your updated steps.

I couple of updates from our team. The dri3 error is a red herring. It can happen regardless of browser.

There are a few issues relating to using webkit in a docker container: https://github.com/cypress-io/cypress-docker-images/issues/526 https://github.com/cypress-io/cypress/issues/25344 https://github.com/cypress-io/cypress-docker-images/issues/916

Your issue may be related.

I am forwarding this ticket to the appropriate team. They will soon evaluate the priority of this ticket and consider their capacity to pick it up. Please note that this does not guarantee that this issue will be resolved. The ticket will indicate status changes during evaluation, so we ask that you please refrain from asking for updates. Thanks!

warrensplayer avatar Jun 20 '23 15:06 warrensplayer

@adam-wood-traka Are you trying to do the same thing as the original poster with sharing a network across docker images? If not, then please file a separate issue with a reproducible example for us to look at.

@warrensplayer Yes exactly the same issue sharing a network across docker images. It works if your testing a public url but if the app you're testing is in another container that's when it throws the error. I've subscribed to this issue, looking forward to this being fixed 🤞 Worth noting that In the same scenario, using only playwright testing an app in another container, it works.

adam-wood-traka avatar Jun 20 '23 22:06 adam-wood-traka

Having the same issue here.

dehoej avatar Jul 31 '23 13:07 dehoej

For us it also crashes with webkit (other browsers run fine) in a normal environmnet i. e. outside docker:

read ECONNRESET
Error: read ECONNRESET
    at TCP.onStreamRead (node:internal/stream_base_commons:217:20)
    at TCP.callbackTrampoline (node:internal/async_hooks:130:17

setup: Cypress 13.8.1 Node 22.1.0 playwright-webkit 1.44.0 OS: Ubuntu 22.04.4 LTS

As the original poster implicitly mentioned, this only happens when going against localhost. Setting baseUrl to a proper domain fixes the issue and the page loads without any issues in the cypress tests.

momesana avatar May 10 '24 17:05 momesana