prestodb/presto · error · PrestoException
HIVE_FILESYSTEM_ERROR
HIVE_FILESYSTEM_ERROR
Error message
Failed checking path:
What it means
isS3FileSystem obtains a Hadoop FileSystem for the given path to test whether the underlying (raw) filesystem is PrestoS3FileSystem; an IOException from the Hadoop filesystem layer is wrapped in HIVE_FILESYSTEM_ERROR with the path appended. This check is part of default-location validation and temporary-path creation.
Source
Thrown at presto-hive/src/main/java/com/facebook/presto/hive/HiveWriteUtils.java:452
throw new PrestoException(HIVE_DATABASE_LOCATION_ERROR, format("Database '%s' location is not a directory: %s", schemaName, databasePath));
}
}
return new Path(databasePath, tableName);
}
private static Database getDatabase(ConnectorIdentity identity, MetastoreContext metastoreContext, SemiTransactionalHiveMetastore metastore, String database)
{
return metastore.getDatabase(metastoreContext, database).orElseThrow(() -> new SchemaNotFoundException(database));
}
public static boolean isS3FileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path)
{
try {
return getRawFileSystem(hdfsEnvironment.getFileSystem(context, path)) instanceof PrestoS3FileSystem;
}
catch (IOException e) {
throw new PrestoException(HIVE_FILESYSTEM_ERROR, "Failed checking path: " + path, e);
}
}
public static boolean isViewFileSystem(HdfsContext context, HdfsEnvironment hdfsEnvironment, Path path)
{
try {
return getRawFileSystem(hdfsEnvironment.getFileSystem(context, path)) instanceof ViewFileSystem;
}
catch (IOException e) {
throw new PrestoException(HIVE_FILESYSTEM_ERROR, "Failed checking path: " + path, e);
}
}
private static FileSystem getRawFileSystem(FileSystem fileSystem)
{
if (fileSystem instanceof HadoopExtendedFileSystem) {
return getRawFileSystem(((HadoopExtendedFileSystem) fileSystem).getRawFileSystem());
}View on GitHub (pinned to 55bb57d202)
Solutions
- Verify the storage cluster is reachable and the NameNode/endpoint is healthy (hdfs dfs -ls <path> from a worker)
- Check filesystem URI scheme is correct and supported (hdfs://, s3a/s3n, viewfs) in the database location
- Review worker logs for the wrapped IOException cause (auth, DNS, timeout) and fix credentials/network accordingly
Example fix
// before location: hdfs://wrongnn:9000/warehouse/db.db -- NameNode unreachable // after ALTER DATABASE db SET LOCATION 'hdfs://correctnn:9000/warehouse/db.db';
Defensive patterns
Strategy: retry
Validate before calling
Path p = new Path(dbLocation);
try (FileSystem fs = FileSystem.get(p.toUri(), conf)) { fs.getUri(); }
catch (IOException e) { throw new IllegalStateException("Filesystem unreachable for " + p, e); } Try / catch
try {
createTable(schema, ...);
} catch (PrestoException e) {
if (e.getErrorCode() == HIVE_FILESYSTEM_ERROR.toErrorCode() && e.getCause() instanceof IOException) {
// check NN health/auth, back off, retry
} else throw e;
} Prevention
- Monitor NameNode/endpoint health from worker hosts
- Keep keytabs/credentials fresh to avoid auth IOExceptions
- Use stable, correct scheme://authority URIs in database locations
When it happens
Trigger: Any call path (e.g. getTableDefaultLocation, CREATE TABLE location validation) where opening the FileSystem for the database path fails — NameNode unreachable, kerberos/auth failure, unknown URI scheme, network timeout.
Common situations: HDFS NameNode down or in safe mode; wrong URI scheme (no handler for scheme); expired/invalid Kerberos token or missing credentials; network partition to storage.
Related errors
- HIVE_FILESYSTEM_ERROR
- HIVE_FILESYSTEM_ERROR
- HIVE_WRITER_CLOSE_ERROR
- HIVE_WRITER_OPEN_ERROR
- HIVE_BAD_DATA
AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04).
Data as JSON: /api/errors/bbf9ef11918dfd7a.
Report an issue: GitHub.