{"record":{"id":"7735dbdd74b64642","repo":"paperclipai/paperclip","slug":"no-usable-systemd-user-manager-was-detected-commo","errorCode":null,"errorMessage":"No usable systemd user manager was detected (common in containers and WSL1). Use paperclipai run instead.","messagePattern":"No usable systemd user manager was detected \\(common in containers and WSL1\\)\\. Use paperclipai run instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/onboard-service.ts","lineNumber":65,"sourceCode":"  options: OnboardServiceOptions,\n  dependencies: Partial<OnboardServiceDependencies> = {},\n): Promise<boolean> {\n  const deps = { ...defaultDependencies, ...dependencies };\n  if (options.installService === false) return false;\n\n  const explicitlyRequested = options.installService === true;\n  const canPrompt = options.yes !== true && deps.isInteractive();\n  if (!explicitlyRequested && !canPrompt) {\n    deps.info(\n      \"Background service not installed. Use `paperclipai onboard --install-service` or `paperclipai service install` to opt in.\",\n    );\n    return false;\n  }\n\n  const instanceId = resolvePaperclipInstanceId();\n  const detection = await deps.detect(instanceId);\n  if (!detection.supported) {\n    if (explicitlyRequested) deps.warn(detection.reason);\n    return false;\n  }\n\n  if (!explicitlyRequested && !(await deps.confirm())) return false;\n\n  await detection.manager.install({ startNow: true, startOnLogin: true });\n  if (!explicitlyRequested && detection.manager.enableLinger && await deps.confirmLinger()) {\n    await detection.manager.enableLinger();\n  }\n  deps.success(`Installed and started ${detection.manager.serviceName}.`);\n  return true;\n}\n","sourceCodeStart":47,"sourceCodeEnd":78,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/onboard-service.ts#L47-L78","documentation":"On Linux, detectServiceManager probes for a systemd user session by running `systemctl --user show-environment`. When that command fails (no user manager bus — typical inside containers, docker exec sessions, WSL1, or SSH sessions without PAM/logind), detection returns { supported: false, reason: 'No usable systemd user manager was detected (common in containers and WSL1). Use paperclipai run instead.' }. Service install is then skipped; the reason is printed only when --install-service was explicit.","triggerScenarios":"`paperclipai onboard --install-service` (or service install) on Linux inside Docker/WSL1, or any session where XDG_RUNTIME_DIR/dbus user session is missing so `systemctl --user` exits non-zero.","commonSituations":"Docker containers without systemd; `docker exec` shells; WSL1; sudo/su sessions that drop the user bus env; minimal VMs without logind.","solutions":["Run in the foreground: `paperclipai run`.","If you need it to survive logout on a real linux host: get a proper login session (SSH/console login), optionally `loginctl enable-linger $USER`, and retry — `systemctl --user show-environment` must succeed first.","In containers, rely on the container supervisor (docker --restart, k8s) instead of a user service.","Verify quickly: systemctl --user show-environment; echo $? — the service path activates only when this works."],"exampleFix":"# before\n$ paperclipai onboard --install-service\n! No usable systemd user manager was detected (common in containers and WSL1). Use paperclipai run instead.\n\n# after (real linux host)\n$ ssh user@host                 # proper PAM session\n$ loginctl enable-linger $USER\n$ systemctl --user show-environment && paperclipai onboard --install-service","handlingStrategy":"type-guard","validationCode":"import { execFileSync } from \"node:child_process\";\nlet systemdUserOk = false;\ntry { execFileSync(\"systemctl\", [\"--user\", \"show-environment\"], { stdio: \"ignore\" }); systemdUserOk = true; } catch {}\nif (!systemdUserOk) {\n  // containers/WSL1/no-PAM sessions: use `paperclipai run` instead of service install\n}","typeGuard":"type Detection = { supported: true; manager: { install(o: object): Promise<void> } } | { supported: false; reason: string };\nconst isServiceUnavailable = (d: Detection): d is { supported: false; reason: string } =>\n  d.supported === false;\n// then branch on the reason string to hint foreground run vs linger fix","tryCatchPattern":null,"preventionTips":["Verify `systemctl --user show-environment` succeeds in the exact session before relying on service install.","Use real SSH/console logins (PAM) and `loginctl enable-linger` for headless linux hosts.","Inside Docker/WSL1, standardize on `paperclipai run` under the container/process supervisor.","Test service install once per environment type in CI to catch user-bus gaps early."],"tags":["cli","service","systemd","linux","containers","wsl"],"backgroundTag":"systemd-user-session-unavailable","analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-08-22T14:17:55.899Z"}