openclaw/openclaw · error · Error

managed profile "${into}" is not owned by this OpenClaw brow

Error message

managed profile "${into}" is not owned by this OpenClaw browser runtime; stop it and import into a fresh profile name

What it means

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.

Source

Thrown at extensions/browser/src/browser/system-profiles.ts:220

  ) {
    throw new Error(
      `profile "${into}" is not a locally managed OpenClaw profile; import into a fresh profile name`,
    );
  }
  for (let attempt = 0; attempt < 2; attempt += 1) {
    try {
      return await runProfileContextOperation(
        profileCtx,
        runtime.signal,
        async (signal, profileRuntime) => {
          await profileCtx.ensureBrowserAvailable({ headless: true, signal });
          const userDataDir = resolveOpenClawUserDataDir(into);
          const runningUserDataDir = profileRuntime.running?.userDataDir;
          if (
            !runningUserDataDir ||
            path.resolve(runningUserDataDir) !== path.resolve(userDataDir)
          ) {
            throw new Error(
              `managed profile "${into}" is not owned by this OpenClaw browser runtime; stop it and import into a fresh profile name`,
            );
          }
          if (!usesOpenClawMockKeychain(userDataDir)) {
            throw new Error(
              `managed profile "${into}" does not use the OpenClaw mock keychain; import into a fresh profile name`,
            );
          }

          const copied = snapshotCookieDatabase(cookiesFile);
          try {
            const decrypted = await readChromeCookiesDatabase({
              browser,
              databasePath: copied.databasePath,
              domains: params.domains,
              readSecret: deps.readSecret,
              signal,
            });

View on GitHub (pinned to 01804a7531)

Solutions

  1. Stop the other runtime that owns this profile (or stop all gateway instances) and retry.
  2. Import into a fresh profile name so the current runtime mints and owns the userDataDir.
  3. Confirm OPENClaw state dir is consistent across invocations so resolveOpenClawUserDataDir resolves the same path.

Example fix

// before: another runtime owns 'imported'
await importSystemProfileCookies({ systemProfile: 'Default', into: 'imported' });

// after: stop conflicting runtime, then use a fresh name
await stopGateway();
await importSystemProfileCookies({ systemProfile: 'Default', into: 'cookies-fresh' });
Defensive patterns

Strategy: validation

Validate before calling

const profileCtx = runtime.ctx.forProfile(into);
const expected = path.resolve(resolveOpenClawUserDataDir(into));
const running = profileCtx.runtime?.running?.userDataDir;
if (!running || path.resolve(running) !== expected) {
  throw new Error(`Another runtime owns "${into}". Stop it or use a fresh name.`);
}

Try / catch

try {
  await importSystemProfileCookies({ systemProfile: 'Default', into });
} catch (err) {
  if (err instanceof Error && /not owned by this OpenClaw browser runtime/.test(err.message)) {
    await stopBrowserControlRuntime({ requestedBy: 'service', onWarn: () => {} });
    into = `imported-${Date.now()}`;
    await importSystemProfileCookies({ systemProfile: 'Default', into });
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: 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).

Common situations: Concurrent gateway instances sharing profiles; manual browser launch with a custom user-data-dir; state directory changed between profile creation and import.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/45c30989c39026bf. Report an issue: GitHub.