prestodb/presto · error · PrestoException

ICEBERG_FILESYSTEM_ERROR

ICEBERG_FILESYSTEM_ERROR

Error message

Failed to create input file: ${path}

What it means

HdfsInputFile's constructor creates a HadoopInputFile delegate for the given path using the filesystem and configuration from HdfsEnvironment. Any IOException during this creation is converted to a PrestoException with code ICEBERG_FILESYSTEM_ERROR, so failures opening/accessing the file (missing file, bad credentials, wrong scheme) surface here at construction time.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/HdfsInputFile.java:54

    private final String user;
    private final AtomicLong length;

    public HdfsInputFile(Path path, HdfsEnvironment environment, HdfsContext context, Optional<Long> length)
    {
        requireNonNull(path, "path is null");
        this.environment = requireNonNull(environment, "environment is null");
        this.length = new AtomicLong(length.orElse(-1L));
        requireNonNull(context, "context is null");
        try {
            if (this.length.get() < 0) {
                this.delegate = HadoopInputFile.fromPath(path, environment.getFileSystem(context, path), environment.getConfiguration(context, path));
            }
            else {
                this.delegate = HadoopInputFile.fromPath(path, this.length.get(), environment.getFileSystem(context, path), environment.getConfiguration(context, path));
            }
        }
        catch (IOException e) {
            throw new PrestoException(ICEBERG_FILESYSTEM_ERROR, "Failed to create input file: " + path, e);
        }
        this.user = context.getIdentity().getUser();
    }

    public HdfsInputFile(Path path, HdfsEnvironment environment, HdfsContext context)
    {
        this(path, environment, context, Optional.empty());
    }

    @Override
    public long getLength()
    {
        return length.updateAndGet(value -> {
            if (value < 0) {
                return environment.doAs(user, delegate::getLength);
            }
            return value;
        });

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Verify the path exists and is readable by the Presto user (hdfs dfs -test / aws s3 ls).
  2. Fix the URI scheme and filesystem configuration (core-site/hive metastore thrift URI, s3 credentials).
  3. Check the wrapped IOException cause for permission vs not-found vs connectivity and address accordingly.
  4. Confirm the filesystem plugin/jar for the scheme (s3a, abfs, gcs) is installed on the coordinator/workers.

Example fix

// before
InputFile in = new HdfsInputFile(new Path(path), environment, context);
// after: pre-check
Path p = new Path(path);
FileSystem fs = environment.getFileSystem(context, p);
if (!fs.exists(p)) { throw new TableNotFoundException(...); }
InputFile in = new HdfsInputFile(p, environment, context);
Defensive patterns

Strategy: validation

Validate before calling

Path p = new Path(path);
FileSystem fs = environment.getFileSystem(context, p);
if (!fs.exists(p)) throw new TableNotFoundException(schemaTableName);
fs.open(p).close(); // probe readability

Type guard

boolean canOpen(HdfsContext ctx, String path) { try { return environment.getFileSystem(ctx, new Path(path)).exists(new Path(path)); } catch (IOException e) { return false; } }

Try / catch

try { InputFile f = new HdfsInputFile(path, env, ctx); } catch (PrestoException e) { if (e.getCause() instanceof FileNotFoundException) { /* file vanished: reload metadata */ } else if (e.getCause() instanceof IOException) { /* perms/connectivity: alert */ } throw e; }

Prevention

When it happens

Trigger: Constructing HdfsInputFile for a path whose HadoopInputFile.fromPath throws IOException: path does not exist, permission denied, unsupported/incorrect URI scheme, or filesystem initialization failure (bad Namenode address, missing credentials).

Common situations: Reading a table whose metadata/data files were deleted externally, misconfigured s3/hdfs URI, expired cloud credentials, missing jar for the filesystem scheme, permission/impersonation mismatch.

Related errors


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