{"record":{"id":"82d9b6a04e33edcf","repo":"OtterMind/Chat2DB","slug":"ai-attachment-parsefailed","errorCode":"ai.attachment.parseFailed","errorMessage":"ai.attachment.parseFailed","messagePattern":"ai\\.attachment\\.parseFailed","errorType":"exception","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/ai/AiAttachmentServiceImpl.java","lineNumber":62,"sourceCode":"    private static final Set<String> TABULAR_EXTENSIONS = Set.of(\"csv\", \"xls\", \"xlsx\");\n    private static final Set<String> SUPPORTED_EXTENSIONS;\n\n    static {\n        Set<String> supportedExtensions = new LinkedHashSet<>();\n        supportedExtensions.addAll(DOCUMENT_EXTENSIONS);\n        supportedExtensions.addAll(TABULAR_EXTENSIONS);\n        SUPPORTED_EXTENSIONS = supportedExtensions;\n    }\n\n    public ChatAttachment parse(AiAttachmentParseRequest param) {\n        if (param == null || param.getInputStream() == null) {\n            throw new BusinessException(\"ai.attachment.inputStreamRequired\");\n        }\n        String fileName = StringUtils.defaultIfBlank(param.getFileName(), \"attachment\");\n        try (InputStream inputStream = param.getInputStream()) {\n            return parse(fileName, inputStream);\n        } catch (IOException e) {\n            throw new BusinessException(\"ai.attachment.parseFailed\", new Object[]{fileName, e.getMessage()}, e);\n        }\n    }\n\n    public ChatAttachment parse(AiLocalAttachmentParseRequest param) {\n        if (param == null || StringUtils.isBlank(param.getFilePath())) {\n            throw new BusinessException(\"ai.attachment.filePathRequired\");\n        }\n        File file = new File(param.getFilePath().trim());\n        if (!file.exists() || !file.isFile()) {\n            throw new BusinessException(\"ai.attachment.fileNotFound\");\n        }\n        String fileName = StringUtils.defaultIfBlank(param.getFileName(), file.getName());\n        try (InputStream inputStream = new FileInputStream(file)) {\n            return parse(fileName, inputStream);\n        } catch (IOException e) {\n            throw new BusinessException(\"ai.attachment.localParseFailed\", new Object[]{file.getPath(), e.getMessage()}, e);\n        }\n    }","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/ai/AiAttachmentServiceImpl.java#L44-L80","documentation":"Error \"ai.attachment.parseFailed\" thrown in OtterMind/Chat2DB.","triggerScenarios":"Parsing the uploaded attachment content failed, e.g. corrupt or unreadable file.","commonSituations":"See trigger scenarios.","solutions":["Verify the attachment is a well-formed file of a supported type and retry.","Check server logs for the parser exception to identify the malformed content."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}