{"record":{"id":"762b16d03e95752e","repo":"prestodb/presto","slug":"invalid-schema-property-762b16","errorCode":"INVALID_SCHEMA_PROPERTY","errorMessage":"Invalid location URI: ","messagePattern":"Invalid location URI: ","errorType":"error_code","errorClass":"PrestoException","httpStatus":null,"severity":"error","filePath":"presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergHiveMetadata.java","lineNumber":336,"sourceCode":"        return schemaNames.stream()\n                .flatMap(schema -> metastore\n                        .getAllTables(metastoreContext, schema)\n                        .orElseGet(() -> ImmutableList.of())\n                        .stream()\n                        .map(table -> new SchemaTableName(schema, table)))\n                .collect(toImmutableList());\n    }\n\n    @Override\n    public void createSchema(ConnectorSession session, String schemaName, Map<String, Object> properties)\n    {\n        shouldRunInAutoCommitTransaction(\"CREATE SCHEMA\");\n        Optional<String> location = getLocation(properties).map(uri -> {\n            try {\n                hdfsEnvironment.getFileSystem(new HdfsContext(session, schemaName), new Path(uri));\n            }\n            catch (IOException | IllegalArgumentException e) {\n                throw new PrestoException(INVALID_SCHEMA_PROPERTY, \"Invalid location URI: \" + uri, e);\n            }\n            return uri;\n        });\n\n        Database database = Database.builder()\n                .setDatabaseName(schemaName)\n                .setLocation(location)\n                .setOwnerType(USER)\n                .setOwnerName(session.getUser())\n                .build();\n\n        MetastoreContext metastoreContext = getMetastoreContext(session);\n        metastore.createDatabase(metastoreContext, database);\n    }\n\n    @Override\n    public void dropSchema(ConnectorSession session, String schemaName)\n    {","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-iceberg/src/main/java/com/facebook/presto/iceberg/IcebergHiveMetadata.java#L318-L354","documentation":"createSchema() validates an optional LOCATION property by probing the filesystem via HdfsEnvironment before creating the database. If the URI is malformed (IllegalArgumentException) or the filesystem access fails (IOException), Presto throws PrestoException with code INVALID_SCHEMA_PROPERTY, indicating the user-supplied location URI is unusable.","triggerScenarios":"CREATE SCHEMA ... WITH (location = 'uri') where the URI is malformed, points to a non-existent/inaccessible HDFS or S3 path, or the filesystem scheme is not configured (e.g. missing s3 credentials or wrong scheme).","commonSituations":"Typo in the location URI; missing HDFS permissions for the Presto user; S3/ABFS credentials not configured in the catalog properties; using a local-path URI on a cluster where only HDFS/object store is valid.","solutions":["Check the location URI syntax and scheme (must be a fully qualified, valid Path)","Verify the path exists or is creatable and the Presto service user has write access on the target filesystem","Confirm filesystem credentials/config (core-site.xml, s3 credentials in catalog properties) are present on coordinators and workers","Retry CREATE SCHEMA with a corrected or omitted location property"],"exampleFix":"// before\nCREATE SCHEMA sales WITH (location = 'hdfs:/namenode/data/sales'); // malformed URI\n// after\nCREATE SCHEMA sales WITH (location = 'hdfs://namenode:8020/data/sales');","handlingStrategy":"validation","validationCode":"-- Validate the location URI before CREATE SCHEMA\n-- (check scheme is fully qualified and path is accessible from Presto):\nCREATE SCHEMA IF NOT EXISTS sales WITH (location = 'hdfs://namenode:8020/warehouse/sales');","typeGuard":null,"tryCatchPattern":"try {\n    stmt.execute(\"CREATE SCHEMA sales WITH (location='\" + uri + \"')\");\n} catch (SQLException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"Invalid location URI\")) {\n        // fix URI / check filesystem access & credentials, then retry\n    } else { throw e; }\n}","preventionTips":["Always use fully qualified URIs (scheme://host:port/path)","Test the path from a Presto worker (permissions + credentials) before creating schemas","Keep HDFS/object-store client configs consistent across coordinator and workers","Prefer creating locations with the same tooling that manages the cluster"],"tags":["iceberg","hdfs","invalid-uri","schema-creation"],"backgroundTag":"invalid-location-uri","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"}