shunki-fujita commented on PR #10681:
URL: https://github.com/apache/gravitino/pull/10681#issuecomment-4277869555

   @danhuawang @laserninja 
   The Bitnami approach works for MySQL because it doesn't require `getpwuid()` 
at runtime. Unfortunately, Gravitino has a Hadoop dependency that does.
   
   Since v1.2.0 (PR #9766), 
https://github.com/apache/gravitino/blob/d2268ac15d8e90cbdf929ccf2dde83e988751f64/iceberg/iceberg-common/src/main/java/org/apache/gravitino/iceberg/common/ops/IcebergCatalogWrapper.java#L105
 calls
     
https://github.com/apache/gravitino/blob/d2268ac15d8e90cbdf929ccf2dde83e988751f64/catalogs/hadoop-common/src/main/java/org/apache/gravitino/catalog/hadoop/fs/FileSystemUtils.java#L219,
 which triggers Configuration.addResource() →  
UserGroupInformation.getCurrentUser() → UnixLoginModule.login(). This calls 
getpwuid() to resolve the UID, and without a /etc/passwd entry it throws 
NullPointerException.
   
   This doesn't happen on the first request (Hadoop's UGI is uninitialized at 
startup), but after the catalog cache TTL (default 1h) expires and the wrapper 
is re-created, it crashes with HTTP 500.
   
   I confirmed this with the iceberg-rest-server image built from this PR's 
Dockerfile (cache TTL = 10s):
   
                               Initial    After eviction
       This PR (no useradd):   200        500
       This PR + useradd:      200        200
       v1.2.0 as root:         200        200
   
   ```
   RuntimeException: Failed to create configuration
       at FileSystemUtils.createConfiguration(FileSystemUtils.java:223)
       at IcebergCatalogWrapper.<init>(IcebergCatalogWrapper.java:105)
   Caused by: LoginException: NullPointerException: invalid null input: name
       at UnixLoginModule.login
   ```
   
   I think `useradd` needs to be added back to the Dockerfiles.
   


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