You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "markhoerth (via GitHub)" <gi...@apache.org> on 2026/08/30 20:50:43 UTC

[I] [BUG] Invalid metadata object type in path returns 500 as an internal authorization error [gravitino]

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

   An unrecognised `{type}` path parameter on the metadata object endpoints returns HTTP 500 with an internal-error message, rather than rejecting the request as malformed.
   
   Reproduce, against a server with authorization enabled:
   
   ```
   curl -s -w '\n%{http_code}\n' \
     'http://<server>:8090/api/metalakes/zz/objects/bogusType/a.b.c/tags'
   ```
   
   Response:
   
   ```json
   {"code":1002,"type":"RuntimeException",
    "message":"Authorization failed due to system internal error. Please contact administrator.",
    "stack":["java.lang.IllegalArgumentException: No enum constant org.apache.gravitino.MetadataObject.Type.BOGUSTYPE",
             "\tat java.base/java.lang.Enum.valueOf(Enum.java:273)",
             "\tat org.apache.gravitino.MetadataObject$Type.valueOf(MetadataObject.java:35)"]}
   ```
   
   `MetadataObject$Type.valueOf` is called inside `GravitinoInterceptionService$MetadataAuthorizationMethodInterceptor`, so the failure happens in the authorization interceptor before the resource method validates its own arguments.
   
   A malformed path parameter is a client error. The endpoint must return 400 with an error code naming the rejected value, and must not report a client input error as a system internal error directing the caller to contact an administrator.
   
   Affected families:
   
   - `/metalakes/{metalake}/objects/{type}/{fullName}/tags`
   - `/metalakes/{metalake}/objects/{type}/{fullName}/policies`
   - `/metalakes/{metalake}/objects/{type}/{fullName}/statistics`
   - `/metalakes/{metalake}/objects/{type}/{fullName}/statistics/partitions`
   - `/metalakes/{metalake}/objects/{type}/{fullName}/credentials`
   - `/metalakes/{metalake}/owners/{metadataObjectType}/{fullName}`
   - `/metalakes/{metalake}/tags/{type}/{fullName}`
   
   `/metalakes/{metalake}/objects/{type}/{fullName}/roles` returns 400 on the same input, so the correct handling already exists in one handler and can be applied to the rest.
   
   Found by a REST contract sweep over all 130 `/metalakes` endpoints on build 1.3.0-SNAPSHOT, commit 6d9d432df18a9bd124c162ea50a296f436549980.
   
   Required: fixed upstream in apache/gravitino and present in the enterprise tree before RC2 on September 4.
   


-- 
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: commits-unsubscribe@gravitino.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Invalid metadata object type in path returns 500 as an internal authorization error [gravitino]

Posted by "markhoerth (via GitHub)" <gi...@apache.org>.
markhoerth commented on issue #12727:
URL: https://github.com/apache/gravitino/issues/12727#issuecomment-5471184778

   The RC2 date in the description refers to a downstream release and does not apply here. Tracked downstream as datastrato/gravitino-enterprise#1533.


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Invalid metadata object type in path returns 500 as an internal authorization error [gravitino]

Posted by "jerryshao (via GitHub)" <gi...@apache.org>.
jerryshao closed issue #12727: [BUG] Invalid metadata object type in path returns 500 as an internal authorization error
URL: https://github.com/apache/gravitino/issues/12727


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [BUG] Invalid metadata object type in path returns 500 as an internal authorization error [gravitino]

Posted by "nevzheng (via GitHub)" <gi...@apache.org>.
nevzheng commented on issue #12727:
URL: https://github.com/apache/gravitino/issues/12727#issuecomment-5610224903

   Fix proposed in [PR #13059](https://github.com/apache/gravitino/pull/13059): unsupported metadata-object types return HTTP 400 with code `1001` and the rejected value, instead of an internal authorization 500. Valid requests and unrelated authorization failures retain their existing behavior.
   
   The PR reports 19 passing interceptor tests and a passing raw HTTP integration test with authorization enabled.
   
   [Jerry](https://github.com/jerryshao) / [Rory](https://github.com/roryqi): please review. I’ll address feedback and follow up with broader E2E coverage. Stack-trace redaction is handled separately in [#13057](https://github.com/apache/gravitino/pull/13057).


-- 
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: commits-unsubscribe@gravitino.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org