chatboxai/chatbox · error · Error

document_parser_not_configured

Error message

document_parser_not_configured

What it means

Thrown in preprocessFile when the file is not a text file (isTextFilePath false) and getEffectiveDocumentParserConfig().type === 'none'. It is the explicit 'user disabled all document parsing' branch — non-text attachments cannot be processed because no parser is configured.

Source

Thrown at src/renderer/stores/sessionHelpers.ts:641

        rawStorageKey: rawKey,
        ragMode: 'inline',
        parserType: 'sandbox-raw',
      }
    }

    stage = 'parse'
    if (isTextFilePath(file.name)) {
      log.debug(`Text file detected, using local parser: ${file.name}`)
      result = await parseFileWithLocalFallback(file, uniqKey, {
        allowChatboxAIFallback: options?.source !== 'pasted-text',
      })
    } else {
      const parserConfig = getEffectiveDocumentParserConfig()
      log.debug(`Using document parser: ${parserConfig.type} for file: ${file.name}`)

      switch (parserConfig.type) {
        case 'none': {
          throw new Error('document_parser_not_configured')
        }

        case 'local': {
          result = await parseFileWithLocalFallback(file, uniqKey)
          break
        }

        case 'chatbox-ai': {
          result = await parseFileWithLocalFallback(file, uniqKey, { forceChatboxAIFallback: true })
          break
        }

        case 'mineru': {
          const apiToken = parserConfig.mineru?.apiToken
          if (!apiToken) {
            throw new Error('mineru_api_token_required')
          }
          try {

View on GitHub (pinned to 81571269ad)

Solutions

  1. Open Settings → Document Parser and select 'local', 'chatbox-ai', or 'mineru' before attaching non-text files.
  2. Convert the attachment to a plain-text/Markdown file (isTextFilePath returns true) so it bypasses the parser switch entirely.
  3. If shipping a default config, set parserConfig.type to a build-supported default rather than 'none' so users aren't blocked on first attach.
  4. In the UI, disable the attach-button for non-text files when parserConfig.type === 'none' so the user gets guidance instead of a thrown error.

Example fix

// before
case 'none': {
  throw new Error('document_parser_not_configured')
}
// after — fall back to the local parser so attachment still works
case 'none': {
  result = await parseFileWithLocalFallback(file, uniqKey)
  break
}
Defensive patterns

Strategy: validation

Validate before calling

// Validate the parser config before attaching a non-text file.
function assertParserConfigured(file: File, cfg: { type: string }): void {
  if (!isTextFilePath(file.name) && cfg.type === 'none') {
    throw new Error('Set a document parser in Settings before attaching non-text files.')
  }
}

Type guard

function isDocumentParserConfigured(cfg: { type: string }): boolean {
  return cfg.type !== 'none' && ['local','chatbox-ai','mineru'].includes(cfg.type)
}

Try / catch

try {
  await preprocessFile(file)
} catch (e) {
  if (e instanceof Error && e.message === 'document_parser_not_configured') {
    promptUserToConfigureParser()
    return
  }
  throw e
}

Prevention

When it happens

Trigger: User attached a binary document (PDF, DOCX, etc.) while the document-parser setting is 'none'. The switch dispatches on parserConfig.type and the 'none' case throws before any parser is invoked. The same string is reused in the default case (227) for unknown types.

Common situations: Fresh install where the parser defaults to 'none'; user manually turned off document parsing to save bandwidth; a config import/set-defaults call wrote type:'none'; group policy disabled cloud parsers and the local parser was unset, leaving 'none'.

Related errors


AI-assisted analysis of chatboxai/chatbox@81571269ad (2026-08-12). Data as JSON: /api/errors/4056030b7049a799. Report an issue: GitHub.