{"record":{"id":"b5c2bf4bd87484bd","repo":"toeverything/AFFiNE","slug":"no-valid-bear-textbundles-found-in-the-archive-pl","errorCode":null,"errorMessage":"No valid Bear textbundles found in the archive. Please select a .bear2bk backup file.","messagePattern":"No valid Bear textbundles found in the archive\\. Please select a \\.bear2bk backup file\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"blocksuite/affine/widgets/linked-doc/src/transformers/bear.ts","lineNumber":468,"sourceCode":"    if (entry.infoJsonPath) {\n      try {\n        const text = await zip.file(entry.infoJsonPath)!.async('string');\n        info = JSON.parse(text);\n      } catch {\n        // Invalid JSON\n      }\n    }\n\n    const bearMeta = info['net.shinyfrog.bear'] as\n      | Record<string, unknown>\n      | undefined;\n    if (bearMeta?.trashed === 1) continue;\n\n    validBundles.push({ entry, bearMeta });\n  }\n\n  if (validBundles.length === 0) {\n    throw new Error(\n      'No valid Bear textbundles found in the archive. Please select a .bear2bk backup file.'\n    );\n  }\n\n  const docIds: string[] = [];\n  const docs: ImportDoc[] = [];\n  const importBlobs = new Map<\n    string,\n    Awaited<ReturnType<typeof blobsFromAssets>>[0]\n  >();\n  const warnings: ImportWarning[] = [];\n  const tagDocMap = new Map<string, string[]>();\n\n  // Process bundles sequentially to limit memory.\n  // Each bundle is wrapped in try/catch so one bad note does not abort the\n  // entire import after earlier notes have already been written.\n  for (const { entry, bearMeta } of validBundles) {\n    try {","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/blocksuite/affine/widgets/linked-doc/src/transformers/bear.ts#L450-L486","documentation":"planBearBackup parsed the .bear2bk zip but none of its entries formed a valid textbundle (missing Info.json or all entries marked trashed), so the archive is not a usable Bear backup; the message tells the user to pick a proper .bear2bk file.","triggerScenarios":"Thrown at blocksuite/affine/widgets/linked-doc/src/transformers/bear.ts:468 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make sure you selected a Bear 2.x backup archive with the .bear2bk extension; older Bear 1 backups use a different format.","Verify the archive is not corrupted — re-export the backup from Bear and try again.","Check that the zip archive contains .textbundle entries at its root; nested or renamed archives will not be detected."],"exampleFix":"// In Bear: File > Export Notes > Bear2Backup (.bear2bk)\n// Then import that exact file — do not unzip and re-zip it,\n// which can strip the .textbundle entries the importer looks for.","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}