{"record":{"id":"2433a185cc883460","repo":"prestodb/presto","slug":"hive-file-not-found-2433a1","errorCode":"HIVE_FILE_NOT_FOUND","errorMessage":"Invalid path in Symlink manifest file %s: %s does not exist","messagePattern":"Invalid path in Symlink manifest file (.+?): (.+?) does not exist","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-hive/src/main/java/com/facebook/presto/hive/HiveUtil.java","lineNumber":1385,"sourceCode":"                ((CachingDirectoryLister) directoryLister).invalidateDirectoryListCache(Optional.of(targetParent.toString()));\n\n                targetParentHiveFileInfos.clear();\n                targetParentHiveFileInfos.putAll(getTargetParentHiveFileInfoMap(\n                        partition,\n                        targetParent,\n                        hiveDirectoryContext,\n                        targetFilesystem,\n                        directoryLister,\n                        table,\n                        namenodeStats));\n            }\n        }\n\n        return currentTargetPaths.stream().map(targetPath -> {\n            HiveFileInfo hiveFileInfo = targetParentHiveFileInfos.get(getPathWithoutSchemeAndAuthority(targetPath).toString());\n\n            if (hiveFileInfo == null) {\n                throw new PrestoException(HIVE_FILE_NOT_FOUND, String.format(\"Invalid path in Symlink manifest file %s: %s does not exist\", path, targetPath));\n            }\n\n            return hiveFileInfo;\n        }).collect(toImmutableList());\n    }\n\n    private static Map<String, HiveFileInfo> getTargetParentHiveFileInfoMap(\n            Optional<Partition> partition,\n            Path targetParent,\n            HiveDirectoryContext hiveDirectoryContext,\n            ExtendedFileSystem targetFilesystem,\n            DirectoryLister directoryLister,\n            Table table,\n            NamenodeStats namenodeStats)\n    {\n        Map<String, HiveFileInfo> targetParentHiveFileInfos = new HashMap<>();\n        Iterator<HiveFileInfo> hiveFileInfoIterator = directoryLister.list(targetFilesystem, table, targetParent, partition, namenodeStats, hiveDirectoryContext);\n","sourceCodeStart":1367,"sourceCodeEnd":1403,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-hive/src/main/java/com/facebook/presto/hive/HiveUtil.java#L1367-L1403","documentation":"Thrown when loading files via a SymlinkTextInputFormat manifest: a target path listed in the manifest does not match any HiveFileInfo gathered from the filesystem listing, so the referenced file does not exist. Presto refuses to produce splits for dangling manifest entries.","triggerScenarios":"A symlink text input manifest (symlink.txt) lists file URIs that are absent from the actual filesystem listing — files deleted/moved after the manifest was written, typos in URIs, or scheme/authority mismatch such that the normalized path lookup misses.","commonSituations":"ETL overwrote/deleted files while a manifest still references them; manifest generated against a different cluster/namespace (HA name mismatch); retention jobs pruning data referenced by old manifests.","solutions":["Regenerate the symlink manifest so it only lists existing files","Restore the missing files at the referenced paths","Check scheme/authority normalization (use the same NameNode URI form as configured in the connector)","Remove stale manifests/partitions pointing at deleted data"],"exampleFix":"# before: manifest references deleted file\nhdfs dfs -cat /t/symlink.txt\n# /data/part-0001 (missing)\n# after: rebuild manifest\nhdfs dfs -ls /data | awk '{print $8}' > /t/symlink.txt","handlingStrategy":"validation","validationCode":"// before running a symlink-manifest query, verify each manifest line exists\nfor (String line : Files.readAllLines(manifestPath)) {\n    Path p = new Path(line.trim());\n    FileSystem fs = p.getFileSystem(conf);\n    if (!fs.exists(p)) System.err.println(\"missing manifest target: \" + p);\n}","typeGuard":"boolean manifestTargetExists(org.apache.hadoop.fs.Path p, org.apache.hadoop.fs.FileSystem fs)\n        throws java.io.IOException {\n    return fs.exists(p);\n}","tryCatchPattern":"try { files = HiveUtil.getSymlinkFileInfos(...); }\ncatch (com.facebook.presto.spi.PrestoException e) {\n    if (\"HIVE_FILE_NOT_FOUND\".equals(e.getErrorCode().getName())) { /* regenerate manifest or restore files */ }\n    else throw e;\n}","preventionTips":["Regenerate manifests atomically after data rewrites","Avoid deleting files still referenced by manifests (use staging + swap)","Use consistent NameNode URI scheme/authority across manifest and connector config"],"tags":["hive","symlink-manifest","file-not-found","hdfs"],"backgroundTag":"symlink-manifest-file-missing","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}