markhoerth opened a new issue, #14432:
URL: https://github.com/apache/gravitino/issues/14432

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   The Iceberg REST server answers several kinds of invalid client requests 
with a 5xx, a 403, a 404 or a 406, or with a non-ErrorModel body, where the 
Iceberg REST spec expects 400 with an ErrorModel. Found by a systematic test of 
the IRC with Iceberg 1.11.0 on the server:
   
   1. A missing request body or a missing required field returns 500 
NullPointerException, or 403, on 10 routes (create/rename namespace, table and 
view, update table, register, metrics, plan).
   2. Malformed or wrongly typed JSON is answered with a text/plain Jackson 
message naming internal classes.
   3. Registering a table whose metadata-location does not exist returns 500 
NotFoundException.
   4. A non-numeric `pageSize` returns 404, which clients read as a missing 
namespace.
   5. A table create with a v3 type on a v2 table, or a non-integer 
format-version, returns 500.
   6. A table create with format-version 0, -1 or 4 is accepted, and writes 
metadata clients cannot read.
   7. A table location in a missing bucket or with an unusable scheme returns 
500 with the raw AWS SDK message, including request ids.
   8. set-default-spec / set-default-sort-order with an id the table does not 
have returns 500 NullPointerException, sometimes with a null message.
   9. An invalid transform for the column type, or an unknown update action, 
returns 406.
   
   ### Error message and/or stacktrace
   
   Examples: `500 {"type":"NullPointerException"}`, `406 
{"type":"UnsupportedOperationException","message":"Cannot convert metadata 
update action to json: no-such-action"}`, text/plain `Unrecognized field "x" 
(class org.apache.iceberg.rest.requests.CreateTableRequest)...`.
   
   ### How to reproduce
   
   - `POST /v1/{prefix}/namespaces` with an empty body.
   - `POST /v1/{prefix}/namespaces/{ns}/tables` with `{"name": "t", ` 
(truncated JSON).
   - `GET /v1/{prefix}/namespaces?pageSize=abc`.
   - `POST /v1/{prefix}/namespaces/{ns}/tables` with `"properties": 
{"format-version": "4"}`.
   - `POST /v1/{prefix}/namespaces/{ns}/tables/{t}` with 
`{"requirements":[],"updates":[{"action":"set-default-spec","spec-id":42}]}`.
   
   ### Additional context
   
   All of these are client errors per the REST spec and should be 400 with an 
ErrorModel; storage-service failures should be 503 without the SDK message.
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to