Help Needed: Chrome Not Starting in Headless Mode Inside Docker

55 views
Skip to first unread message

Guayo Mena

unread,
Nov 27, 2023, 12:01:35 AM11/27/23
to Selenium Users
Hi Everyone,

I'm facing a challenging issue with running Chrome in headless mode inside a Docker container for a Selenium-based project. Despite setting up Chrome and ChromeDriver correctly, Chrome fails to start, and I keep encountering a SessionNotCreatedException.

Context:

Running Chrome (119.0.6045.105) and ChromeDriver (119.0.6045.105) inside a Docker container.
Using Selenium in a Python environment.
Chrome is installed at /opt/chrome-linux64/chrome, and ChromeDriver at /usr/local/bin/chromedriver.
PATH and permissions are correctly set.
Despite the setup, Chrome fails to start in headless mode, throwing errors like "Chrome not reachable" and "DevToolsActivePort file doesn't exist." I've tried various flags like --no-sandbox, --disable-gpu, and setting a user data directory, but to no avail.

Has anyone faced a similar issue or can offer insights into what might be going wrong? Any help or suggestions would be greatly appreciated!

Thank you in advance!

selenium 4.14.0
python 3.9-slim

Linux (in a docker container):
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Reply all
Reply to author
Forward
0 new messages