Skip to content

Misleading "namespace doesn't exist" error when in fact catalog doesn't exist #227

@sfc-gh-npuka

Description

@sfc-gh-npuka
CREATE TABLE test (a int) USING iceberg WITH (catalog = 'rest');

ERROR:  HTTP request failed (HTTP 404)
DETAIL:  Namespace does not exist: 
HINT:  The rest catalog returned error type: NoSuchNamespaceException

After debugging, we realized with @sfc-gh-abozkurt that the namespace URL actually showed us that it was using a non-existent catalog name: https://.../polaris/api/catalog/v1/non_existing_catalog_name/namespace_name. This was a mistake from my part, as I had used a different name for the REST catalog.

The error, however, is quite misleading. When the GET for the namespace returns 404, the code assumes "namespace doesn't exist" and tries to create it. But if the catalog doesn't exist, Polaris also returns 404, and the subsequent CreateNamespaceOnRestCatalog call also fails with a 404 "Namespace does not exist" which is misleading. See function RegisterNamespaceToRestCatalog. We should check whether the catalog exists first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions