You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "oguzhanunlu (via GitHub)" <gi...@apache.org> on 2026/01/05 10:55:00 UTC
[PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
oguzhanunlu opened a new pull request, #14965:
URL: https://github.com/apache/iceberg/pull/14965
## Summary
This PR proposes adding HTTP 404 as a documented response for the `/v1/config` endpoint in the REST Catalog OpenAPI specification.
- The OpenAPI spec is amended to allow 404 (Not Found) if a warehouse does not exist
- The core Java library is amended to raise a `NoSuchWarehouseException` corresponding to this error response
- Unit test to assert 404 response yield the expected exception in the Java core library
## Rationale
The `/v1/config` endpoint allows an optional query parameter for a warehouse identifier, e.g. `/v1/config?warehouse=mywarehouse`. But the openapi spec does not specify what should happen if the requested warehouse does not exist.
We noticed that Snowflake Open Catalog already returns a 404 for non-existent warehouses:
```json
{
"error": {
"message": "Unable to find warehouse NONEXISTENT_WAREHOUSE_12345",
"type": "NotFoundException",
"code": 404
}
}
```
This PR therefore formalizes what Snowflake Open Catalog is already doing in production. It seems sensible to formalize the 404 response code, because this is consistent with other Iceberg REST endpoints which allow a 404 response code for missing respources (tables, namespaces, views).
## Our use case
At my company we triage Iceberg exceptions according to their type. For example, an exception for a missing resource might get triaged to the team responsible for providing that resource.
Currently, the Iceberg core library yields the generic `RESTException` if a warehouse does not exist. It is difficult to automatically triage the generic `RESTException`. It would help us if Iceberg could yield the `NoSuchWarehouseException` instead, so our application code can more confidently triage this runtime issue.
We expect other Iceberg users have similar operational workflows where distinguishing warehouse configuration errors from other failures would improve their incident response.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-4094577837
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-4051300198
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #14965: API, Core: Add 404 handling for /v1/config endpoint
URL: https://github.com/apache/iceberg/pull/14965
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "oguzhanunlu (via GitHub)" <gi...@apache.org>.
oguzhanunlu commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-3767926937
Hi @danielcweeks, I've addressed your feedback by adding a null check for `error.type()` to distinguish valid Iceberg 404 responses from 404s caused by misconfigured URIs.
When the URI points to a non-Iceberg server, the response won't have a valid error type, so we fall through to the default handler instead of throwing NoSuchWarehouseException.
I've also added a test for the misconfigured URI case and removed the comment per @kevinjqliu's suggestion.
I'd appreciate another look when you have a chance!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "oguzhanunlu (via GitHub)" <gi...@apache.org>.
oguzhanunlu commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-3754675981
Thanks for the feedback @danielcweeks. You're right that a 404 on /v1/config could come from either:
1. A valid Iceberg server (warehouse doesn't exist)
2. A misconfigured URL pointing to a non-Iceberg server
I traced through the error handling flow and have two options:
**Option 1: Check error.type() != null**
When DefaultErrorHandler.parseResponse() fails to parse the response body, it returns an ErrorResponse with type = null. Per [the spec](https://github.com/apache/iceberg/blob/c1aed477d1c0c8ef93aa8dea23f75e5ab11f5be6/open-api/rest-catalog-open-api.yaml#L1988), type is required, so valid Iceberg servers must include it.
```java
if (error.code() == 404 && error.type() != null) {
throw new NoSuchWarehouseException("%s", error.message());
}
```
Pros: Minimal change
Cons: Uses type as a proxy for "did parsing succeed?" - relies on the fallback not setting type, which is an implementation detail rather than intentional design
**Option 2: Add explicit `hasValidBody` flag to ErrorResponse**
Add a boolean field that explicitly tracks whether the response body was successfully parsed.
Pros: Explicit, self-documenting, won't break if fallback logic changes
Cons: Larger change - requires modifying ErrorResponse, parser, and fallback logic
Which approach would you prefer?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "danielcweeks (via GitHub)" <gi...@apache.org>.
danielcweeks commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-3747136540
@oguzhanunlu I'm a little concerned around the semantics for a `404` on the config endpoint. The config endpoint doesn't specifically identify a warehouse, it the configuration endpoint for a REST Catalog server, so a 404 could also indicate that the url is incorrectly defined and the config endpoint is not available at the requested path.
This could result in confusing errors if we aren't handling that correctly. You should add some tests that return a 404 that is not formatted as an error response and ensure that we're surfacing an appropriate error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "oguzhanunlu (via GitHub)" <gi...@apache.org>.
oguzhanunlu commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-3746473621
Thanks @kevinjqliu ! I just updated PR description, at the bottom, to refer to the devlist thread.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-3746426795
Thanks for raising a corresponding devlist thread, could you include it in the PR description? https://lists.apache.org/thread/xshfmp6m78l4ys6loozwop0fjl0cov3d
I'll chime in on the thread 😄
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "oguzhanunlu (via GitHub)" <gi...@apache.org>.
oguzhanunlu commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-4113741078
Thanks @danielcweeks! I've split it up — the spec change is at #15746 for discussion/vote. I'll open the implementation PR separately once that's settled.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "istreeter (via GitHub)" <gi...@apache.org>.
istreeter commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-3880028738
@danielcweeks @kevinjqliu do you have any feedback on the changes since your last review?
Sorry to nudge you. It would really help us to get this PR over the line, so that we can triage exceptions by their type.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "kevinjqliu (via GitHub)" <gi...@apache.org>.
kevinjqliu commented on code in PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#discussion_r2688378035
##########
open-api/rest-catalog-open-api.yaml:
##########
@@ -4660,6 +4662,22 @@ components:
}
}
+ # Note that this is a representative example response for use as a shorthand in the spec.
+ # The fields `message` and `type` as indicated here are not presently prescriptive.
Review Comment:
```suggestion
```
nit: dont really need this explanation since its under `example`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org
Re: [PR] API, Core: Add 404 handling for /v1/config endpoint [iceberg]
Posted by "danielcweeks (via GitHub)" <gi...@apache.org>.
danielcweeks commented on PR #14965:
URL: https://github.com/apache/iceberg/pull/14965#issuecomment-4113387074
@oguzhanunlu saw this got closed out. If you want to continue with the PR, it actually needs to be split up and the REST spec changes need to be discussed and voted on prior to making the change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org