Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Docker Container stuck at Started Selenium Standalone 4.4.0 #1677

Closed
NicoCaldo opened this issue Sep 18, 2022 · 22 comments
Closed

Comments

@NicoCaldo
Copy link

NicoCaldo commented Sep 18, 2022

What happened?

I'm trying to use Selenium inside a Docker container but after running the docker container the console stays stuck at

INFO [Standalone.execute] - Started Selenium Standalone 4.4.0 (revision e5c75ed026a): http://172.18.0.2:4444

How can we reproduce the issue?

The configuration is pretty simple as I'm trying to just take a screenshot of the web page. My files are

docker-compose.yml

version: '3'

services:
  selenium:
    image: selenium/standalone-chrome
    ports:
      - 4444:4444
    restart: always

  app:
    build:
      context: .
    volumes:
      - ./app:/app
    command: sh -c "python3 bot.py"
    depends_on:
      - selenium

Dockerfile

FROM python:3.10-alpine

ENV PYTHONUNBUFFERED 1
COPY ./requirements.txt /requirements.txt
RUN pip install -r /requirements.txt

RUN mkdir /app
COPY ./app /app
WORKDIR /app

python app


from time import sleep
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium import webdriver

sleep(5)

driver = webdriver.Remote('http://selenium:4444/wd/hub',desired_capabilities=DesiredCapabilities.CHROME)

driver.get('https://python.org')
driver.save_screenshot('screenshot.png')

Relevant log output

Starting selenium-docker_selenium_1 ... done
Recreating selenium-docker_app_1    ... done
Attaching to selenium-docker_selenium_1, selenium-docker_app_1
selenium_1  | 2022-09-18 10:42:53,601 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
selenium_1  | 2022-09-18 10:42:53,606 INFO RPC interface 'supervisor' initialized
selenium_1  | 2022-09-18 10:42:53,606 CRIT Server 'unix_http_server' running without any HTTP authentication checking
selenium_1  | 2022-09-18 10:42:53,606 INFO supervisord started with pid 9
selenium_1  | 2022-09-18 10:42:54,609 INFO spawned: 'xvfb' with pid 11
selenium_1  | 2022-09-18 10:42:54,612 INFO spawned: 'vnc' with pid 12
selenium_1  | 2022-09-18 10:42:54,614 INFO spawned: 'novnc' with pid 13
selenium_1  | 2022-09-18 10:42:54,616 INFO spawned: 'selenium-standalone' with pid 15
selenium_1  | Setting up SE_NODE_GRID_URL...
selenium_1  | 2022-09-18 10:42:54,630 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
selenium_1  | 2022-09-18 10:42:54,630 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
selenium_1  | 2022-09-18 10:42:54,631 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
selenium_1  | 2022-09-18 10:42:54,631 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
selenium_1  | Selenium Grid Standalone configuration: 
selenium_1  | [network]
selenium_1  | relax-checks = true
selenium_1  | 
selenium_1  | [node]
selenium_1  | session-timeout = "300"
selenium_1  | override-max-sessions = false
selenium_1  | detect-drivers = false
selenium_1  | drain-after-session-count = 0
selenium_1  | max-sessions = 1
selenium_1  | 
selenium_1  | [[node.driver-configuration]]
selenium_1  | display-name = "chrome"
selenium_1  | stereotype = '{"browserName": "chrome", "browserVersion": "105.0", "platformName": "Linux"}'
selenium_1  | max-sessions = 1
selenium_1  | 
selenium_1  | Starting Selenium Grid Standalone...
selenium_1  | 10:42:55.182 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
selenium_1  | 10:42:55.187 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
selenium_1  | 10:42:55.952 INFO [NodeOptions.getSessionFactories] - Detected 4 available processors
selenium_1  | 10:42:56.033 INFO [NodeOptions.report] - Adding chrome for {"browserVersion": "105.0","se:noVncPort": 7900,"browserName": "chrome","platformName": "LINUX","se:vncEnabled": true} 1 times
selenium_1  | 10:42:56.054 INFO [Node.<init>] - Binding additional locator mechanisms: id, relative, name
selenium_1  | 10:42:56.082 INFO [GridModel.setAvailability] - Switching Node 7cd41ff5-ac71-4ec1-8d52-72eebef14d47 (uri: http://172.18.0.2:4444) from DOWN to UP
selenium_1  | 10:42:56.088 INFO [LocalDistributor.add] - Added node 7cd41ff5-ac71-4ec1-8d52-72eebef14d47 at http://172.18.0.2:4444. Health check every 120s
selenium_1  | 10:42:56.279 INFO [Standalone.execute] - Started Selenium Standalone 4.4.0 (revision e5c75ed026a): http://172.18.0.2:4444

Operating System

Ubuntu 22.04.1 LTS

Selenium version

Python 4.4.3

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

Chrome v.105.0

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

selenium/standalone-chrome

Are you using Selenium Grid?

4.4.0

@github-actions
Copy link

@NicoCaldo, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@NicoCaldo NicoCaldo changed the title [🐛 Bug]: [🐛 Bug]: Docker Container stuck at Started Selenium Standalone 4.4.0 Sep 18, 2022
@titusfortner titusfortner transferred this issue from SeleniumHQ/selenium Sep 18, 2022
@jamesmortensen
Copy link
Member

Since I didn't have your requirements.txt file, I had to improvise and install selenium manually in the Dockerfile.

Dockerfile

FROM python:3.10-alpine

ENV PYTHONUNBUFFERED 1
#COPY ./requirements.txt /requirements.txt
#RUN pip install -r /requirements.txt
RUN pip install selenium

RUN mkdir /app
COPY ./app /app
WORKDIR /app

docker-compose.yml

version: '3'

services:
  selenium:
    image: seleniarm/standalone-chromium
    ports:
      - 4444:4444
    restart: always

  app:
    build:
      context: .
    volumes:
      - ./app:/app
    command: sh -c "python3 bot.py"
    depends_on:
      - selenium

I put bot.py in the app folder, and then ran docker-compose up:

docker-compose up

Sending build context to Docker daemon     848B
Step 1/6 : FROM python:3.10-alpine
 ---> 85e5afa95f3f
Step 2/6 : ENV PYTHONUNBUFFERED 1
 ---> Using cache
 ---> d2210700a1e8
Step 3/6 : RUN pip install selenium
 ---> Running in 26ee9c707d5d
Collecting selenium
  Downloading selenium-4.4.3-py3-none-any.whl (985 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 986.0/986.0 kB 6.8 MB/s eta 0:00:00
Collecting trio-websocket~=0.9
  Downloading trio_websocket-0.9.2-py3-none-any.whl (16 kB)
Collecting urllib3[socks]~=1.26
  Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 9.4 MB/s eta 0:00:00
Collecting certifi>=2021.10.8
  Downloading certifi-2022.9.14-py3-none-any.whl (162 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 162.5/162.5 kB 7.4 MB/s eta 0:00:00
Collecting trio~=0.17
  Downloading trio-0.21.0-py3-none-any.whl (358 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 359.0/359.0 kB 7.7 MB/s eta 0:00:00
Collecting async-generator>=1.9
  Downloading async_generator-1.10-py3-none-any.whl (18 kB)
Collecting attrs>=19.2.0
  Downloading attrs-22.1.0-py2.py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.8/58.8 kB 5.3 MB/s eta 0:00:00
Collecting sniffio
  Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting idna
  Downloading idna-3.4-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 kB 10.1 MB/s eta 0:00:00
Collecting outcome
  Downloading outcome-1.2.0-py2.py3-none-any.whl (9.7 kB)
Collecting sortedcontainers
  Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting wsproto>=0.14
  Downloading wsproto-1.2.0-py3-none-any.whl (24 kB)
Collecting PySocks!=1.5.7,<2.0,>=1.5.6
  Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting h11<1,>=0.9.0
  Downloading h11-0.13.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.2/58.2 kB 8.0 MB/s eta 0:00:00
Installing collected packages: sortedcontainers, urllib3, sniffio, PySocks, idna, h11, certifi, attrs, async-generator, wsproto, outcome, trio, trio-websocket, selenium
Successfully installed PySocks-1.7.1 async-generator-1.10 attrs-22.1.0 certifi-2022.9.14 h11-0.13.0 idna-3.4 outcome-1.2.0 selenium-4.4.3 sniffio-1.3.0 sortedcontainers-2.4.0 trio-0.21.0 trio-websocket-0.9.2 urllib3-1.26.12 wsproto-1.2.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container 26ee9c707d5d
 ---> 1f3f156f3de4
Step 4/6 : RUN mkdir /app
 ---> Running in b20fec414152
Removing intermediate container b20fec414152
 ---> 8a8f43535bd1
Step 5/6 : COPY ./app /app
 ---> 52def57c878b
Step 6/6 : WORKDIR /app
 ---> Running in a831316aca57
Removing intermediate container a831316aca57
 ---> c1e4eaf20f07
Successfully built c1e4eaf20f07
Successfully tagged issue1677_app:latest
[+] Running 3/0
 ⠿ Network issue1677_default       Created                                                                           0.0s
 ⠿ Container issue1677-selenium-1  Created                                                                           0.0s
 ⠿ Container issue1677-app-1       Created                                                                           0.0s
Attaching to issue1677-app-1, issue1677-selenium-1
issue1677-selenium-1  | 2022-09-18 15:33:26,708 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
issue1677-selenium-1  | 2022-09-18 15:33:26,719 INFO RPC interface 'supervisor' initialized
issue1677-selenium-1  | 2022-09-18 15:33:26,719 CRIT Server 'unix_http_server' running without any HTTP authentication checking
issue1677-selenium-1  | 2022-09-18 15:33:26,719 INFO supervisord started with pid 9
issue1677-selenium-1  | 2022-09-18 15:33:27,728 INFO spawned: 'xvfb' with pid 10
issue1677-selenium-1  | 2022-09-18 15:33:27,731 INFO spawned: 'vnc' with pid 11
issue1677-selenium-1  | 2022-09-18 15:33:27,734 INFO spawned: 'novnc' with pid 12
issue1677-selenium-1  | 2022-09-18 15:33:27,737 INFO spawned: 'selenium-standalone' with pid 14
issue1677-selenium-1  | Setting up SE_NODE_GRID_URL...
issue1677-selenium-1  | 2022-09-18 15:33:27,749 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
issue1677-selenium-1  | 2022-09-18 15:33:27,749 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
issue1677-selenium-1  | 2022-09-18 15:33:27,749 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
issue1677-selenium-1  | 2022-09-18 15:33:27,750 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
issue1677-selenium-1  | Selenium Grid Standalone configuration: 
issue1677-selenium-1  | [network]
issue1677-selenium-1  | relax-checks = true
issue1677-selenium-1  | 
issue1677-selenium-1  | [node]
issue1677-selenium-1  | session-timeout = "300"
issue1677-selenium-1  | override-max-sessions = false
issue1677-selenium-1  | detect-drivers = false
issue1677-selenium-1  | drain-after-session-count = 0
issue1677-selenium-1  | max-sessions = 1
issue1677-selenium-1  | 
issue1677-selenium-1  | [[node.driver-configuration]]
issue1677-selenium-1  | display-name = "chrome"
issue1677-selenium-1  | stereotype = '{"browserName": "chrome", "browserVersion": "105.0", "platformName": "Linux"}'
issue1677-selenium-1  | max-sessions = 1
issue1677-selenium-1  | 
issue1677-selenium-1  | Starting Selenium Grid Standalone...
issue1677-selenium-1  | 15:33:28.026 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
issue1677-selenium-1  | 15:33:28.028 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
issue1677-selenium-1  | 15:33:28.357 INFO [NodeOptions.getSessionFactories] - Detected 4 available processors
issue1677-selenium-1  | 15:33:28.377 INFO [NodeOptions.report] - Adding chrome for {"browserVersion": "105.0","se:noVncPort": 7900,"browserName": "chrome","platformName": "LINUX","se:vncEnabled": true} 1 times
issue1677-selenium-1  | 15:33:28.384 INFO [Node.<init>] - Binding additional locator mechanisms: relative, id, name
issue1677-selenium-1  | 15:33:28.398 INFO [GridModel.setAvailability] - Switching Node 8243d877-9c83-4e7a-83e2-39d46416e2bb (uri: http://172.18.0.2:4444) from DOWN to UP
issue1677-selenium-1  | 15:33:28.398 INFO [LocalDistributor.add] - Added node 8243d877-9c83-4e7a-83e2-39d46416e2bb at http://172.18.0.2:4444. Health check every 120s
issue1677-selenium-1  | 15:33:28.471 INFO [Standalone.execute] - Started Selenium Standalone 4.4.0 (revision e5c75ed026a): http://172.18.0.2:4444
issue1677-selenium-1  | 2022-09-18 15:33:29,132 INFO exited: novnc (exit status 1; not expected)
issue1677-app-1       | /app/bot.py:7: DeprecationWarning: desired_capabilities has been deprecated, please pass in an Options object with options kwarg
issue1677-app-1       |   driver = webdriver.Remote('http://selenium:4444/wd/hub',desired_capabilities=DesiredCapabilities.CHROME)
issue1677-selenium-1  | 15:33:43.173 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
issue1677-selenium-1  |  [Capabilities {browserName: chrome}]
issue1677-selenium-1  | Starting ChromeDriver 105.0.5195.52 (412c95e518836d8a7d97250d62b29c2ae6a26a85-refs/branch-heads/5195@{#853}) on port 60729
issue1677-selenium-1  | Only local connections are allowed.
issue1677-selenium-1  | Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
issue1677-selenium-1  | ChromeDriver was started successfully.
issue1677-selenium-1  | [1663515223.207][SEVERE]: bind() failed: Cannot assign requested address (99)
issue1677-selenium-1  | 15:33:43.652 INFO [ProtocolHandshake.createSession] - Detected upstream dialect: W3C
issue1677-selenium-1  | 15:33:43.661 INFO [LocalNode.newSession] - Session created by the Node. Id: 5f40222b3ca95a53d0086f9880b5b451, Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 105.0.5195.52, chrome: {chromedriverVersion: 105.0.5195.52 (412c95e51883..., userDataDir: /tmp/.org.chromium.Chromium...}, goog:chromeOptions: {debuggerAddress: localhost:43551}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: LINUX, proxy: Proxy(), se:cdp: http://localhost:43551, se:cdpVersion: 105.0.5195.52, se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.2:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
issue1677-selenium-1  | 15:33:43.666 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: 5f40222b3ca95a53d0086f9880b5b451 
issue1677-selenium-1  |  Caps: Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 105.0.5195.52, chrome: {chromedriverVersion: 105.0.5195.52 (412c95e51883..., userDataDir: /tmp/.org.chromium.Chromium...}, goog:chromeOptions: {debuggerAddress: localhost:43551}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: LINUX, proxy: Proxy(), se:cdp: ws://172.18.0.2:4444/sessio..., se:cdpVersion: 105.0.5195.52, se:vnc: ws://172.18.0.2:4444/sessio..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.2:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
issue1677-app-1 exited with code 0

At the end, I see the screenshot file in the app folder:
Screenshot 2022-09-18 at 9 10 34 PM

I'm not able to replicate your scenario. Here are some thoughts I have on this:

  1. I realized I'm running on an ARM architecture, so the setup is not exactly the same as yours. I'll try this same scenario in GitPod tomorrow on an x86_64 environment.

  2. the requirements file is missing in my scenario. In the meantime, can you check your requirements file and see if it looks ok? Maybe try pip install selenium like I did and avoid installing Python dependencies using requirements to see if this helps isolate the issue.

@NicoCaldo
Copy link
Author

requirements.txt is pretty simple as it contains only two lines

selenium
beautifulsoup4

I'm running Ubuntu on a Virtual Machine on VMWare with 8Gb and quad-core.
I'm also using Visual Studio Code terminal to launch the commands so, could it be the issue?

Versione: 1.71.2
Commit: 74b1f979648cc44d385a2286793c226e611f59e7
Data: 2022-09-14T21:12:14.256Z
Electron: 19.0.12
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
Sistema operativo: Linux x64 5.15.0-47-generic
In modalità sandbox: No

Also, I'm using docker-compose version 1.29.2, build unknown and Docker version 20.10.18, build b40c2f6

Adding RUN pip install selenium on the Dockerfile resulted in the same error

I've also noticed that if I let run enough time the container, it rise the following error

[urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='172.18.0.2', port=4444): Max retries exceeded with url: /wd/hub/session](urllib3.exceptions.maxretryerror: httpconnectionpool(host='172.18.0.2', port=4444): max retries exceeded with url: /wd/hub/session (caused by connecttimeouterror(<urllib3.connection.httpconnection object at 0x7f85ac015900>, 'connection to 172.18.0.2 timed out.)

@jamesmortensen
Copy link
Member

@NicoCaldo I just tried on GitPod (x86_64 with the following docker-compose) and I got the screenshot:

version: '3'

services:
  selenium:
    image: selenium/standalone-chrome
    ports:
      - 4444:4444
    restart: always

  app:
    build:
      context: .
    volumes:
      - ./app:/app
    command: sh -c "python3 bot.py"
    depends_on:
      - selenium

Can you check without requirements.txt?

@NicoCaldo
Copy link
Author

Switched image: selenium/standalone-chrome with image: seleniarm/standalone-chromium and got the same error without using the requirements.txt

@jamesmortensen
Copy link
Member

I'm trying to think of other things to cut out in order to simplify. What if you do try launching from the native terminal instead of VSCode? Also, is this VSCode inside the Ubuntu VM or VSCode on the host? When I launched docker compose I did so from within the VMs.

Does the Ubuntu VM have a GUI? I had tried with Ubuntu LXDE desktop.

@NicoCaldo
Copy link
Author

NicoCaldo commented Sep 19, 2022

I've tried to launch it from the native terminal using sudo as well. Same issue. VSCode is inside the Ubuntu VM. Yes I have installed the standard Ubuntu Desktop

I think it could be some network configuration within Docker or the VM given the error urllib3.exceptions.MaxRetryError

I'll try to run the same config within Windows 10

Is there some kind of log I can share of the Selenium Grid execution?

@NicoCaldo
Copy link
Author

On another note, I've seen that the code

volumes:
      - ./app:/app

seems to not create any volumes. I've also tried to launch docker compose up but got the same issue

@jamesmortensen
Copy link
Member

Can you ssh into the container and touch testfile to see if you can create a file in the app folder and then look for the file on the host. For me, the screenshots were saved in ./app on the host.

You mentioned you suspected the network. Can you change the network mode from bridged to shared or shared to NAT and see if that yields different results?

Also, what do you think about creating an Ubuntu VM with VirtualBox or UTM? I use UTM and was running Debian 11.3. Also, GitPod runs Ubuntu 22.04. Even if you want or need to run VMware, we might learn something helpful by attempting to run the services via other platforms.

@manolinux
Copy link

manolinux commented Sep 20, 2022

Observing the same. Nothing appears in logs. Nevertheless, sessions are queued but not started. Chromedriver seems not to be spawned. After some minutes, selenium server returns timeout and remote python client receives no clue but a stacktrace from Java which says nothing meaninful (just blocked in addToQueue method).

Selenium server 4.4.0, chromedriver 105.0.595.19, inside a docker container, using selenium/standalone-chrome latest, beta and dev images.

But linux x86-64 arch.

@jamesmortensen
Copy link
Member

Does this happen with older versions of Selenium or just 4.4.0? Anything else you can think of that would help me replicate the issue?

@NicoCaldo
Copy link
Author

I've tried on another VM on VMware running 20.04.5 LTS with Gnome 3.36.8, Docker 20.10.18 build b40c2f6 and VSC 1.71.2 and everything went smooth. Bridge connection as well

@jamesmortensen
Copy link
Member

That seems to support your thoughts that it's some kind of network problem. In the meantime, are you able to operate with that VM instead of the one where it wasn't working?

@NicoCaldo
Copy link
Author

NicoCaldo commented Sep 20, 2022

That seems to support your thoughts that it's some kind of network problem. In the meantime, are you able to operate with that VM instead of the one where it wasn't working?

yeah definitely! Still troubleshooting the one that is not working maybe we can find why

EDIT

For some strange reason now it worked on the other VM as well. The only thing I have done has been to uninstall AppArmor with sudo apt-get purge --auto-remove AppArmor and then delete all the existing container/image with docker system prune --all --volumes

Then I restarted the machine and built again the container with docker compose up

Some issues with AppArmor?

@manolinux
Copy link

Does this happen with older versions of Selenium or just 4.4.0? Anything else you can think of that would help me replicate the issue?

Just disabled

Does this happen with older versions of Selenium or just 4.4.0? Anything else you can think of that would help me replicate the issue?

Hey, thanks a lot for contacting. Checked the comment below mine, checked whether it was an AppArmor issue, disabled it and now it works. At least in my case that seemed to be the root cause!

@manolinux
Copy link

That seems to support your thoughts that it's some kind of network problem. In the meantime, are you able to operate with that VM instead of the one where it wasn't working?

yeah definitely! Still troubleshooting the one that is not working maybe we can find why

EDIT

For some strange reason now it worked on the other VM as well. The only thing I have done has been to uninstall AppArmor with sudo apt-get purge --auto-remove AppArmor and then delete all the existing container/image with docker system prune --all --volumes

Then I restarted the machine and built again the container with docker compose up

Some issues with AppArmor?

I can confirm I had same issues, disabled AppArmor and now selenium server works fine.

@jamesmortensen
Copy link
Member

Ok. Looks like you both found the cause.

I'm not sure what, if any, security implications you might be facing for completely disabling AppArmor, but Docker maintains some documentation on AppArmor Security Profiles for Docker if you want to dig into this more to ensure you balance security with usability.

@NicoCaldo
Copy link
Author

I think the best solution at this point is to disable AppArmour for the selenium-standalone Docker container or to disbale for Docker itself. I'll look into it

In any case, there's to understand why AppArmour interfere with this type of container or Docker itself

@jamesmortensen
Copy link
Member

Since it sounds like the issue is with AppArmor interfering with Docker, and not an issue with docker-selenium specifically, I'll close this issue. But please so come back if you face other issues.

@hopeseekr
Copy link

This has been plaguing my life. AppArmor is required by snapd. I'm stuck.

@jamesmortensen
Copy link
Member

@hopeseekr Lots of folks have said Selenium and WebDrivers don't play nice with tools using snapd. Are there alternatives you can use?

Copy link

github-actions bot commented Dec 9, 2023

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.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants