prestodb/presto · error · PrestoException

ICEBERG_FILESYSTEM_ERROR

ICEBERG_FILESYSTEM_ERROR

Error message

Error getting file system at path %s

What it means

ICEBERG_FILESYSTEM_ERROR thrown by RegisterTableProcedure.getFileSystem when HdfsEnvironment.getFileSystem fails while obtaining a FileSystem handle for the table location during table registration. It wraps any underlying Hadoop/IO exception (missing HDFS config, bad scheme, auth failure) with the offending path in the message.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/procedure/RegisterTableProcedure.java:138

                        metadataDirectory));

        metadata.registerTable(clientSession, schemaTableName, metadataPath, deleteDataOnDrop);
    }

    public static FileSystem getFileSystem(ConnectorSession clientSession, HdfsEnvironment hdfsEnvironment, SchemaTableName schemaTableName, Path location)
    {
        HdfsContext hdfsContext = new HdfsContext(
                clientSession,
                schemaTableName.getSchemaName(),
                schemaTableName.getTableName(),
                location.getName(),
                true);

        try {
            return hdfsEnvironment.getFileSystem(hdfsContext, location);
        }
        catch (Exception e) {
            throw new PrestoException(ICEBERG_FILESYSTEM_ERROR, format("Error getting file system at path %s", location), e);
        }
    }

    public static Path resolveLatestMetadataLocation(ConnectorSession clientSession, FileSystem fileSystem, Path metadataPath)
    {
        int maxVersion = -1;
        long lastModifiedTime = -1;
        Path metadataFile = null;
        boolean duplicateVersions = false;

        try {
            FileStatus[] files = fileSystem.listStatus(metadataPath, name -> name.getName().contains(METADATA_FILE_EXTENSION));
            for (FileStatus file : files) {
                int version = parseMetadataVersionFromFileName(file.getPath().getName());
                if (version > maxVersion) {
                    maxVersion = version;
                    metadataFile = file.getPath();
                    lastModifiedTime = file.getModificationTime();

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Check the location URI scheme and host — ensure the Presto cluster's HDFS/Hive configuration (core-site.xml, hdfs-site.xml) covers it
  2. Verify Kerberos credentials/tokens for the Presto process are valid and refreshed
  3. Confirm the NameNode / object store endpoint is reachable from all worker nodes
  4. Inspect the wrapped cause (e) in the Presto logs for the actual filesystem error

Example fix

// before
String location = "/user/hive/warehouse/tbl"; // no scheme
// after
String location = "hdfs://nameservice1/user/hive/warehouse/tbl"; // fully-qualified URI
Defensive patterns

Strategy: try-catch

Validate before calling

// Validate the location URI is fully qualified and the scheme is configured
java.net.URI uri = java.net.URI.create(location);
if (uri.getScheme() == null || uri.getAuthority() == null) {
    throw new IllegalArgumentException("Location must be fully qualified: " + location);
}

Type guard

boolean isSupportedLocation(String location) {
    String scheme = java.net.URI.create(location).getScheme();
    return scheme != null && (scheme.equals("hdfs") || scheme.equals("s3a") || scheme.equals("abfs") || scheme.equals("abfss") || scheme.equals("file"));
}

Try / catch

try {
    CALL register_table procedure
} catch (PrestoException e) {
    if ("ICEBERG_FILESYSTEM_ERROR".equals(e.getErrorCode().getName())) {
        // inspect e.getCause() for Hadoop-level failure; fix config/URI then retry
    }
}

Prevention

When it happens

Trigger: Calling the register_table procedure whose metadataPath() invokes getFileSystem on a location where HDFS environment setup fails — e.g. invalid URI scheme, missing hdfs-site/core-site config, or Kerberos/token failure in HdfsContext.

Common situations: Registering an Iceberg table from a location on a filesystem not configured in the Presto Hadoop environment; expired Kerberos TGT/delegation token; location URI typo (s3a vs s3, wrong namenode host); HDFS NameNode down.

Related errors


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