{"record":{"id":"ef7e3119aaf2976d","repo":"chatboxai/chatbox","slug":"chatbox-ai-parser-failed","errorCode":null,"errorMessage":"chatbox_ai_parser_failed","messagePattern":"chatbox_ai_parser_failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/renderer/stores/sessionHelpers.ts","lineNumber":395,"sourceCode":"  uniqKey: string,\n  reason: 'local_parser_failed' | 'empty_content'\n): Promise<{ content: string; storageKey: string; tokenCountMap: Record<string, number>; parserType: string }> {\n  log.warn(`Falling back to Chatbox AI parser for \"${file.name}\" due to ${reason}`)\n\n  try {\n    return await parseFileWithChatboxAI(file, uniqKey)\n  } catch (error) {\n    log.error(`Chatbox AI fallback parsing failed for \"${file.name}\":`, error)\n    // A full client-side storage database is not a cloud-parser problem — persisting the\n    // parsed content fails the same way. Preserve it for the quota-specific user message\n    // and sanitized Sentry report at the outer boundary.\n    if (isStorageQuotaError(error)) {\n      throw new FilePreprocessFailure(FILE_STORAGE_QUOTA_EXCEEDED_ERROR, 'cloud_parse', error)\n    }\n    if (error instanceof Error && error.message === EMPTY_ATTACHMENT_CONTENT_ERROR) {\n      throw error\n    }\n    throw new Error('chatbox_ai_parser_failed')\n  }\n}\n\ntype LocalParserFallbackOptions = {\n  allowChatboxAIFallback?: boolean\n  forceChatboxAIFallback?: boolean\n}\n\nfunction shouldFallbackToChatboxAI(options: LocalParserFallbackOptions): boolean {\n  return (\n    Boolean(options.forceChatboxAIFallback) || (options.allowChatboxAIFallback !== false && canFallbackToChatboxAI())\n  )\n}\n\nasync function parseFileWithLocalFallback(\n  file: File,\n  uniqKey: string,\n  options: LocalParserFallbackOptions = {}","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/stores/sessionHelpers.ts#L377-L413","documentation":"Generic cloud-parser failure thrown from fallbackToChatboxAIParser. After local parsing failed and the Chatbox AI cloud parser also rejected the file for any reason other than quota or empty content, the helper throws the catch-all 'chatbox_ai_parser_failed'. The two recoverable/specific cases (quota, empty content) are re-thrown as-is first.","triggerScenarios":"parseFileWithChatboxAI throws an error that is not a storage-quota error and not the empty-attachment-content error: network failure to the cloud parser, HTTP 5xx, unsupported file format server-side, or an auth/licensing rejection.","commonSituations":"Network blip during cloud parse upload, Chatbox AI backend temporarily unavailable, file format unsupported by the cloud parser, license/quota misconfigured (but not the local-storage quota).","solutions":["Distinguish transient (network/5xx) from permanent (unsupported) failures — retry the former once.","Verify network connectivity and Chatbox AI endpoint reachability.","Confirm the file type is supported by the cloud parser before upload.","Log the underlying error (redacted) to separate network vs server-side causes."],"exampleFix":"// before\nthrow new Error('chatbox_ai_parser_failed')\n// after\nthrow new Error('chatbox_ai_parser_failed')","handlingStrategy":"retry","validationCode":null,"typeGuard":"function isChatboxAIParserFailure(e: unknown): boolean {\n  return e instanceof Error && e.message === 'chatbox_ai_parser_failed'\n}","tryCatchPattern":"try {\n  return await parseFileWithLocalFallback(file, uniqKey, options)\n} catch (err) {\n  if (isChatboxAIParserFailure(err) && isTransientNetwork) return await parseFileWithLocalFallback(file, uniqKey, options)\n  throw err\n}","preventionTips":["Distinguish transient (network/5xx) from permanent (unsupported) cloud failures.","Verify connectivity and Chatbox AI endpoint before upload.","Confirm the file type is supported by the cloud parser."],"tags":["file-parsing","cloud-parser","chatbox-ai","network","attachments"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}