{"record":{"id":"aefb65eb65b1070c","repo":"louislam/uptime-kuma","slug":"e-message","errorCode":null,"errorMessage":"${e.message}","messagePattern":"\\$\\{e\\.message\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/monitor-types/real-browser-monitor-type.js","lineNumber":228,"sourceCode":"/**\n * Test if the chrome executable is valid and return the version\n * @param {string} executablePath Path to executable\n * @returns {Promise<string>} Chrome version\n */\nasync function testChrome(executablePath) {\n    try {\n        executablePath = await prepareChromeExecutable(executablePath);\n\n        log.info(\"chromium\", \"Testing Chromium executable: \" + executablePath);\n\n        const browser = await chromium.launch({\n            executablePath,\n        });\n        const version = browser.version();\n        await browser.close();\n        return version;\n    } catch (e) {\n        throw new Error(e.message);\n    }\n}\n// test remote browser\n/**\n * @param {string} remoteBrowserURL Remote Browser URL\n * @returns {Promise<boolean>} Returns if connection worked\n */\nasync function testRemoteBrowser(remoteBrowserURL) {\n    try {\n        const browser = await chromium.connect(remoteBrowserURL);\n        browser.version();\n        await browser.close();\n        return true;\n    } catch (e) {\n        throw new Error(e.message);\n    }\n}\nclass RealBrowserMonitorType extends MonitorType {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/monitor-types/real-browser-monitor-type.js#L210-L246","documentation":"testChrome() runs the full prepareChromeExecutable flow then launches Chromium headless with the resolved path and reads browser.version() to confirm it works. Any failure (launch error, missing shared library, sandbox issue) is caught and re-thrown as a new Error carrying only e.message. This is the 'test this executable' diagnostic path used from the settings UI.","triggerScenarios":"chromium.launch throws: missing system libraries (libnss, libatk, libgbm), sandbox/permissions issue requiring --no-sandbox, incompatible architecture, broken executable, or version read failure.","commonSituations":"Running as root in a container without --no-sandbox, missing runtime deps on slim images, ARM binaries on x86, or a stale puppeteer/playwright browsers cache.","solutions":["Install Chromium runtime libraries: apt install libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 libcairo2 libasound2.","Run the container unprivileged, or pass the appropriate sandbox flags the monitor applies.","Re-run with a known-good Chromium path to isolate executable vs environment.","Check dmesg/journal for OOM or seccomp kills of the chromium process."],"exampleFix":"# before\nchromium.launch fails: error while loading shared libraries: libnss3.so\n# after\napt-get install -y libnss3 libatk1.0-0 libgbm1","handlingStrategy":"try-catch","validationCode":"const { existsSync } = require('fs');\nfunction preflightExecutable(path) {\n  if (!path || !existsSync(path)) throw new Error(`Executable missing: ${path}`);\n  // Best-effort deps hint for Linux\n  if (process.platform === 'linux') console.warn('Ensure libnss3 libgbm1 libatk-bridge2.0-0 libasound2 are installed');\n}","typeGuard":"function looksLikeChromeError(msg) { return /shared lib|sandbox|DevToolsActivePort|chrome/i.test(msg); }","tryCatchPattern":"try {\n  const v = await testChrome(executablePath);\n} catch (e) {\n  if (/error while loading shared libraries/.test(e.message)) {\n    log.error('Install missing Chromium runtime libraries');\n  } else if (/sandbox|SECCOMP/.test(e.message)) {\n    log.error('Run unprivileged or apply --no-sandbox equivalent');\n  }\n  throw e;\n}","preventionTips":["Bake Chromium's runtime deps into the base image.","Run the testChrome diagnostic in CI to catch env regressions.","Pin Chromium + libs together to avoid ABI drift."],"tags":["chromium","playwright","native-deps","diagnostics"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}