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

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   `AccessControlManager.addUser`, `addGroup`, `removeUser`, and `removeGroup` 
all declare `NoSuchMetalakeException`, but nothing on the path checks that the 
metalake exists. An add or remove against a missing metalake surfaces the 
internal `NoSuchEntityException` from the entity-id lookup instead of the 
declared type, so a caller catching `NoSuchMetalakeException` (core code and 
the Java client) misses it and the 404 carries a generic entity message rather 
than the metalake one. The sibling `countUsers`, paginated `listUsers`, and 
`countGroups` already call `MetalakeManager.checkMetalake` on entry.
   
   ### Error message and/or stacktrace
   
   Calling `addUser("nonexistent-metalake", "u1")` fails with a generic "entity 
does not exist" error instead of `NoSuchMetalakeException`.
   
   ### How to reproduce
   
   On main, call `addUser` / `addGroup` / `removeUser` / `removeGroup` on 
`AccessControlManager` with a metalake name that does not exist.
   
   ### Additional context
   
   The methods should call `MetalakeManager.checkMetalake` on entry, matching 
the count/list siblings.


-- 
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