OtterMind/Chat2DB · error · BusinessException

ai.attachment.parseFailed

ai.attachment.parseFailed

Error message

ai.attachment.parseFailed

What it means

Error "ai.attachment.parseFailed" thrown in OtterMind/Chat2DB.

Source

Thrown at chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/ai/AiAttachmentServiceImpl.java:62

    private static final Set<String> TABULAR_EXTENSIONS = Set.of("csv", "xls", "xlsx");
    private static final Set<String> SUPPORTED_EXTENSIONS;

    static {
        Set<String> supportedExtensions = new LinkedHashSet<>();
        supportedExtensions.addAll(DOCUMENT_EXTENSIONS);
        supportedExtensions.addAll(TABULAR_EXTENSIONS);
        SUPPORTED_EXTENSIONS = supportedExtensions;
    }

    public ChatAttachment parse(AiAttachmentParseRequest param) {
        if (param == null || param.getInputStream() == null) {
            throw new BusinessException("ai.attachment.inputStreamRequired");
        }
        String fileName = StringUtils.defaultIfBlank(param.getFileName(), "attachment");
        try (InputStream inputStream = param.getInputStream()) {
            return parse(fileName, inputStream);
        } catch (IOException e) {
            throw new BusinessException("ai.attachment.parseFailed", new Object[]{fileName, e.getMessage()}, e);
        }
    }

    public ChatAttachment parse(AiLocalAttachmentParseRequest param) {
        if (param == null || StringUtils.isBlank(param.getFilePath())) {
            throw new BusinessException("ai.attachment.filePathRequired");
        }
        File file = new File(param.getFilePath().trim());
        if (!file.exists() || !file.isFile()) {
            throw new BusinessException("ai.attachment.fileNotFound");
        }
        String fileName = StringUtils.defaultIfBlank(param.getFileName(), file.getName());
        try (InputStream inputStream = new FileInputStream(file)) {
            return parse(fileName, inputStream);
        } catch (IOException e) {
            throw new BusinessException("ai.attachment.localParseFailed", new Object[]{file.getPath(), e.getMessage()}, e);
        }
    }

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Verify the attachment is a well-formed file of a supported type and retry.
  2. Check server logs for the parser exception to identify the malformed content.

When it happens

Trigger: Parsing the uploaded attachment content failed, e.g. corrupt or unreadable file.

Common situations: See trigger scenarios.


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/82d9b6a04e33edcf. Report an issue: GitHub.