{"record":{"id":"3761a4bf7fd83690","repo":"prestodb/presto","slug":"failed-to-open-file","errorCode":null,"errorMessage":"Failed to open file","messagePattern":"Failed to open file","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"presto-cache/src/main/java/com/facebook/presto/cache/alluxio/AlluxioCachingFileSystem.java","lineNumber":70,"sourceCode":"        this.cacheValidationEnabled = cacheValidationEnabled;\n        this.lastModifiedTimeCheckEnabled = lastModifiedTimeCheckEnabled;\n    }\n\n    @Override\n    public synchronized void initialize(URI uri, Configuration configuration)\n            throws IOException\n    {\n        this.localCacheFileSystem = new LocalCacheFileSystem(dataTier, uriStatus -> {\n            // CacheContext is the mechanism to pass the hiveFileContext to the source filesystem\n            // hiveFileContext is critical to use to open file.\n            CacheContext cacheContext = uriStatus.getCacheContext();\n            checkState(cacheContext instanceof PrestoCacheContext);\n            HiveFileContext hiveFileContext = ((PrestoCacheContext) cacheContext).getHiveFileContext();\n            try {\n                return dataTier.openFile(new Path(uriStatus.getPath()), hiveFileContext);\n            }\n            catch (Exception e) {\n                throw new IOException(\"Failed to open file\", e);\n            }\n        });\n        this.cacheQuotaEnabled = configuration.getBoolean(USER_CLIENT_CACHE_QUOTA_ENABLED.getName(), false);\n        localCacheFileSystem.initialize(uri, configuration);\n    }\n\n    @Override\n    public FSDataInputStream openFile(Path path, HiveFileContext hiveFileContext)\n            throws Exception\n    {\n        // Using Alluxio caching requires knowing file size for now\n        if (hiveFileContext.isCacheable() && hiveFileContext.getFileSize().isPresent()) {\n            // FilePath is a unique identifier for a file, however it can be a long string\n            // hence using sha256 hash of the file path as the identifier in the cache.\n            // We don't set fileId because fileId is Alluxio specific\n            FileInfo info = new FileInfo()\n                    .setLastModificationTimeMs(hiveFileContext.getModificationTime())\n                    .setPath(path.toString())","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-cache/src/main/java/com/facebook/presto/cache/alluxio/AlluxioCachingFileSystem.java#L52-L88","documentation":"Generic guard in AlluxioCachingFileSystem.initialize: constructing/initializing the underlying LocalCacheFileSystem for the given URI threw an IOException, so the caching filesystem wrapper could not be set up for that path.","triggerScenarios":"Thrown at presto-cache/src/main/java/com/facebook/presto/cache/alluxio/AlluxioCachingFileSystem.java:70 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check Alluxio cluster URI and cache configuration validity","Verify the source filesystem URI is reachable and correctly configured","Inspect the nested IOException cause for the precise failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}