{"record":{"id":"f622802e884479c4","repo":"garrytan/gstack","slug":"browser-running","errorCode":"browser_running","errorMessage":"${browser.name} is running. Close it first so we can launch headless with your profile, or use /connect-chrome to control your real browser directly.","messagePattern":"(.+?) is running\\. Close it first so we can launch headless with your profile, or use /connect-chrome to control your real browser directly\\.","errorType":"exception","errorClass":"CookieImportError","httpStatus":null,"severity":"error","filePath":"browse/src/cookie-import-browser.ts","lineNumber":819,"sourceCode":"  domains: string[],\n  profile = 'Default',\n): Promise<ImportResult> {\n  if (domains.length === 0) return { cookies: [], count: 0, failed: 0, domainCounts: {} };\n  if (process.platform !== 'win32') {\n    throw new CookieImportError('CDP extraction is only needed on Windows', 'not_supported');\n  }\n\n  const browser = resolveBrowser(browserName);\n  const exePath = findBrowserExe(browser.name);\n  if (!exePath) {\n    throw new CookieImportError(\n      `Cannot find ${browser.name} executable. Install it or use /connect-chrome.`,\n      'not_installed',\n    );\n  }\n\n  if (await isBrowserRunning(browser.name)) {\n    throw new CookieImportError(\n      `${browser.name} is running. Close it first so we can launch headless with your profile, or use /connect-chrome to control your real browser directly.`,\n      'browser_running',\n      'retry',\n    );\n  }\n\n  // Must use the real user data dir — v20 ABE keys are path-bound\n  const dataDir = getDataDirForPlatform(browser, 'win32');\n  if (!dataDir) throw new CookieImportError(`No Windows data dir for ${browser.name}`, 'not_installed');\n  const userDataDir = path.join(getBaseDir('win32'), dataDir);\n\n  // Launch Chrome headless with remote debugging on the real profile.\n  //\n  // Security posture of the debug port:\n  //   - Chrome binds --remote-debugging-port to 127.0.0.1 by default. The\n  //     port is NOT exposed to the network. Baseline threat: a local\n  //     process running as the same user can connect.\n  //   - Port is randomized in [9222, 9321] to avoid collisions with other","sourceCodeStart":801,"sourceCodeEnd":837,"githubUrl":"https://github.com/garrytan/gstack/blob/94993f74012782fd94416dd44b8314f6363a13a4/browse/src/cookie-import-browser.ts#L801-L837","documentation":"Error \"${browser.name} is running. Close it first so we can launch headless with your profile, or use /connect-chrome to control your real browser directly.\" thrown in garrytan/gstack.","triggerScenarios":"Thrown at browse/src/cookie-import-browser.ts:819 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"94993f74012782fd94416dd44b8314f6363a13a4","analyzedAt":"2026-08-12T04:06:23.140Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}