{"record":{"id":"7e2b676fa496510d","repo":"paperclipai/paperclip","slug":"skipped-applied-skippedmissingattachmentobjects","errorCode":null,"errorMessage":"Skipped ${applied.skippedMissingAttachmentObjects} attachments whose source files were missing from storage.","messagePattern":"Skipped (.+?) attachments whose source files were missing from storage\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/worktree.ts","lineNumber":4232,"sourceCode":"      ? true\n      : await p.confirm({\n        message: `Import ${collected.plan.counts.issuesToInsert} issues and ${collected.plan.counts.commentsToInsert} comments from ${sourceEndpoint.label} into ${targetEndpoint.label}?`,\n        initialValue: false,\n      });\n    if (p.isCancel(confirmed) || !confirmed) {\n      p.log.warn(\"Import cancelled.\");\n      return;\n    }\n\n    const applied = await applyMergePlan({\n      sourceStorages,\n      targetStorage,\n      targetDb: targetHandle.db,\n      company,\n      plan: collected.plan,\n    });\n    if (applied.skippedMissingAttachmentObjects > 0) {\n      p.log.warn(\n        `Skipped ${applied.skippedMissingAttachmentObjects} attachments whose source files were missing from storage.`,\n      );\n    }\n    p.outro(\n      pc.green(\n        `Imported ${applied.insertedProjects} projects (${applied.insertedProjectWorkspaces} workspaces), ${applied.insertedIssues} issues, ${applied.insertedComments} comments, ${applied.insertedDocuments} documents (${applied.insertedDocumentRevisions} revisions, ${applied.mergedDocuments} merged), and ${applied.insertedAttachments} attachments into ${company.issuePrefix}.`,\n      ),\n    );\n  } finally {\n    await targetHandle.stop();\n    await sourceHandle.stop();\n  }\n}\n\nasync function backupWorktreeReseedTarget(input: {\n  targetConfig: PaperclipConfig;\n  targetPaths: WorktreeLocalPaths;\n}): Promise<string> {","sourceCodeStart":4214,"sourceCodeEnd":4250,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/cli/src/commands/worktree.ts#L4214-L4250","documentation":"After a confirmed worktree import, applyMergePlan inserted rows into the target; attachments whose database rows were planned but whose backing object files were absent from source storage were skipped and counted in skippedMissingAttachmentObjects. The import still completes — only those attachment payloads are missing in the target.","triggerScenarios":"Source storage (local disk dir or S3 backend) missing object files for attachment rows: objects deleted out-of-band, source storage config pointing at the wrong location/bucket, partial copy of a data dir, S3 permission errors surfaced as missing keys.","commonSituations":"Copying a Paperclip data directory but forgetting the storage/uploads dir; S3 lifecycle rules deleting old objects; moving machines with an incomplete rsync.","solutions":["Verify the source instance's storage settings (storage mode, local dir, S3 bucket) — the import reads objects from the configured source storage.","Restore or copy the missing object files back into source storage (attachment rows are already in the source DB).","Re-run `paperclipai worktree import` — already-inserted rows are handled by the plan; the previously skipped attachments import once their files exist.","If the count equals ALL attachments, the source storage config is almost certainly wrong — fix that first."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-flight: every planned attachment object must exist in source storage\nconst missing: string[] = [];\nfor (const att of plan.attachments) {\n  const exists = await sourceStorage.exists(att.storageKey);\n  if (!exists) missing.push(att.storageKey);\n}\nif (missing.length) {\n  console.error(`Source storage is missing ${missing.length} attachment objects; fix storage before import.`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the source storage backend (uploads dir / S3 bucket) with the database when copying instances.","Review the import plan's attachment counts against skipped counts after apply; investigate any skip.","Backup/verify S3 object continuity (lifecycle rules, versioning) before importing old companies.","Re-run the import after restoring missing objects — planned rows not yet inserted will then land."],"tags":["worktree","import","attachments","storage","data-loss-risk"],"backgroundTag":"missing-storage-object","analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}