seleniumhq-community / docker-seleniarm

Multi-Arch (arm64/armhf/amd64) Docker images for the Selenium Grid Server
https://hub.docker.com/u/seleniarm
Other
248 stars 24 forks source link

[šŸ› Bug]: noVNC not working, driver apparently couldn't connect #37

Closed wyankx closed 11 months ago

wyankx commented 1 year ago

What happened?

noVNC is up and running at http://localhost:7900/ but could not connect to the server. I've tried to start simple VNC, it could not connect too. When I tried to check if the driver is working by

os.system(f'docker run -d -p 4444:4444 -p 5900:5900 -p 7900:7900 -e SCREEN_WIDTH={width} -e SCREEN_HEIGHT={height} --platform linux/arm64 seleniarm/standalone-chromium')
driver = webdriver.Remote('http://localhost:4444/wd/hub')
print('getting site')
driver.get('https://google.com/')

it did not have "getting site" printed, which means it stuck on it. Regardless, it didn't raise any error. When I went to http://localhost:4444/ui#, there was page as if I was running firefox with selenium-docker (which works on my mac)

Command used to start Selenium Grid with Docker

docker run -d -p 4444:4444 -p 5900:5900 -p 7900:7900 -e SCREEN_WIDTH=1500 -e SCREEN_HEIGHT=1000 --shm-size 2g --platform linux/arm64 seleniarm/standalone-chromium

AND

docker run -d -p 4444:4444 -p 5900:5900 -p 7900:7900 seleniarm/standalone-chromium

Relevant log output

2023-05-05 20:53:17 2023-05-05 17:53:17,718 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2023-05-05 20:53:17 2023-05-05 17:53:17,815 INFO RPC interface 'supervisor' initialized
2023-05-05 20:53:17 2023-05-05 17:53:17,815 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2023-05-05 20:53:17 2023-05-05 17:53:17,816 INFO supervisord started with pid 12
2023-05-05 20:53:18 2023-05-05 17:53:18,839 INFO spawned: 'xvfb' with pid 15
2023-05-05 20:53:18 2023-05-05 17:53:18,849 INFO spawned: 'vnc' with pid 17
2023-05-05 20:53:18 2023-05-05 17:53:18,853 INFO spawned: 'novnc' with pid 19
2023-05-05 20:53:18 2023-05-05 17:53:18,862 INFO spawned: 'selenium-standalone' with pid 21
2023-05-05 20:53:19 Setting up SE_NODE_GRID_URL...
2023-05-05 20:53:19 2023-05-05 17:53:19,121 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2023-05-05 20:53:19 2023-05-05 17:53:19,121 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2023-05-05 20:53:19 2023-05-05 17:53:19,122 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2023-05-05 20:53:19 2023-05-05 17:53:19,122 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2023-05-05 20:53:19 find: '/home/seluser/.config/chromium/Crash Reports/pending/': No such file or directory
2023-05-05 20:53:19 Selenium Grid Standalone configuration: 
2023-05-05 20:53:19 [network]
2023-05-05 20:53:19 relax-checks = true
2023-05-05 20:53:19 
2023-05-05 20:53:19 [node]
2023-05-05 20:53:19 session-timeout = "300"
2023-05-05 20:53:19 override-max-sessions = false
2023-05-05 20:53:19 detect-drivers = false
2023-05-05 20:53:19 drain-after-session-count = 0
2023-05-05 20:53:19 max-sessions = 1
2023-05-05 20:53:19 
2023-05-05 20:53:19 [[node.driver-configuration]]
2023-05-05 20:53:19 display-name = "chrome"
2023-05-05 20:53:19 stereotype = '{"browserName": "chrome", "browserVersion": "112.0", "platformName": "Linux"}'
2023-05-05 20:53:19 max-sessions = 1
2023-05-05 20:53:19 
2023-05-05 20:53:19 Starting Selenium Grid Standalone...
2023-05-05 20:53:19 Tracing is disabled
2023-05-05 20:53:22 17:53:22.947 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
2023-05-05 20:53:22 17:53:22.973 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
2023-05-05 20:53:25 17:53:25.995 INFO [NodeOptions.getSessionFactories] - Detected 4 available processors
2023-05-05 20:53:26 17:53:26.213 INFO [NodeOptions.report] - Adding chrome for {"browserVersion": "112.0","se:noVncPort": 7900,"browserName": "chrome","platformName": "LINUX","se:vncEnabled": true} 1 times (Host)
2023-05-05 20:53:26 17:53:26.282 INFO [Node.<init>] - Binding additional locator mechanisms: relative
2023-05-05 20:53:26 17:53:26.390 INFO [GridModel.setAvailability] - Switching Node 375c0b41-05b1-49da-a260-88ae4a5a9c87 (uri: http://172.17.0.2:4444) from DOWN to UP
2023-05-05 20:53:26 17:53:26.392 INFO [LocalDistributor.add] - Added node 375c0b41-05b1-49da-a260-88ae4a5a9c87 at http://172.17.0.2:4444. Health check every 120s
2023-05-05 20:53:27 17:53:27.071 INFO [Standalone.execute] - Started Selenium Standalone 4.9.0 (revision d7057100a6): http://172.17.0.2:4444

Operating System

MacOS Ventura 13.2.1 on M1 chip

Docker Selenium version (tag)

112.0 (latest on this moment)

jamesmortensen commented 1 year ago

Hi @Magprone what happens if you start the docker container first in a separate terminal, and then run just the code that attempts to navigate the browser to the web page?

$ docker run -d -p 4444:4444 -p 5900:5900 -p 7900:7900 -e SCREEN_WIDTH={width} -e SCREEN_HEIGHT={height} --platform linux/arm64 seleniarm/standalone-chromium

Then in a separate terminal, execute the code:

driver = webdriver.Remote('http://localhost:4444/wd/hub')
print('getting site')
driver.get('https://google.com/')

Do you still have the problem with the system hanging?

wyankx commented 1 year ago

Hello @jamesmortensen. It doesn't work for me. But, after I tried this, I was able to fix this problem by reinstalling the seleniarm image. Now I'm worried if this problem reoccurs and what was causing it.

jamesmortensen commented 1 year ago

Hi @Magprone it's really hard to say what the issue is without more details. We can keep the issue open a little longer to see if you're able to replicate again. Glad to hear it's working, at least for now. :)

wyankx commented 1 year ago

Thank you for support. If it comes up again, I'll let you know.

FLemon commented 1 year ago

am having the exact same problem, novnc exists on startup, not sure what's missing, I didn't run the script @jamesmortensen suggested, I don't think this is scalable walk around in my workflow

Screenshot 2023-05-09 at 10 04 44
FLemon commented 1 year ago

UPDATE, I found I had START_XVFB=false, once I had this removed, novnc at :7900 is working

wyankx commented 1 year ago

I'm glad you solved this. I hadn't used this parameter, so it is not the cause of my problem.

diemol commented 11 months ago

Closing this as it cannot be reproduced reliably.

github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.