danhuawang commented on issue #11709:
URL: https://github.com/apache/gravitino/issues/11709#issuecomment-4727509190

   ### Steps to reproduce
   
   This can be reproduced with the following sequence (extracted from 
`FlinkConnectorViewIcebergRestOAuth2IT`):
   
   1. **Create a metalake and an Iceberg catalog with `catalog-backend=rest`:**
   
   ```java
   metalake = adminClient.createMetalake(metalakeName, "test", 
Collections.emptyMap());
   
   Map<String, String> icebergProps = Maps.newHashMap();
   icebergProps.put("catalog-backend", "rest");
   icebergProps.put("uri", "<IRC endpoint>");
   icebergProps.put("s3-access-key-id", "...");
   icebergProps.put("s3-secret-access-key", "...");
   icebergProps.put("credential-providers", "s3-secret-key");
   icebergProps.put("data-access", "vended-credentials");
   
   Catalog catalog = metalake.createCatalog(
       "iceberg_rest_catalog", Catalog.Type.RELATIONAL,
       "lakehouse-iceberg", "test", icebergProps);
   ```
   
   2. **Create a schema and a table through the catalog (operations are proxied 
to the remote Iceberg REST service):**
   
   ```java
   catalog.asSchemas().createSchema("test_db", "comment", 
Collections.emptyMap());
   // Then via Flink SQL or the Gravitino API:
   // CREATE TABLE test_db.my_table (id INT)
   ```
   
   3. **Attempt to list tags (or policies) on the table:**
   
   ```java
   MetadataObject tableObj = MetadataObjects.of(
       Arrays.asList("iceberg_rest_catalog", "test_db", "my_table"),
       MetadataObject.Type.TABLE);
   metalake.listTags(tableObj);  // → throws NoSuchMetadataObjectException
   ```
   
   4. **Observe the error:**
   
   ```
   NoSuchMetadataObjectException: Failed to list tags for metadata object
     MetadataObject: [fullName=iceberg_rest_catalog.test_db.my_table], 
[type=TABLE] due to not found
   
   Caused by: NoSuchEntityException: No such schema entity: test_db
       at SchemaMetaService.getSchemaIdByMetalakeNameAndCatalogNameAndSchemaName
   ```
   
   The same sequence works fine if `catalog-backend=jdbc` is used instead, 
because in that case Gravitino directly manages the metadata and persists 
schema/table entity records in its own store.
   
   ### Environment
   
   - Gravitino: main branch (post PR #11636)
   - Iceberg REST backend with OAuth2 authentication
   - Reproducible via: `FlinkConnectorViewIcebergRestOAuth2IT` in 
`qa/gravitino-service-e2e-test`
   


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