prestodb/presto · error · IOException

Failed to open file

Error message

Failed to open file

What it means

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.

Source

Thrown at presto-cache/src/main/java/com/facebook/presto/cache/alluxio/AlluxioCachingFileSystem.java:70

        this.cacheValidationEnabled = cacheValidationEnabled;
        this.lastModifiedTimeCheckEnabled = lastModifiedTimeCheckEnabled;
    }

    @Override
    public synchronized void initialize(URI uri, Configuration configuration)
            throws IOException
    {
        this.localCacheFileSystem = new LocalCacheFileSystem(dataTier, uriStatus -> {
            // CacheContext is the mechanism to pass the hiveFileContext to the source filesystem
            // hiveFileContext is critical to use to open file.
            CacheContext cacheContext = uriStatus.getCacheContext();
            checkState(cacheContext instanceof PrestoCacheContext);
            HiveFileContext hiveFileContext = ((PrestoCacheContext) cacheContext).getHiveFileContext();
            try {
                return dataTier.openFile(new Path(uriStatus.getPath()), hiveFileContext);
            }
            catch (Exception e) {
                throw new IOException("Failed to open file", e);
            }
        });
        this.cacheQuotaEnabled = configuration.getBoolean(USER_CLIENT_CACHE_QUOTA_ENABLED.getName(), false);
        localCacheFileSystem.initialize(uri, configuration);
    }

    @Override
    public FSDataInputStream openFile(Path path, HiveFileContext hiveFileContext)
            throws Exception
    {
        // Using Alluxio caching requires knowing file size for now
        if (hiveFileContext.isCacheable() && hiveFileContext.getFileSize().isPresent()) {
            // FilePath is a unique identifier for a file, however it can be a long string
            // hence using sha256 hash of the file path as the identifier in the cache.
            // We don't set fileId because fileId is Alluxio specific
            FileInfo info = new FileInfo()
                    .setLastModificationTimeMs(hiveFileContext.getModificationTime())
                    .setPath(path.toString())

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check Alluxio cluster URI and cache configuration validity
  2. Verify the source filesystem URI is reachable and correctly configured
  3. Inspect the nested IOException cause for the precise failure
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at presto-cache/src/main/java/com/facebook/presto/cache/alluxio/AlluxioCachingFileSystem.java:70 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/3761a4bf7fd83690. Report an issue: GitHub.