docker-selenium icon indicating copy to clipboard operation
docker-selenium copied to clipboard

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

Open bartse opened this issue 1 year ago • 3 comments

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

bartse avatar Oct 21 '24 10:10 bartse

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

github-actions[bot] avatar Oct 21 '24 10:10 github-actions[bot]

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

VietND96 avatar Oct 21 '24 12:10 VietND96

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

bartse avatar Oct 21 '24 13:10 bartse

The fix is available in chart version 0.36.4

VietND96 avatar Oct 22 '24 09:10 VietND96

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[bot] avatar Nov 22 '24 00:11 github-actions[bot]