{"record":{"id":"7b9599699cf3a426","repo":"paperclipai/paperclip","slug":"systemd-service-values-must-not-contain-line-break","errorCode":null,"errorMessage":"Systemd service values must not contain line breaks","messagePattern":"Systemd service values must not contain line breaks","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/services/service-manager.ts","lineNumber":57,"sourceCode":"export type CommandResult = { stdout: string; stderr: string };\nexport type CommandRunner = (command: string, args: string[], options?: { inherit?: boolean }) => Promise<CommandResult>;\n\nexport const defaultCommandRunner: CommandRunner = async (command, args, options) => {\n  if (options?.inherit) {\n    await new Promise<void>((resolve, reject) => {\n      const child = execFile(command, args, { windowsHide: true }, (error) => error ? reject(error) : resolve());\n      child.stdout?.pipe(process.stdout);\n      child.stderr?.pipe(process.stderr);\n    });\n    return { stdout: \"\", stderr: \"\" };\n  }\n  const result = await execFileAsync(command, args, { encoding: \"utf8\", windowsHide: true });\n  return { stdout: result.stdout, stderr: result.stderr };\n};\n\nfunction escapeSystemd(value: string): string {\n  if (/\\r|\\n/.test(value)) {\n    throw new Error(\"Systemd service values must not contain line breaks\");\n  }\n  return value\n    .replaceAll(\"\\\\\", \"\\\\\\\\\")\n    .replaceAll('\"', '\\\\\"')\n    .replaceAll(\"$\", () => \"$$\")\n    .replaceAll(\"%\", \"%%\");\n}\n\nfunction escapeXml(value: string): string {\n  return value.replaceAll(\"&\", \"&amp;\").replaceAll(\"<\", \"&lt;\").replaceAll(\">\", \"&gt;\").replaceAll('\"', \"&quot;\").replaceAll(\"'\", \"&apos;\");\n}\n\nfunction escapeRegExp(value: string): string {\n  return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nexport function resolveServiceShimPath(homeDir = os.homedir()): string {\n  return process.env.PAPERCLIP_SHIM_PATH?.trim() || path.join(homeDir, \".local\", \"bin\", \"paperclipai\");","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/cli/src/services/service-manager.ts#L39-L75","documentation":"escapeSystemd rejects unit field values containing line breaks, which would inject additional directives into the generated systemd unit; a unit-injection guard.","triggerScenarios":"Thrown at cli/src/services/service-manager.ts:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove line breaks from systemd service values; keep each value on a single line."],"exampleFix":null,"handlingStrategy":"validation","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"}