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.99k stars 2.51k forks source link

[🐛 Bug]: Base64 adds new line for username and password #2435

Closed bartse closed 1 month ago

bartse commented 1 month ago

What happened?

The default max column for base64 is 76 characters. When using longer passwords in combination with a longer username I noticed this causes issues in the graphql health check.

The fix would be to add -w 0 option to base64 to override the max column. I dont think there would be any other impact of adding this option?

Below is the output of distributorProbe.sh script in debug mode

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

global:
  seleniumGrid:
    stdoutProbeLog: true
basicAuth:
  create: false
  enabled: true
  nameOverride: some-external-secret

Relevant log output

+ max_time=3
+ retry_time=3
+ probe_name=Probe.Liveness
+ ts_format=+%T.%3N
+ ROUTER_CONFIG_DIRECTORY=/opt/bin
++ bash /opt/bin/routerGraphQLUrl.sh
+ GRID_GRAPHQL_URL=http://x.x.x.x:4444/graphql
++ echo -n someusername:uH9AowM32F3tfudXefv3p3X4CkB23sTi22DyF4dQJ39S5uku7q
++ base64
+ BASIC_AUTH='c29tZXVzZXJuYW1lOnVIOUFvd00zMkYzdGZ1ZFhlZnYzcDNYNENrQjIzc1RpMjJEeUY0ZFFKMzlT
NXVrdTdx'
+ '[' -z http://x.x.x.x:4444/graphql ']'
++ curl --noproxy '*' -m 3 -k -X POST -H 'Authorization: Basic c29tZXVzZXJuYW1lOnVIOUFvd00zMkYzdGZ1ZFhlZnYzcDNYNENrQjIzc1RpMjJEeUY0ZFFKMzlT
NXVrdTdx' -H 'Content-Type: application/json' --data '{"query":"{ grid { sessionCount } }"}' -s -o /dev/null -w '%{http_code}' http://x.x.x.x:4444/graphql
+ GRAPHQL_PRE_CHECK=400
+ '[' 400 -ne 200 ']'
++ date +%T.%3N
+ echo '10:33:35.211 DEBUG [Probe.Liveness] - GraphQL endpoint http://x.x.x.x:4444/graphql is not reachable. Status code: 400.'
10:33:35.211 DEBUG [Probe.Liveness] - GraphQL endpoint http://x.x.x.x:4444/graphql is not reachable. Status code: 400.
+ exit 1

Operating System

Kubernetes(EKS)

Docker Selenium version (image tag)

4.25.0-20241010

Selenium Grid chart version (chart version)

0.36.3

github-actions[bot] commented 1 month ago

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

VietND96 commented 1 month ago

This is an interesting case that I have yet to think about. Let me do a check and update all scripts could be impacted!

bartse commented 1 month ago

It definitely is a corner case 😬 . Thanks for checking!

VietND96 commented 1 month ago

The fix is available in chart version 0.36.4

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