question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Puppeteer throwing ECONNRESET error while connecting to wsEndpoint

See original GitHub issue

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 1.17.0
  • Platform / OS version: Alpine Linux - Edge
  • Node.js version: 10

What steps will reproduce the problem?

I am trying to run my puppeteer tests within a docker.

  1. I followed the troubleshooting page and replicated the same dockerfile
FROM alpine:edge

# Installs latest Chromium (76) package.
RUN apk add --no-cache \
      chromium \
      nss \
      freetype \
      freetype-dev \
      harfbuzz \
      ca-certificates \
      ttf-freefont \
      openjdk8-jre \
      bash \
      nodejs \
      yarn

# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

WORKDIR /usr/local/extranet

COPY ./ /usr/local/extranet

RUN yarn && yarn build

CMD ["yarn", "test:ci"]
  1. I am running my tests using Jest + Puppeteer using jest-puppeteer package. Described in the example found in https://github.com/smooth-code/jest-puppeteer/tree/master/examples/create-react-app

  2. I am running my testcases with yarn test:ci command which does the following.

  • Start my local server, to serve my website
  • Launch puppeteer with the following config:
{
    headless: true,
    executablePath: '/usr/bin/chromium-browser',
    args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-background-timer-throttling', '--disable-backgrounding-occluded-windows', '--disable-renderer-backgrounding']
}
  • Then extract the wsEndpoint using browser.wsEndpoint()
  • Use that value in another place to do a puppeteer.connect() passing the wsEndpoint value

What is the expected result?

The test case ran successfully

What happens instead?

Getting an error: connect ECONNREFUSED 127.0.0.1:36085 The port keeps varying everytime.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:10

github_iconTop GitHub Comments

9reactions
EXPEpahercommented, Apr 2, 2020

Seeing the same issue, downgrade did not help. Tried puppeteer version 1.11.0 which comes with chromium_revision 609904. I think it corresponds to chrome-72 based on the version logs here, https://www.npmjs.com/package/puppeteer

Running node v10.15.3 on a Linux machine. Could use some help please.

0reactions
stale[bot]commented, Jul 25, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer - How to connect WSEndpoint using local IP ...
If I ran this script with run command as node connector.js localhost , it tries to connect WSEndpint with localhost as the hostname....
Read more >
"Error: Socket hang up" on deployed function - Support
This runs fine in Netlify dev but throws socket hang up errors when deployed. From searching, it appears people only encountered this in...
Read more >
[Solved]-socket.io heroku request timeout-node.js
You need wrap socket.io with a http server ... Heroku 'H12' request timeout error with Node JS application · Node.js https request work...
Read more >
try - Mercurial - Mozilla
remote/test/puppeteer/.github/workflows/publish-on-tag.yml ... + +try { + // In some environments, like esbuild, this will throw an error.
Read more >
Noob question about ECONNRESET and error handling in ...
Now all of a sudden my script crashes whenever I close the TCP connection on the client's side. Sending a request to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found