{"record":{"id":"45c30989c39026bf","repo":"openclaw/openclaw","slug":"managed-profile-into-is-not-owned-by-this-ope","errorCode":null,"errorMessage":"managed profile \"${into}\" is not owned by this OpenClaw browser runtime; stop it and import into a fresh profile name","messagePattern":"managed profile \"(.+?)\" is not owned by this OpenClaw browser runtime; stop it and import into a fresh profile name","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/browser/src/browser/system-profiles.ts","lineNumber":220,"sourceCode":"  ) {\n    throw new Error(\n      `profile \"${into}\" is not a locally managed OpenClaw profile; import into a fresh profile name`,\n    );\n  }\n  for (let attempt = 0; attempt < 2; attempt += 1) {\n    try {\n      return await runProfileContextOperation(\n        profileCtx,\n        runtime.signal,\n        async (signal, profileRuntime) => {\n          await profileCtx.ensureBrowserAvailable({ headless: true, signal });\n          const userDataDir = resolveOpenClawUserDataDir(into);\n          const runningUserDataDir = profileRuntime.running?.userDataDir;\n          if (\n            !runningUserDataDir ||\n            path.resolve(runningUserDataDir) !== path.resolve(userDataDir)\n          ) {\n            throw new Error(\n              `managed profile \"${into}\" is not owned by this OpenClaw browser runtime; stop it and import into a fresh profile name`,\n            );\n          }\n          if (!usesOpenClawMockKeychain(userDataDir)) {\n            throw new Error(\n              `managed profile \"${into}\" does not use the OpenClaw mock keychain; import into a fresh profile name`,\n            );\n          }\n\n          const copied = snapshotCookieDatabase(cookiesFile);\n          try {\n            const decrypted = await readChromeCookiesDatabase({\n              browser,\n              databasePath: copied.databasePath,\n              domains: params.domains,\n              readSecret: deps.readSecret,\n              signal,\n            });","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/browser/src/browser/system-profiles.ts#L202-L238","documentation":"The destination profile is OpenClaw-managed but the running browser's userDataDir does not match resolveOpenClawUserDataDir(into). A different OpenClaw runtime instance owns this profile, so injecting cookies into the current process would not affect the actual running browser.","triggerScenarios":"Two gateway/runtime processes pointing at overlapping state; a stale running profile whose userDataDir was changed or resolved under a different OPENClaw state dir; profileRuntime.running is null (browser not actually running for this profile context).","commonSituations":"Concurrent gateway instances sharing profiles; manual browser launch with a custom user-data-dir; state directory changed between profile creation and import.","solutions":["Stop the other runtime that owns this profile (or stop all gateway instances) and retry.","Import into a fresh profile name so the current runtime mints and owns the userDataDir.","Confirm OPENClaw state dir is consistent across invocations so resolveOpenClawUserDataDir resolves the same path."],"exampleFix":"// before: another runtime owns 'imported'\nawait importSystemProfileCookies({ systemProfile: 'Default', into: 'imported' });\n\n// after: stop conflicting runtime, then use a fresh name\nawait stopGateway();\nawait importSystemProfileCookies({ systemProfile: 'Default', into: 'cookies-fresh' });","handlingStrategy":"validation","validationCode":"const profileCtx = runtime.ctx.forProfile(into);\nconst expected = path.resolve(resolveOpenClawUserDataDir(into));\nconst running = profileCtx.runtime?.running?.userDataDir;\nif (!running || path.resolve(running) !== expected) {\n  throw new Error(`Another runtime owns \"${into}\". Stop it or use a fresh name.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importSystemProfileCookies({ systemProfile: 'Default', into });\n} catch (err) {\n  if (err instanceof Error && /not owned by this OpenClaw browser runtime/.test(err.message)) {\n    await stopBrowserControlRuntime({ requestedBy: 'service', onWarn: () => {} });\n    into = `imported-${Date.now()}`;\n    await importSystemProfileCookies({ systemProfile: 'Default', into });\n  } else {\n    throw err;\n  }\n}","preventionTips":["Run a single gateway/runtime per state directory to avoid ownership splits.","Use fresh profile names for import so ownership is unambiguous.","Confirm the OPENClaw state dir is consistent across invocations."],"tags":["browser","profile","runtime","concurrency","ownership"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}