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

[🐛 Bug]: Language is hardcoded in generated wrapper scripts

Open adrianhj opened this issue 3 years ago • 2 comments

What happened?

With recent changes to the Docker images our test-suites began failing due to incorrect formatting of dates within our application; we temporarily pinned back to the latest working version whilst investigating.

Reviewing recent changes, https://github.com/SeleniumHQ/docker-selenium/pull/1778 seems to be the culprit.

The changes to the wrap_*_binary scripts evaluate LANGUAGE outside of the generated script and do not escape variables within the heredoc causing it to hard-code the default LANGUAGE provided by the underlying image (en_US.UTF8) in the generated wrapper script.

Command used to start Selenium Grid with Docker

Using `selenium-chrome` stand-alone image.

version: "3.7"
services:
  selenium-chrome:
    image: selenium/standalone-chrome:latest
    volumes:
      - /dev/shm:/dev/shm
    environment:
      - LANGUAGE=en_GB.UTF8
      - SCREEN_WIDTH=1920
      - SCREEN_HEIGHT=1080
      - SE_SESSION_REQUEST_TIMEOUT=500
      - SE_NODE_MAX_SESSIONS=2
      - SE_NODE_OVERRIDE_MAX_SESSIONS=true
      - SE_NODE_SESSION_TIMEOUT=500
    profiles:
      - chrome

Relevant log output

$ docker run -it --rm selenium/standalone-chrome:110.0 cat /usr/bin/google-chrome

Unable to find image 'selenium/standalone-chrome:110.0' locally
110.0: Pulling from selenium/standalone-chrome
Digest: sha256:df7472a13463ff5e5e444bb485460ba1082c779469cbaa1f86b54997335761eb
Status: Downloaded newer image for selenium/standalone-chrome:110.0

#!/bin/bash

# umask 002 ensures default permissions of files are 664 (rw-rw-r--) and directories are 775 (rwxrwxr-x).
umask 002

# Set language environment variable
export LANGUAGE="en_US.UTF-8"

# Note: exec -a below is a bashism.
exec -a "$0" "/opt/google/chrome/google-chrome-base" --no-sandbox "$@"

Operating System

Linux

Docker Selenium version (tag)

110.0-20230210

adrianhj avatar Feb 13 '23 13:02 adrianhj

Fixed by #1789

jamesmortensen avatar Feb 16 '23 05:02 jamesmortensen

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 Dec 09 '23 00:12 github-actions[bot]