{"record":{"id":"1023ff8fdbd0b356","repo":"alibaba/spring-ai-alibaba","slug":"file-does-not-exist-path","errorCode":null,"errorMessage":"file does not exist, path: ","messagePattern":"file does not exist, path: ","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/rag/indices/KnowledgeBaseIndexPipeline.java","lineNumber":95,"sourceCode":"\t\tList<Document> documents;\n\t\tString format = document.getFormat();\n\n\t\tString path;\n\t\tif (document.getType() == DocumentType.OSS\n\t\t\t\t|| UploadType.OSS.getValue().equalsIgnoreCase(properties.getUploadMethod())) {\n\t\t\tpath = FileUtils.getTempFilePath(document.getDocId());\n\t\t\tossManager.downloadFile(document.getPath(), path);\n\t\t}\n\t\telse if (document.getType() == DocumentType.FILE) {\n\t\t\tpath = properties.getStoragePath() + File.separator + document.getPath();\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"unsupported document type: \" + document.getType());\n\t\t}\n\n\t\tFile file = new File(path);\n\t\tif (!file.exists()) {\n\t\t\tthrow new RuntimeException(\"file does not exist, path: \" + path);\n\t\t}\n\n\t\tformat = StringUtils.lowerCase(format);\n\t\tswitch (format) {\n\t\t\tcase \"pdf\": {\n\t\t\t\tDocumentReader reader = new PagePdfDocumentReader(new FileSystemResource(file));\n\t\t\t\tdocuments = reader.get();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"doc\", \"docx\", \"ppt\", \"pptx\": {\n\t\t\t\tDocumentReader reader = new TikaDocumentReader(new FileSystemResource(file));\n\t\t\t\tdocuments = reader.get();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase \"md\", \"markdown\": {\n\t\t\t\tDocumentReader reader = new MarkdownDocumentReader(new FileSystemResource(file),\n\t\t\t\t\t\tMarkdownDocumentReaderConfig.defaultConfig());\n\t\t\t\tdocuments = reader.get();","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/alibaba/spring-ai-alibaba/blob/f82da0b50f35744c13968191be2b1cd2452ef550/spring-ai-alibaba-admin/spring-ai-alibaba-admin-server-core/src/main/java/com/alibaba/cloud/ai/studio/core/rag/indices/KnowledgeBaseIndexPipeline.java#L77-L113","documentation":"KnowledgeBaseIndexPipeline.parse builds a File from the resolved path (downloaded OSS file or storage-path FILE document) and throws RuntimeException \"file does not exist, path: \" + path when the file cannot be found on local disk before attempting format-specific parsing.","triggerScenarios":"parse() is invoked for a document whose local file is absent — the OSS download was skipped/failed, the configured storage-path directory was wiped (container restart with ephemeral storage), or document.getPath() points to a stale/moved file.","commonSituations":"Kubernetes pods with non-persistent volumes losing previously uploaded files; documents uploaded to an old node in a multi-node deployment; wrong spring.storage.path configuration; file deleted during cleanup jobs while DB row remains.","solutions":["Verify properties.getStoragePath() points to a persistent, existing directory containing the uploaded files.","Re-upload the document (or re-download from OSS) so the local file exists, then retry indexing.","Check document.getPath() in the DB for stale paths and correct them.","Mount persistent storage (PV/NFS) so uploaded files survive restarts and are visible to all nodes."],"exampleFix":"// before\nspring:\n  storage:\n    path: /tmp/kb-storage\n// after\nspring:\n  storage:\n    path: /data/kb-storage  # persistent volume","handlingStrategy":"validation","validationCode":"// Java\nFile file = new File(properties.getStoragePath(), document.getPath());\nif (!file.exists()) {\n    throw new IllegalStateException(\"Local file missing for document \" + document.getId() + \": \" + file.getPath());\n}","typeGuard":null,"tryCatchPattern":"try {\n    docs = pipeline.parse(document, format);\n} catch (RuntimeException e) {\n    if (e.getMessage() != null && e.getMessage().startsWith(\"file does not exist\")) {\n        // trigger re-download/re-upload before retrying indexing\n    }\n}","preventionTips":["Use persistent storage volumes for the knowledge-base storage path.","Verify OSS downloads complete (file exists and size > 0) before parsing.","Reconcile DB document rows against the file store periodically and re-upload missing files."],"tags":["file-not-found","rag","storage","indexing"],"backgroundTag":"file-not-found","analyzedSha":"f82da0b50f35744c13968191be2b1cd2452ef550","analyzedAt":"2026-09-09T15:32:42.421Z","contentChangedAt":"2026-09-09T15:32:42.421Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}