{"record":{"id":"3bf341669e5a4bcc","repo":"OtterMind/Chat2DB","slug":"ai-attachment-inputstreamrequired","errorCode":"ai.attachment.inputStreamRequired","errorMessage":"ai.attachment.inputStreamRequired","messagePattern":"ai\\.attachment\\.inputStreamRequired","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":56,"sourceCode":"\n    private static final int MAX_CONTENT_LENGTH = 12000;\n    private static final int MAX_CONTEXT_LENGTH = 24000;\n    private static final int MAX_SHEET_ROWS = 100;\n    private static final int MAX_SHEET_COLUMNS = 20;\n    private static final Set<String> DOCUMENT_EXTENSIONS = Set.of(\"pdf\", \"doc\", \"docx\", \"md\", \"txt\", \"json\");\n    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());","sourceCodeStart":38,"sourceCodeEnd":74,"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#L38-L74","documentation":"Error \"ai.attachment.inputStreamRequired\" thrown in OtterMind/Chat2DB.","triggerScenarios":"AiAttachmentServiceImpl was asked to process an attachment but no input stream was supplied.","commonSituations":"See trigger scenarios.","solutions":["Provide the attachment as an input stream (multipart upload) instead of only a path.","Ensure the request actually carries the file 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"}