Session not created: Chrome failed to start: exited normally. (session not created: DevToolsActivePort file doesn't exist)

Hi,

I am running my tests on pipeline. Below are configuration I used:

  • Image: katalonstudio/katalon:8.6.9
  • Command (configured correctly):
    katalonc.sh -runMode=console -projectPath=$CURRENT_DIR/my-app.prj -retry=0 -statusDelay=15 -testSuitePath=“Test Suites/Smoke/Smoke” -browserType=“galaxy s21 ultra 5g (HL)” -executionProfile=“XXX” -apiKey=XXX --config -proxy.auth.option=NO_PROXY -proxy.system.option=NO_PROXY -proxy.system.applyToDesiredCapabilities=true -webui.chrome.args=“–headless=new;–no-sandbox;–disable-dev-shm-usage;–disable-gpu;–remote-debugging-port=9222”…

The output of the katalonc in the pipeline is:

The Chrome and ChromeDriver are the same, I referred to the Getting the "DevToolsActivePort file doesn't exist" Error while running the test case by using the katalon Studio. - #4 by kazurayam, but it does not resolve my issue, I still encountered the error below:

Any idea on this?

Thanks.

1 Like

image

Do you actually have the Chrome binary at /opt/google/chrome/chrome on the machine you ran the pipieline? I guess that Chome might be installed somewhere else.

The “DevToolsActivePort file doesn’t exist” error in Katalon Studio/Docker typically occurs due to Chrome startup issues in headless mode.


1. Update Chrome Arguments

Modify your -webui.chrome.args to include mandatory flags for Docker:

bash

-webui.chrome.args="--no-sandbox;--disable-dev-shm-usage;--disable-gpu;--headless=new;--remote-debugging-port=9222;--remote-allow-origins=*;--disable-setuid-sandbox"
  • Key Fixes:
    • Add --remote-allow-origins=* to bypass Chrome 111+ security policies.
    • Use --disable-setuid-sandbox for Docker environments.

2. Verify Chrome & ChromeDriver Versions

Ensure compatibility between Chrome and ChromeDriver in the Docker image:

bash

# Add this to your Dockerfile
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
    apt install -y ./google-chrome-stable_current_amd64.deb && \
    CHROME_VERSION=$(google-chrome --version | awk '{print $3}') && \
    CHROMEDRIVER_VERSION=$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION%.*}) && \
    wget -q https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip && \
    unzip chromedriver_linux64.zip -d /usr/local/bin/

3. Configure Desired Capabilities

In your Katalon project’s Drivers/Chrome/Drivers folder:

  1. Create/update chrome-headless.properties:
headless=true
args=--no-sandbox,--disable-dev-shm-usage,--disable-gpu,--headless=new,--remote-debugging-port=9222,--remote-allow-origins=*

4. Update Katalon Image & Dependencies

Use a newer Katalon image with required dependencies:

FROM katalonstudio/katalon:10.2.0
RUN apt-get update && apt-get install -y \
    libgbm-dev \
    xvfb \
    && rm -rf /var/lib/apt/lists/*

5. Full Pipeline Command

bash

katalonc.sh -runMode=console \
  -projectPath=$CURRENT_DIR/my-app.prj \
  -retry=0 \
  -statusDelay=15 \
  -testSuitePath="Test Suites/Smoke/Smoke" \
  -browserType="Chrome" \  # Use "Chrome" instead of mobile device
  -executionProfile="XXX" \
  -apiKey=XXX \
  --config \
  -proxy.auth.option=NO_PROXY \
  -proxy.system.option=NO_PROXY \
  -proxy.system.applyToDesiredCapabilities=true \
  -webui.chrome.args="--no-sandbox;--disable-dev-shm-usage;--disable-gpu;--headless=new;--remote-debugging-port=9222;--remote-allow-origins=*"

6. Environment Variables

Add these to your Docker run command:

bash

-e DBUS_SESSION_BUS_ADDRESS=/dev/null \
-e DISPLAY=:99 \

Why This Works:

  1. --remote-allow-origins=*: Fixes Chrome 111+ security restrictions.
  2. Updated Image: Katalon 10.2.0 has better headless support.
  3. Dependencies: libgbm-dev and xvfb resolve graphics stack issues.
  4. Simplified Browser: Using “Chrome” instead of mobile emulation avoids conflicts.

Verify Fix:
Run a minimal test case in your pipeline:

groovy

// Verify Chrome launches
WebUI.openBrowser('')
WebUI.navigateToUrl('https://katalon.com')
WebUI.closeBrowser()