You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gravitino.apache.org by "danhuawang (via GitHub)" <gi...@apache.org> on 2026/06/04 10:26:07 UTC

[I] [Bug report] serviceAdmins not all initialized as IDP users when multiple admins configured [gravitino]

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

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   When `gravitino.authorization.serviceAdmins = admin,service-account-postman-client` is configured, only the first admin (`admin`) is initialized as an IDP user during startup. The second service admin (`service-account-postman-client`) is NOT created in the IDP user store.
   
   Expected behavior: All users listed in `gravitino.authorization.serviceAdmins` should be created as IDP users during initialization when `GRAVITINO_INITIAL_ADMIN_PASSWORD` is set.
   
   Actual behavior: Only `admin` is created. `service-account-postman-client` does not exist in the IDP user store, causing authentication failures (401) and "IdP user not found" errors (404) when attempting to use or manage it.
   
   ```
   curl -u admin:Passw0rd-Admin12 http://192.168.97.2:30090/api/idp/users/service-account-postman-client
   
   {"code":1003,"type":"NotFoundException","message":"Failed to operate built-in IdP user  [service-account-postman-client] operation [GET], reason [IdP user not found: service-account-postman-client]","stack":["org.apache.gravitino.exceptions.NotFoundException: IdP user not found: service-account-postman-client","\tat org.apache.gravitino.idp.storage.service.IdpUserMetaService.getIdpUser(IdpUserMetaService.java:70)","\tat org.apache.gravitino.idp.IdpUserGroupManager.getUser(IdpUserGroupManager.java:150)","\tat org.apache.gravitino.idp.web.rest.IdpUserOperations.lambda$getUser$0(IdpUserOperations.java:66)","\tat java.base/java.security.AccessController.doPrivileged(AccessController.java:712)","\tat java.base/javax.security.auth.Subject.doAs(Subject.java:439)","\tat org.apache.gravitino.utils.PrincipalUtils.doAs(PrincipalUtils.java:53)","\tat org.apache.gravitino.idp.web.IdpRESTUtils.doAs(IdpRESTUtils.java:53)","\tat org.apache.gravitino.idp.web.IdpRESTUtils.doAs(IdpRESTUtils.java:64)
 ","\tat org.apache.gravitino.idp.web.rest.IdpUserOperations.getUser(IdpUserOperations.java:64)","\tat jdk.internal.reflect.GeneratedMethodAccessor297.invoke(Unknown Source)","\tat java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)","\t
   ```
   
   ### Error message and/or stacktrace
   
   When authenticating as `service-account-postman-client`:
   ```
   HTTP 401 Unauthorized
   ```
   
   When admin tries to change `service-account-postman-client`'s password via `PUT /api/idp/users/service-account-postman-client`:
   ```json
   {
     "code": 1003,
     "type": "NotFoundException",
     "message": "Failed to operate built-in IdP user [service-account-postman-client] operation [UPDATE], reason [IdP user not found: service-account-postman-client]"
   }
   ```
   
   Stack trace:
   ```
   org.apache.gravitino.exceptions.NotFoundException: IdP user not found: service-account-postman-client
       at org.apache.gravitino.idp.storage.service.IdpUserMetaService.lambda$updateIdpUserPassword$8(IdpUserMetaService.java:135)
       at org.apache.gravitino.storage.relational.utils.SessionUtils.doWithCommitAndFetchResult(SessionUtils.java:56)
       at org.apache.gravitino.idp.storage.service.IdpUserMetaService.updateIdpUserPassword(IdpUserMetaService.java:130)
       at org.apache.gravitino.idp.IdpUserGroupManager.changePassword(IdpUserGroupManager.java:176)
       at org.apache.gravitino.idp.web.rest.IdpUserOperations.lambda$changePassword$2(IdpUserOperations.java:100)
   ```
   
   ### How to reproduce
   
   1. Configure Gravitino with:
      ```properties
      gravitino.authorization.serviceAdmins = admin,service-account-postman-client
      ```
   2. Set environment variable:
      ```shell
      export GRAVITINO_INITIAL_ADMIN_PASSWORD='Passw0rd-Admin12'
      ```
   3. Enable the IDP REST extension:
      ```properties
      gravitino.server.rest.extensionPackages = org.apache.gravitino.idp.web.rest.feature
      ```
   4. Start Gravitino server.
   5. Verify `admin` exists:
      ```shell
      curl -u admin:Passw0rd-Admin12 http://localhost:30090/api/idp/users/admin
      # Returns 200
      ```
   6. Verify `service-account-postman-client` does NOT exist:
      ```shell
      curl -u admin:Passw0rd-Admin12 http://localhost:30090/api/idp/users/service-account-postman-client
      # Returns 404
      ```
   
   ### Additional context
   
   - The initialization logic should iterate over all entries in `gravitino.authorization.serviceAdmins` and create each one as an IDP user if it does not already exist.
   
   - Backend: PostgreSQL (deploy mode).


-- 
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 report] serviceAdmins not all initialized as IDP users when multiple admins configured [gravitino]

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

   After my testing, I found that there was no problem with the code. After communicating with Danhua, I closed this issue.


-- 
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 report] serviceAdmins not all initialized as IDP users when multiple admins configured [gravitino]

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

   @lasdf1234 Could you help check this issue?


-- 
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 report] serviceAdmins not all initialized as IDP users when multiple admins configured [gravitino]

Posted by "lasdf1234 (via GitHub)" <gi...@apache.org>.
lasdf1234 closed issue #11433: [Bug report] serviceAdmins not all initialized as IDP users when multiple admins configured
URL: https://github.com/apache/gravitino/issues/11433


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