SeleniumHQ / docker-selenium

Provides a simple way to run Selenium Grid with Chrome, Firefox, and Edge using Docker, making it easier to perform browser automation
http://www.selenium.dev/docker-selenium/
Other
7.97k stars 2.51k forks source link

[🐛 Bug]: Firefox suddenly asking me for my 'Primary Password' #2333

Closed MJB222398 closed 3 months ago

MJB222398 commented 3 months ago

What happened?

I was on version 4.21.0-20240522 of Firefox node but just upgraded to 4.23.0-20240727. Since upgrading I now see this pop up when I launch Firefox:

image

Is this expected? What has changed? I assume I can disable this by use of some arguments/profile but I wanted to query it with you guys to see if you were expecting it.

Command used to start Selenium Grid with Docker (or Kubernetes)

# To execute this docker-compose yml file use `docker-compose -f docker-compose.yml up`
# Add the `-d` flag at the end for detached execution
# To stop the execution, hit Ctrl+C, and then `docker-compose -f docker-compose.yml down`
version: "3"
services:
  firefox:
    image: selenium/node-firefox:4.23.0-20240727
    container_name: firefox-node
    shm_size: 2gb
    privileged: true
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - SE_EVENT_BUS_HOST=selenium-hub
      - SE_EVENT_BUS_PUBLISH_PORT=4442
      - SE_EVENT_BUS_SUBSCRIBE_PORT=4443
      - SE_NODE_MAX_SESSIONS=1
      - SE_NODE_GRID_URL=http://localhost:4444
      - SE_NODE_SESSION_TIMEOUT=180
    ports:
      - "6902:5900"
    volumes:
      - ./zscaler:/zscaler
      - ./firefox:/selenium/firefox
    command:
      - /bin/bash
      - -c
      - |
        sh /zscaler/zscaler.sh
        sh /selenium/firefox/profile-setup.sh
        sh /opt/bin/entry_point.sh
    networks:
      - selenium_grid_internal

  firefox_video:
    image: selenium/video:ffmpeg-7.0.1-20240727
    container_name: firefox-video
    privileged: true
    user: ${UID}
    volumes:
      - ${VIDEOS_DIRECTORY:-./videos}:/videos
    depends_on:
      - firefox
    environment:
      - DISPLAY_CONTAINER_NAME=firefox
      - FILE_NAME=firefox_video.mp4
    networks:
      - selenium_grid_internal

  selenium-hub:
    image: selenium/hub:4.23.0-20240727
    privileged: true
    user: ${UID}
    container_name: selenium-hub
    hostname: selenium-hub
    ports:
      - "4442:4442"
      - "4443:4443"
      - "4444:4444"
    environment:
      - GRID_TIMEOUT=120000
      - GRID_BROWSER_TIMEOUT=120000
    networks:
      - selenium_grid_internal

networks:
  selenium_grid_internal:

Relevant log output

Logs from the docker container:

2024-07-29 12:29:03,267 INFO Included extra file "/etc/supervisor/conf.d/firefox-cleanup.conf" during parsing
2024-07-29 12:29:03,267 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2024-07-29 12:29:03,270 INFO RPC interface 'supervisor' initialized
2024-07-29 12:29:03,271 INFO supervisord started with pid 8
2024-07-29 12:29:04,273 INFO spawned: 'xvfb' with pid 1172
2024-07-29 12:29:04,273 INFO spawned: 'vnc' with pid 1173
2024-07-29 12:29:04,274 INFO spawned: 'novnc' with pid 1174
2024-07-29 12:29:04,275 INFO spawned: 'selenium-node' with pid 1175
2024-07-29 12:29:04,285 INFO success: selenium-node entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Appending Selenium options: --log-level CONFIG
Appending Selenium options: --session-timeout 180
Appending Selenium options: --heartbeat-period 30
Generating Selenium Config
Configuring server...
Setting up SE_NODE_HOST...
Setting up SE_NODE_PORT...
Tracing is disabled
Selenium Grid Node configuration: 
[events]
publish = "tcp://selenium-hub:4442"
subscribe = "tcp://selenium-hub:4443"

[node]
grid-url = "http://localhost:4444"
session-timeout = "180"
override-max-sessions = false
detect-drivers = false
drain-after-session-count = 0
max-sessions = 1

[[node.driver-configuration]]
display-name = "firefox"
stereotype = '{"browserName": "firefox", "browserVersion": "128.0", "platformName": "Linux", "moz:firefoxOptions": {"binary": "/usr/bin/firefox"}, "se:containerName": ""}'
max-sessions = 1

Starting Selenium Grid Node...
12:29:04.892 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
12:29:04.897 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
12:29:05.003 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://selenium-hub:4442 and tcp://selenium-hub:4443
12:29:05.032 INFO [UnboundZmqEventBus.<init>] - Sockets created
2024-07-29 12:29:05,290 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-07-29 12:29:05,290 INFO success: vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2024-07-29 12:29:05,290 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
12:29:06.033 INFO [UnboundZmqEventBus.<init>] - Event bus ready
12:29:06.100 INFO [NodeServer.createHandlers] - Reporting self as: http://172.18.0.6:5555
12:29:06.111 INFO [NodeOptions.getSessionFactories] - Detected 20 available processors
12:29:06.147 INFO [NodeOptions.report] - Adding firefox for {"browserName": "firefox","browserVersion": "128.0","moz:firefoxOptions": {"binary": "\u002fusr\u002fbin\u002ffirefox"},"platformName": "linux","se:containerName": "","se:noVncPort": 7900,"se:vncEnabled": true} 1 times
12:29:06.160 INFO [Node.<init>] - Binding additional locator mechanisms: relative
12:29:06.266 INFO [NodeServer$1.start] - Starting registration process for Node http://172.18.0.6:5555
12:29:06.267 INFO [NodeServer.execute] - Started Selenium node 4.23.0 (revision 77010cd): http://172.18.0.6:5555
12:29:06.278 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
12:29:06.374 INFO [NodeServer.lambda$createHandlers$2] - Node has been added
12:32:50.868 WARN [DriverServiceSessionFactory.apply] - Error while creating session with the driver service. Stopping driver service: java.util.concurrent.TimeoutException
Build info: version: '4.23.0', revision: '77010cd'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.146.1-microsoft-standard-WSL2', java.version: '17.0.11'
Driver info: driver.version: unknown
org.openqa.selenium.TimeoutException: java.util.concurrent.TimeoutException
Build info: version: '4.23.0', revision: '77010cd'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.146.1-microsoft-standard-WSL2', java.version: '17.0.11'
Driver info: driver.version: unknown
    at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:399)
    at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
    at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
    at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:355)
    at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:89)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
    at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:161)
    at org.openqa.selenium.grid.node.config.DriverServiceSessionFactory.apply(DriverServiceSessionFactory.java:71)
    at org.openqa.selenium.grid.node.local.SessionSlot.apply(SessionSlot.java:147)
    at org.openqa.selenium.grid.node.local.LocalNode.newSession(LocalNode.java:469)
    at org.openqa.selenium.grid.node.NewNodeSession.execute(NewNodeSession.java:50)
    at org.openqa.selenium.remote.http.Route$TemplatizedRoute.handle(Route.java:192)
    at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
    at org.openqa.selenium.grid.security.RequiresSecretFilter.lambda$apply$0(RequiresSecretFilter.java:62)
    at org.openqa.selenium.remote.tracing.SpanWrappedHttpHandler.execute(SpanWrappedHttpHandler.java:87)
    at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
    at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)
    at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
    at org.openqa.selenium.grid.node.Node.execute(Node.java:270)
    at org.openqa.selenium.remote.http.Route$CombinedRoute.handle(Route.java:360)
    at org.openqa.selenium.remote.http.Route.execute(Route.java:69)
    at org.openqa.selenium.remote.AddWebDriverSpecHeaders.lambda$apply$0(AddWebDriverSpecHeaders.java:35)
    at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
    at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
    at org.openqa.selenium.remote.ErrorFilter.lambda$apply$0(ErrorFilter.java:44)
    at org.openqa.selenium.remote.http.Filter$1.execute(Filter.java:63)
    at org.openqa.selenium.netty.server.SeleniumHandler.lambda$channelRead0$0(SeleniumHandler.java:44)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.util.concurrent.TimeoutException
    at java.base/java.util.concurrent.CompletableFuture.timedGet(CompletableFuture.java:1960)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2095)
    at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:382)
    ... 33 more

Logs from the Selenium Driver:

2024-07-29 13:29:50.615 DEBUG HttpCommandExecutor: Executing command: []: newSession {"capabilities":{"firstMatch":[{"browserName":"firefox","moz:firefoxOptions":{"args":["-profile","home/seluser/.mozilla/firefox/seluser_profile"],"prefs":{"remote.active-protocols":3}},"moz:debuggerAddress":true}]}}
2024-07-29 13:29:50.620 TRACE HttpCommandExecutor: >> Method: POST, RequestUri: 'http://localhost:4444/wd/hub/session', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:
{
  Accept: application/json; charset=utf-8
  User-Agent: selenium/4.23.0
  User-Agent: (.net windows)
  Content-Type: application/json; charset=utf-8
  Content-Length: 215
}
{"capabilities":{"firstMatch":[{"browserName":"firefox","moz:firefoxOptions":{"args":["-profile","home/seluser/.mozilla/firefox/seluser_profile"],"prefs":{"remote.active-protocols":3}},"moz:debuggerAddress":true}]}}
2024-07-29 13:32:50.700 TRACE HttpCommandExecutor: << StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:
{
  Cache-Control: no-cache
  Content-Length: 2750
  Content-Type: application/json; charset=utf-8
}
{
  "value": {
    "error": "session not created",
    "message": "Could not start a new session. java.util.concurrent.TimeoutException\nBuild info: version: '4.23.0', revision: '77010cd'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.146.1-microsoft-standard-WSL2', java.version: '17.0.11'\nDriver info: driver.version: unknown \nHost info: host: 'selenium-hub', ip: '172.18.0.2'",
    "stacktrace": [
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "nativeMethod": false,
        "moduleName": null,
        "methodName": "startSession",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor",
        "lineNumber": 658,
        "classLoaderName": "app"
      },
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "nativeMethod": false,
        "moduleName": null,
        "methodName": "newSession",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor",
        "lineNumber": 573,
        "classLoaderName": "app"
      },
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "nativeMethod": false,
        "moduleName": null,
        "methodName": "handleNewSessionRequest",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable",
        "lineNumber": 836,
        "classLoaderName": "app"
      },
      {
        "fileName": "LocalDistributor.java",
        "moduleVersion": null,
        "nativeMethod": false,
        "moduleName": null,
        "methodName": "lambda$run$1",
        "className": "org.openqa.selenium.grid.distributor.local.LocalDistributor$NewSessionRunnable",
        "lineNumber": 793,
        "classLoaderName": "app"
      },
      {
        "fileName": "ThreadPoolExecutor.java",
        "moduleVersion": "17.0.11",
        "nativeMethod": false,
        "moduleName": "java.base",
        "methodName": "runWorker",
        "className": "java.util.concurrent.ThreadPoolExecutor",
        "lineNumber": 1136,
        "classLoaderName": null
      },
      {
        "fileName": "ThreadPoolExecutor.java",
        "moduleVersion": "17.0.11",
        "nativeMethod": false,
        "moduleName": "java.base",
        "methodName": "run",
        "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
        "lineNumber": 635,
        "classLoaderName": null
      },
      {
        "fileName": "Thread.java",
        "moduleVersion": "17.0.11",
        "nativeMethod": false,
        "moduleName": "java.base",
        "methodName": "run",
        "className": "java.lang.Thread",
        "lineNumber": 840,
        "classLoaderName": null
      }
    ]
  }
}
2024-07-29 13:32:50.702 DEBUG HttpCommandExecutor: Response: ( SessionNotCreated: System.Collections.Generic.Dictionary`2[System.String,System.Object])

Operating System

Ubuntu 20.04

Docker Selenium version (image tag)

4.23.0-20240727

Selenium Grid chart version (chart version)

No response

github-actions[bot] commented 3 months ago

@MJB222398, 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!

diemol commented 3 months ago

That comes from the new Firefox version (128), and I see you are using a profile. You should check how the latest version affects the profile you use.

konatarar commented 2 months ago

Tuve el mismo problema con firefox (129), lo que hice fue trabajar en base a threads y pyautogui, cree un hilo donde se espera para mover el mouse y añadir la contraseña, dado que en mi caso trabajaba con certificados y si o si lo necesitaba(el primary key que en el fondo era la key de base) y el driver era bloqueante al momento de "crear la pestaña de firefox" entonces mientras no añadias la contraseña no iba a realizar ninguna accion. Espero te ilumine un poco

github-actions[bot] commented 1 month 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.