You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @ndrluis, it's been a while, I think I created this issue after running the rest compatibility suite of the Java iceberg repo against lakekeeper. A lot of their tests were failing but not due to functional problems but due to the error code not matching what Java would expect.
Lakekeeper could try to align itself with what the test suite expects. In some cases it wouldn't make a difference in others it makes a difference in what exception a client will see which can or cannot be misleading.
I think in the example above, trying to read a table from a non-existing namespace will produce a table does not exist error instead of a name space does not exist error due to error code not matching the Java expectation.
In some tests, I got this kind of error that I don't know if it makes sense to fix, like these. @twuebi@c-thiel@mooori what do you think about these tests?
Iceberg REST Compatibility Kit > JUnit Jupiter > RESTCompatibilityKitViewCatalogTests > updateViewLocationConflict() FAILED
java.lang.AssertionError:
Expecting throwable message:
"View not found or action can_get_metadata forbidden for Principal(oidc~9410d0bf-4487-4177-a34f-af364cac0a59)"
to contain:
"View does not exist: ns.view"
I got some errors that returned a NotAuthorized exception, and this seems really strange to me. I will list all the cases that returned "Not authorized" and try to implement the tests on the Lakekeeper side to reproduce them.
Iceberg REST Compatibility Kit > JUnit Jupiter > RESTCompatibilityKitCatalogTests > testConcurrentReplaceTransactionSortOrderConflict() FAILED
org.apache.iceberg.exceptions.NotAuthorizedException: Not authorized: Failed to authenticate
at app//org.apache.iceberg.rest.ErrorHandlers$DefaultErrorHandler.accept(ErrorHandlers.java:234)
at app//org.apache.iceberg.rest.ErrorHandlers$DefaultErrorHandler.accept(ErrorHandlers.java:212)
at app//org.apache.iceberg.rest.HTTPClient.throwFailure(HTTPClient.java:215)
at app//org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:299)
at app//org.apache.iceberg.rest.BaseHTTPClient.post(BaseHTTPClient.java:100)
at app//org.apache.iceberg.aws.s3.signer.S3V4RestSignerClient.sign(S3V4RestSignerClient.java:256)
About the text in the requirement exception, I know that it's a problem on the iceberg-rust side. I will open a discussion on the Iceberg Mailing list because if we want to use the RCK to test any REST implementation, we need to follow the same error message in all clients, or we need to rewrite the RCK tests to be more permissive
I opened this PR #1278 to solve the issue reported here. However, I will open other PRs with the RCK setup and some fixes. I believe we can change the scope of this issue to be broader in order to solve the incompatibility with the spec.
Issue #306 — Some error types don't match the specs
I looked into the NamespaceNotFound -> NoSuchNamespaceException case described here (a 404 on a missing namespace surfacing as NoSuchTableException in the Java client because it keys off error.type).
Current state in this checkout:
NamespaceNotFound already maps to type: "NoSuchNamespaceException" with code 404 (crates/lakekeeper/src/service/catalog_store/namespace.rs).
The authz layer preserves that type for the not-found case (crates/lakekeeper/src/service/authz/namespace.rs — AuthZCannotSeeNamespace / AuthZCannotSeeAnonymousNamespace).
Table create (server/tables/create_table.rs via load_and_authorize_namespace_action) fails on the missing namespace before any table work, so POST /namespaces/{ns}/tables against a missing namespace returns NoSuchNamespaceException.
Table load by ident (service/authz/table.rs::load_and_authorize_table_operation) fetches warehouse/namespace/table in parallel and checks namespace presence before table presence, so a load in a missing namespace returns NoSuchNamespaceException, not NoSuchTableException.
Rename to a missing namespace is covered by an existing test asserting 404 + NoSuchNamespaceException (crates/lakekeeper-integration-tests/tests/server_tables_postgres.rs).
So the narrow example from the original report looks addressed in the current code. The earlier attempted fix in #1278 was closed unmerged, and its concerns (rename authz gating, 403-vs-404 mapping) have since moved on.
Why I'm not changing anything in this pass:
The remaining scope on this issue is the broader REST Compatibility Kit alignment from the later comments: exact type strings per endpoint, error message wording across clients (Java vs Rust), NotAuthorized vs requirement errors when authn is enabled, and view/rename edge cases. That is a matrix decision, not a single low-risk edit — it touches the deliberate 404-vs-403 ambiguity in the authz layer, the OpenAPI rest-catalog-open-api.yaml descriptions, and client expectations, and the right verification is a full RCK run (Java harness + live server), which I can't do reliably here.
Suggested approach:
Run the Iceberg REST Compatibility Kit against a minimal (no-auth) Lakekeeper and capture the current failure list (the old gists in this thread have expired).
Triage per endpoint: for each mismatch, decide the spec-correct type + code from the REST OpenAPI spec (e.g. NoSuchNamespaceException vs NoSuchTableException vs NoSuchViewException on load/create/rename/drop), separate from message-text differences that belong in the clients/RCK.
File small per-endpoint fixes with integration tests asserting error.type + code, keeping the authz information-hiding behavior intact; handle the auth-enabled NotAuthorized masking as its own issue.
Activity
ndrluis commentedon Aug 1, 2025
Hello @twuebi, could you elaborate on what the problem is with Lakekeeper? I'm a bit confused about the issue.
twuebi commentedon Aug 1, 2025
Hi @ndrluis, it's been a while, I think I created this issue after running the rest compatibility suite of the Java iceberg repo against lakekeeper. A lot of their tests were failing but not due to functional problems but due to the error code not matching what Java would expect.
Lakekeeper could try to align itself with what the test suite expects. In some cases it wouldn't make a difference in others it makes a difference in what exception a client will see which can or cannot be misleading.
I think in the example above, trying to read a table from a non-existing namespace will produce a table does not exist error instead of a name space does not exist error due to error code not matching the Java expectation.
ndrluis commentedon Aug 4, 2025
In some tests, I got this kind of error that I don't know if it makes sense to fix, like these. @twuebi @c-thiel @mooori what do you think about these tests?
I got some errors that returned a NotAuthorized exception, and this seems really strange to me. I will list all the cases that returned "Not authorized" and try to implement the tests on the Lakekeeper side to reproduce them.
Here are the results of the RCK run (https://gist.github.com/ndrluis/c2869d7f032808461fd51bde5182f8ee)
For the case of NamespaceNotFound -> NoSuchNamespaceException, I will open a PR in the next few days.
ndrluis commentedon Aug 4, 2025
I ran another test with the minimal setup (without Authentication), and here are the results (https://gist.github.com/ndrluis/f805f0aa41dfba05441e1b91164b59f3). So when we have AuthN enabled, we receive a NotAuthorized error instead of the requirement error. I will open a new issue for this case, as we have some other cases that I think we need to understand to determine if it's a problem in the Lakekeeper.
About the text in the requirement exception, I know that it's a problem on the iceberg-rust side. I will open a discussion on the Iceberg Mailing list because if we want to use the RCK to test any REST implementation, we need to follow the same error message in all clients, or we need to rewrite the RCK tests to be more permissive
ndrluis commentedon Aug 5, 2025
Mailing list thread about RCK and error messages
https://lists.apache.org/thread/rvxwxv1jzkxmhfb7ojzym08l44s7fqzp
ndrluis commentedon Aug 8, 2025
I opened this PR #1278 to solve the issue reported here. However, I will open other PRs with the RCK setup and some fixes. I believe we can change the scope of this issue to be broader in order to solve the incompatibility with the spec.
Sahan-Chathumina-25 commentedon Sep 28, 2026
Analysis:
Issue #306 — Some error types don't match the specs
I looked into the
NamespaceNotFound->NoSuchNamespaceExceptioncase described here (a 404 on a missing namespace surfacing asNoSuchTableExceptionin the Java client because it keys offerror.type).Current state in this checkout:
NamespaceNotFoundalready maps totype: "NoSuchNamespaceException"with code 404 (crates/lakekeeper/src/service/catalog_store/namespace.rs).crates/lakekeeper/src/service/authz/namespace.rs—AuthZCannotSeeNamespace/AuthZCannotSeeAnonymousNamespace).server/tables/create_table.rsviaload_and_authorize_namespace_action) fails on the missing namespace before any table work, soPOST /namespaces/{ns}/tablesagainst a missing namespace returnsNoSuchNamespaceException.service/authz/table.rs::load_and_authorize_table_operation) fetches warehouse/namespace/table in parallel and checks namespace presence before table presence, so a load in a missing namespace returnsNoSuchNamespaceException, notNoSuchTableException.404+NoSuchNamespaceException(crates/lakekeeper-integration-tests/tests/server_tables_postgres.rs).So the narrow example from the original report looks addressed in the current code. The earlier attempted fix in #1278 was closed unmerged, and its concerns (rename authz gating, 403-vs-404 mapping) have since moved on.
Why I'm not changing anything in this pass:
The remaining scope on this issue is the broader REST Compatibility Kit alignment from the later comments: exact
typestrings per endpoint, error message wording across clients (Java vs Rust),NotAuthorizedvs requirement errors when authn is enabled, and view/rename edge cases. That is a matrix decision, not a single low-risk edit — it touches the deliberate 404-vs-403 ambiguity in the authz layer, the OpenAPIrest-catalog-open-api.yamldescriptions, and client expectations, and the right verification is a full RCK run (Java harness + live server), which I can't do reliably here.Suggested approach:
type+ code from the REST OpenAPI spec (e.g.NoSuchNamespaceExceptionvsNoSuchTableExceptionvsNoSuchViewExceptionon load/create/rename/drop), separate from message-text differences that belong in the clients/RCK.error.type+code, keeping the authz information-hiding behavior intact; handle the auth-enabledNotAuthorizedmasking as its own issue.No tracked files changed.
No changes were proposed for now.