{"record":{"id":"7fe7d31928fc884a","repo":"paperclipai/paperclip","slug":"paperclip-instance-instanceid-is-already-runn","errorCode":null,"errorMessage":"Paperclip instance '${instanceId}' is already running as ${status.serviceName}. Use 'paperclipai service status --instance ${instanceId}' or pass --force to bypass this safety check.","messagePattern":"Paperclip instance '(.+?)' is already running as (.+?)\\. Use 'paperclipai service status --instance (.+?)' or pass --force to bypass this safety check\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/services/service-manager.ts","lineNumber":310,"sourceCode":"  const instanceId = resolvePaperclipInstanceId(input.instanceId);\n  const platform = input.platform ?? process.platform;\n  const runner = input.runner ?? defaultCommandRunner;\n  if (platform === \"darwin\") return { supported: true, manager: new LaunchdServiceManager(instanceId, runner) };\n  if (platform !== \"linux\") return { supported: false, reason: `Service management is not supported on ${platform}. Use paperclipai run instead.` };\n  try {\n    await runner(\"systemctl\", [\"--user\", \"show-environment\"]);\n    return { supported: true, manager: new SystemdServiceManager(instanceId, runner) };\n  } catch {\n    return { supported: false, reason: \"No usable systemd user manager was detected (common in containers and WSL1). Use paperclipai run instead.\" };\n  }\n}\n\nexport async function assertForegroundRunAllowed(instanceId: string, force = false, detector: typeof detectServiceManager = detectServiceManager): Promise<void> {\n  if (force || process.env.PAPERCLIP_SERVICE_MANAGED === \"1\") return;\n  const detection = await detector({ instanceId });\n  if (!detection.supported) return;\n  const status = await detection.manager.status();\n  if (status.active) throw new Error(`Paperclip instance '${instanceId}' is already running as ${status.serviceName}. Use 'paperclipai service status --instance ${instanceId}' or pass --force to bypass this safety check.`);\n}\n","sourceCodeStart":292,"sourceCodeEnd":312,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/services/service-manager.ts#L292-L312","documentation":"Error \"Paperclip instance '${instanceId}' is already running as ${status.serviceName}. Use 'paperclipai service status --instance ${instanceId}' or pass --force to bypass this safety check.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at cli/src/services/service-manager.ts:310 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Stop the running service with `paperclipai service stop --instance ${instanceId}`, then retry.","Pass --force to bypass the safety check."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}