{"record":{"id":"ca7fdd93701f7d70","repo":"paperclipai/paperclip","slug":"the-paperclip-database-is-not-running-or-reachable","errorCode":null,"errorMessage":"The Paperclip database is not running or reachable, so the pre-update backup cannot be taken. Start the service with `paperclipai service start` and retry, or skip the backup with `paperclipai update --no-backup`.","messagePattern":"The Paperclip database is not running or reachable, so the pre-update backup cannot be taken\\. Start the service with `paperclipai service start` and retry, or skip the backup with `paperclipai update --no-backup`\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/update.ts","lineNumber":61,"sourceCode":"    if (typeof record.code === \"string\" && DATABASE_UNREACHABLE_CODES.has(record.code)) return true;\n    if (typeof record.message === \"string\" && /\\b(?:ECONNREFUSED|EHOSTUNREACH|ENETUNREACH|ETIMEDOUT)\\b|connection refused/i.test(record.message)) return true;\n    if (record.cause !== undefined) pending.push(record.cause);\n    if (Array.isArray(record.errors)) pending.push(...record.errors);\n  }\n  return false;\n}\n\nasync function runPreUpdateBackup(options: UpdateOptions, backup: () => Promise<void>, hasInstanceData = hasPaperclipInstanceData): Promise<void> {\n  if (!hasInstanceData()) {\n    const message = \"Skipping the pre-update backup because this Paperclip instance has not been onboarded and has no data to back up.\";\n    if (options.json) console.error(message); else console.log(pc.yellow(message));\n    return;\n  }\n  try {\n    await backup();\n  } catch (error) {\n    if (isDatabaseUnreachableError(error)) {\n      throw new Error(\n        \"The Paperclip database is not running or reachable, so the pre-update backup cannot be taken. Start the service with `paperclipai service start` and retry, or skip the backup with `paperclipai update --no-backup`.\",\n        { cause: error },\n      );\n    }\n    throw error;\n  }\n}\n\nasync function restartActiveManagedService(expectedVersion: string): Promise<boolean> {\n  const instanceId = resolvePaperclipInstanceId();\n  const detection = await detectServiceManager({ instanceId });\n  if (!detection.supported || !(await detection.manager.status()).active) return false;\n  await restartManagedService({ instanceId, expectedVersion });\n  return true;\n}\n\nexport function detectInstallMode(executablePath = process.argv[1] ?? \"\", paths = resolveInstallStorePaths()): InstallMode {\n  const resolved = path.resolve(executablePath || \".\");","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/update.ts#L43-L79","documentation":"Error \"The Paperclip database is not running or reachable, so the pre-update backup cannot be taken. Start the service with `paperclipai service start` and retry, or skip the backup with `paperclipai update --no-backup`.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at cli/src/commands/update.ts:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Start the service with `paperclipai service start` and retry, or skip the backup with `paperclipai update --no-backup`."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}