{"record":{"id":"0486cd74b447b811","repo":"Fosowl/agenticSeek","slug":"google-chrome-not-found-please-install-it","errorCode":null,"errorMessage":"Google Chrome not found. Please install it.","messagePattern":"Google Chrome not found\\. Please install it\\.","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"critical","filePath":"sources/browser.py","lineNumber":170,"sourceCode":"    \"\"\"\n    This is a fallback for stealth mode to bypass SSL verification. Which can fail on some setup.\n    \"\"\"\n    pretty_print(\"Bypassing SSL verification issues, we strongly advice you update your certifi SSL certificate.\", color=\"warning\")\n    ssl._create_default_https_context = ssl._create_unverified_context\n\ndef get_free_port() -> int:\n    \"\"\"Find and return a free TCP port on the local machine.\"\"\"\n    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:\n        s.bind(('', 0))\n        return s.getsockname()[1]\n\ndef create_chrome_options(headless=False, stealth_mode=True, crx_path=\"./crx/nopecha.crx\", lang=\"en\") -> Options:\n    \"\"\"Create Chrome options - separated for reusability.\"\"\"\n    chrome_options = Options()\n    chrome_path = get_chrome_path()\n    \n    if not chrome_path:\n        raise FileNotFoundError(\"Google Chrome not found. Please install it.\")\n    chrome_options.binary_location = chrome_path\n    \n    if headless:\n        chrome_options.add_argument(\"--headless=new\")\n        chrome_options.add_argument(\"--disable-gpu\")\n        chrome_options.add_argument(\"--disable-webgl\")\n    \n    user_agent = get_random_user_agent()\n    width, height = (1920, 1080)\n    profile_dir = f\"/tmp/chrome_profile_{uuid.uuid4().hex[:8]}\"\n    \n    # Core options\n    chrome_options.add_argument(\"--no-sandbox\")\n    chrome_options.add_argument('--disable-dev-shm-usage')\n    chrome_options.add_argument(f'--user-data-dir={profile_dir}')\n    chrome_options.add_argument(f\"--accept-lang={lang}-{lang.upper()},{lang};q=0.9\")\n    chrome_options.add_argument(\"--disable-extensions\")\n    chrome_options.add_argument(\"--disable-background-timer-throttling\")","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/Fosowl/agenticSeek/blob/ae57a2357745a9706cb12d0fd76d954c84d166fa/sources/browser.py#L152-L188","documentation":"create_chrome_options() resolves the Chrome browser binary via get_chrome_path(); if no Chrome installation is found it raises this FileNotFoundError before building Options. It is called by both create_driver and create_undetected_chromedriver, so any browser automation path requires Google Chrome (or a compatible Chromium the helper detects) to be present.","triggerScenarios":"Calling create_driver() or create_undetected_chromedriver() on a machine where get_chrome_path() returns None — Google Chrome not installed, installed in a non-standard location, or only Chromium/another browser present that the lookup does not check.","commonSituations":"CI/headless Linux containers or servers without a desktop browser; fresh machines where only Firefox/Chromium is installed; macOS/Windows non-default install paths; Docker images missing the Chrome dependency.","solutions":["Install Google Chrome (stable) for your platform and retry.","If Chrome is installed elsewhere, ensure it is on PATH or set the binary location the helper checks (e.g. chrome_options.binary_location / CHROME_PATH env) to the full executable path.","In Docker, use a base image with Chrome or add it to the Dockerfile and required OS libs.","As a last resort, patch/point get_chrome_path() to a Chromium binary compatible with the automation flow."],"exampleFix":"// before\ndriver = create_driver()  # FileNotFoundError: Google Chrome not found\n// after\nwget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb\napt-get install -y ./google-chrome-stable_current_amd64.deb\ndriver = create_driver()","handlingStrategy":"validation","validationCode":"import shutil\ndef chrome_installed() -> bool:\n    return any(shutil.which(b) for b in (\n        \"google-chrome\", \"google-chrome-stable\", \"chrome\",\n        \"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome\"))\nif not chrome_installed():\n    raise SystemExit(\"Install Google Chrome before running browser automation\")\ndriver = create_driver()","typeGuard":null,"tryCatchPattern":"try:\n    driver = create_driver()\nexcept FileNotFoundError as e:\n    if \"Google Chrome not found\" in str(e):\n        raise SystemExit(\"Install Google Chrome: https://www.google.com/chrome/\") from e\n    raise","preventionTips":["Install google-chrome-stable in CI images and Dockerfiles used for automation.","Keep Chrome on PATH or in its platform-default install location.","In Docker, include required OS dependencies (libnss3, libgbm, fonts) alongside the Chrome package.","For non-standard installs, set the binary path explicitly via the browser options/CHROME_PATH."],"tags":["selenium","chrome","environment","browser"],"backgroundTag":"chrome-binary-not-found","analyzedSha":"ae57a2357745a9706cb12d0fd76d954c84d166fa","analyzedAt":"2026-08-30T02:49:05.834Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}