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.

Websocket data connectivity issue with Chrome headless?

See original GitHub issue
Component Version
Operating system macOS 10.15.7
Node.js -
Chrome/Chromium/… 87.0.4280.88
chrome-remote-interface -

Is Chrome running in a container? YES / NO

Hi Cyrus, Good Day to you!

I’m maintaining 2 digital automation tools (TagUI, and RPA for Python, a Python wrapper of the former). Recently I found that TagUI is not able to receive response back from Chrome websocket connection if it is run in headless mode. But the same code works fine with visible mode. Nothing changed from my side, so I suspect something changed with Chrome.

Did some troubleshooting but not getting any clues (https://github.com/kelaberetiv/TagUI/issues/890) and have not found anything from the internet. Thought to raise an issue here to see if you or your users have run into problems with Chrome headless as well.

The gist is after a websocket message is sent, it can take more than 10 seconds for the headless Chrome process to send back the response. Running the same code with Chrome visible gets instant response.

Best Regards, Ken

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cyrus-andcommented, Jan 17, 2021

I see, hopefully people running in the same problem will find this issue.

Happy 2021 to you too! ^_^

1reaction
kensohcommented, Dec 12, 2020

Thanks Cyrus for your quick reply!

It seems like a situation unique with my implementation for TagUI. What happens is in headless mode, when I provide --user-data-dir= with a relative path it no longer works, when it used to work in the past 2 years. When I tweak the relative path provided into a full path, it works in headless mode. For visible mode, it works whether relative or absolute path is provided.

Something probably has changed with how headless Chrome behaves when the path provided is a relative path. I’ll close this issue because I don’t think it happens outside of the TagUI implementation. I tried replicating the issue using Python websocket but it can’t be replicated. So the fix has to be an updated implementation for TagUI headless Chrome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using headless chrome via the websockets interface - Medium
Here's a short tutorial on how to use headless Chrome by connecting via the websockets interface. The documentation from chrome is a bit ......
Read more >
865002 - Headless WebSocket server can't handle ping frames
Open a headless chromium 2. Send a ping to the WebSocket. What is the expected behavior? It should keep the connection alive.
Read more >
Headless Chromium ping WebSocket support - Google Groups
When the WebSocket client sends a ping message to chromium, it closes the connection. I opened Fiddler I can see that after the...
Read more >
debugging chrome remotely - doesn't open websocket
I've run into the following issue both on Mac and Linux. Im starting chrome as follows: if self.headless: options.headless = True options.
Read more >
Render error: WebSocket connection is not alive. id
What is a Websocket? ... If the connection is not alive it's likely that Chromium crashed or became unresponsive. This often happens when...
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