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.

[🐛 Bug]: requests to `/session/:id/se/vnc` do not respect page origin, are hardcoded to `0.0.0.0:4444`

See original GitHub issue

What happened?

While running k8s-deployment-full-grid.yaml on a local minikube cluster, I noticed that viewing a session video via the Sessions tab makes a request to ws://0.0.0.0:4444 instead of having the request be relative to the host / origin of the page. All other requests correctly respect the document origin and make relative requests like /graphql etc. These requests seem to be initiated by LiveView.tsx connect() function

Screenshot from 2021-10-23 12-29-09

How can we reproduce the issue?

- deploy [k8s-deployment-full-grid.yaml](https://github.com/SeleniumHQ/docker-selenium/blob/trunk/k8s-deployment-full-grid.yaml) to a local kubernetes cluster
- set up a local dns entry e.g. in `/etc/hosts/` for the selenium hub such as `selenium.local.test    192.168.49.2` or whatever the cluster IP or IP of `svc/selenium-router`
- navigate to the selenium hub dashboard on `selenium.local.test/ui/index.html`
- run a test against the selenium cluster to trigger a session
- navigate to the `Sessions` tab and click the video icon next to the session (🎥) to launch the in-browser vnc session
- observe `net::ERR_CONNECTION_REFUSED` due to the request failing to `ws://0.0.0.0:4444/session/:id/se/vnc` when the request should be sent to `ws://selenium.local.test/session/:id/se/vnc`
- run `kubectl port-forward svc/selenium-router -n default 4444:4444 --address='0.0.0.0'`, try to view the session again, observe that it now works

Relevant log output

value   websock.js:185:26
value   rfb.js:511:23
value   rfb.js:773:21
value   self-hosted:1222:27
(Async: setTimeout handler) n   rfb.js:286:8
n/i.connect LiveView.tsx:96:15
value   LiveView.tsx:108:9
ps  react-dom.production.min.js:219:410
Ml  react-dom.production.min.js:259:159
...

Operating System

Ubuntu

Selenium version

4.0.0, nodejs

What are the browser(s) and version(s) where you see this issue?

Chrome 94

What are the browser driver(s) and version(s) where you see this issue?

Chromedriver 94

Are you using Selenium Grid?

4.0.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
skylarmbcommented, Nov 23, 2021

❤️ thanks for the quick fix!

1reaction
diemolcommented, Oct 26, 2021

I am not sure, I think those are different issues. I will have a look at the Grid code and report back.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

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