paperclipai/paperclip · warning

No usable systemd user manager was detected (common in conta

Error message

No usable systemd user manager was detected (common in containers and WSL1). Use paperclipai run instead.

What it means

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.

Source

Thrown at cli/src/onboard-service.ts:65

  options: OnboardServiceOptions,
  dependencies: Partial<OnboardServiceDependencies> = {},
): Promise<boolean> {
  const deps = { ...defaultDependencies, ...dependencies };
  if (options.installService === false) return false;

  const explicitlyRequested = options.installService === true;
  const canPrompt = options.yes !== true && deps.isInteractive();
  if (!explicitlyRequested && !canPrompt) {
    deps.info(
      "Background service not installed. Use `paperclipai onboard --install-service` or `paperclipai service install` to opt in.",
    );
    return false;
  }

  const instanceId = resolvePaperclipInstanceId();
  const detection = await deps.detect(instanceId);
  if (!detection.supported) {
    if (explicitlyRequested) deps.warn(detection.reason);
    return false;
  }

  if (!explicitlyRequested && !(await deps.confirm())) return false;

  await detection.manager.install({ startNow: true, startOnLogin: true });
  if (!explicitlyRequested && detection.manager.enableLinger && await deps.confirmLinger()) {
    await detection.manager.enableLinger();
  }
  deps.success(`Installed and started ${detection.manager.serviceName}.`);
  return true;
}

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Run in the foreground: `paperclipai run`.
  2. 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.
  3. In containers, rely on the container supervisor (docker --restart, k8s) instead of a user service.
  4. Verify quickly: systemctl --user show-environment; echo $? — the service path activates only when this works.

Example fix

# before
$ paperclipai onboard --install-service
! No usable systemd user manager was detected (common in containers and WSL1). Use paperclipai run instead.

# after (real linux host)
$ ssh user@host                 # proper PAM session
$ loginctl enable-linger $USER
$ systemctl --user show-environment && paperclipai onboard --install-service
Defensive patterns

Strategy: type-guard

Validate before calling

import { execFileSync } from "node:child_process";
let systemdUserOk = false;
try { execFileSync("systemctl", ["--user", "show-environment"], { stdio: "ignore" }); systemdUserOk = true; } catch {}
if (!systemdUserOk) {
  // containers/WSL1/no-PAM sessions: use `paperclipai run` instead of service install
}

Type guard

type Detection = { supported: true; manager: { install(o: object): Promise<void> } } | { supported: false; reason: string };
const isServiceUnavailable = (d: Detection): d is { supported: false; reason: string } =>
  d.supported === false;
// then branch on the reason string to hint foreground run vs linger fix

Prevention

When it happens

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

Common situations: Docker containers without systemd; `docker exec` shells; WSL1; sudo/su sessions that drop the user bus env; minimal VMs without logind.

Related errors


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/7735dbdd74b64642. Report an issue: GitHub.