Skip to content

[🐛 Bug]: Authentication error in standalone docker container #1551

@IamGroot19

Description

@IamGroot19

What happened?

Tried passing creds via SE_OPTS environment variable based on the comments mentioned in previous github issues (#1457 and #1449).

Was able to login to the UI successfully for the first time.

From the next time, no login prompt was asked. Also, the container logs started printing "Unauthorised requests".

I can obviously use a config.toml file to mount the creds into the docker container. But I was planning to use this method while deploying a helm since it's lesser work than modifying upstream helm charts.

Kindly help witth this issue.

Command used to start Selenium Grid with Docker

Ran a standalone container (having all the parts of selenium grid) - included auth as command line variables:

docker run -d -p 5555:4444 -p 7900:7900 --shm-size="2g" --name sel-monolith -e SE_OPTS="--username admin --password myStrongPassword"  selenium/standalone-firefox:4.1.3-20220405


### Relevant log output

```shell
Container logs are showing "unauthorised request" errors:

$ docker logs sel-monolith 
2022-04-18 10:36:59,856 INFO Included extra file "/etc/supervisor/conf.d/selenium.conf" during parsing
2022-04-18 10:36:59,858 INFO supervisord started with pid 8
2022-04-18 10:37:00,862 INFO spawned: 'xvfb' with pid 10
2022-04-18 10:37:00,866 INFO spawned: 'vnc' with pid 11
2022-04-18 10:37:00,869 INFO spawned: 'novnc' with pid 12
2022-04-18 10:37:00,873 INFO spawned: 'selenium-standalone' with pid 13
Appending Selenium options: --username admin --password myStrongPassword
2022-04-18 10:37:00,888 INFO success: xvfb entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2022-04-18 10:37:00,889 INFO success: vnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2022-04-18 10:37:00,889 INFO success: novnc entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2022-04-18 10:37:00,889 INFO success: selenium-standalone entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
Setting up SE_NODE_GRID_URL...
Selenium Grid Standalone configuration: 
[network]
relax-checks = true

[node]
session-timeout = "300"
override-max-sessions = false
detect-drivers = false
max-sessions = 1

[[node.driver-configuration]]
display-name = "firefox"
stereotype = '{"browserName": "firefox", "browserVersion": "99.0", "platformName": "Linux"}'
max-sessions = 1

Starting Selenium Grid Standalone...
10:37:01.500 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
10:37:01.505 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
10:37:02.183 INFO [Standalone.createHandlers] - Requiring authentication to connect
10:37:02.200 INFO [NodeOptions.getSessionFactories] - Detected 8 available processors
10:37:02.247 INFO [NodeOptions.report] - Adding firefox for {"browserVersion": "99.0","se:noVncPort": 7900,"browserName": "firefox","platformName": "Linux","se:vncEnabled": true} 1 times
10:37:02.261 INFO [Node.<init>] - Binding additional locator mechanisms: id, name, relative
10:37:02.287 INFO [GridModel.setAvailability] - Switching node f7413620-723b-4458-b2e1-bb89a8b412c8 (uri: http://172.17.0.5:4444) from DOWN to UP
10:37:02.287 INFO [LocalDistributor.add] - Added node f7413620-723b-4458-b2e1-bb89a8b412c8 at http://172.17.0.5:4444. Health check every 120s
10:37:02.457 INFO [Standalone.execute] - Started Selenium Standalone 4.1.3 (revision 7b1ebf28ef): http://172.17.0.5:4444
10:37:31.300 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (POST) /graphql
10:37:31.300 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (POST) /graphql
10:37:40.735 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /ui/index.html
10:37:42.032 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /ui/index.html
10:37:46.402 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /ui/index.html
10:38:58.987 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (POST) /graphql
10:38:58.990 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (POST) /graphql
10:38:59.274 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /ui/manifest.json
10:39:05.561 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /ui/manifest.json
10:39:17.945 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /ui/manifest.json
10:44:41.922 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /grid/console
10:44:49.898 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (GET) /ui/index.html
10:44:52.302 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (POST) /graphql
10:44:52.310 INFO [BasicAuthenticationFilter.lambda$apply$0] - Unauthorized request to (POST) /graphql


### Operating System

Linux Mint 20.2 (xfce)

### Docker Selenium version (tag)

selenium/standalone-firefox:4.1.3-20220405

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions