You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "dennishuo (via GitHub)" <gi...@apache.org> on 2024/10/31 01:44:28 UTC

[PR] Improve the error message in the exception thrown for credential-vending enablement [polaris]

dennishuo opened a new pull request, #414:
URL: https://github.com/apache/polaris/pull/414

   Instead of "is not supported", phrase it as "is not enabled", and provide the catalog config key the user can look up to decide whether to enable the feature for their catalog.
   
   # Description
   
   Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
   
   Fixes # (issue)
   
   ## Type of change
   
   Please delete options that are not relevant.
   
   - [ ] Documentation update
   
   # How Has This Been Tested?
   
   Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
   
   - [ ] Test A
   - [ ] Test B
   
   **Test Configuration**:
   * Hardware:
   * Toolchain:
   * SDK:
   
   # Checklist:
   
   Please delete options that are not relevant.
   
   - [ ] I have performed a self-review of my code
   - [ ] I have commented my code, particularly in hard-to-understand areas
   - [ ] I have made corresponding changes to the documentation
   - [ ] My changes generate no new warnings
   - [ ] If adding new functionality, I have discussed my implementation with the community using the linked GitHub 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: issues-unsubscribe@polaris.apache.org

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


Re: [PR] Improve the error message in the exception thrown for credential-vending enablement [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #414:
URL: https://github.com/apache/polaris/pull/414#discussion_r1824806723


##########
polaris-service/src/test/java/org/apache/polaris/service/catalog/PolarisRestCatalogIntegrationTest.java:
##########
@@ -713,7 +713,8 @@ public void testLoadTableWithAccessDelegationForExternalCatalogWithConfigDisable
         Assertions.assertThatThrownBy(
                 () -> restCatalog.loadTable(TableIdentifier.of(ns1, "my_table")))
             .isInstanceOf(ForbiddenException.class)
-            .hasMessageContaining("Access Delegation is not supported for this catalog");
+            .hasMessageContaining("Access Delegation is not enabled for this catalog")
+            .hasMessageContaining("'enable.credential.vending'");

Review Comment:
   It's probably better to reference `PolarisConfiguration.ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING.catalogConfig()` here



-- 
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: issues-unsubscribe@polaris.apache.org

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


Re: [PR] Improve the error message in the exception thrown for credential-vending enablement [polaris]

Posted by "dennishuo (via GitHub)" <gi...@apache.org>.
dennishuo commented on code in PR #414:
URL: https://github.com/apache/polaris/pull/414#discussion_r1825014378


##########
polaris-service/src/test/java/org/apache/polaris/service/catalog/PolarisRestCatalogIntegrationTest.java:
##########
@@ -713,7 +713,8 @@ public void testLoadTableWithAccessDelegationForExternalCatalogWithConfigDisable
         Assertions.assertThatThrownBy(
                 () -> restCatalog.loadTable(TableIdentifier.of(ns1, "my_table")))
             .isInstanceOf(ForbiddenException.class)
-            .hasMessageContaining("Access Delegation is not supported for this catalog");
+            .hasMessageContaining("Access Delegation is not enabled for this catalog")
+            .hasMessageContaining("'enable.credential.vending'");

Review Comment:
   Done



-- 
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: issues-unsubscribe@polaris.apache.org

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


Re: [PR] Improve the error message in the exception thrown for credential-vending enablement [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #414:
URL: https://github.com/apache/polaris/pull/414#discussion_r1825034287


##########
polaris-service/src/main/java/org/apache/polaris/service/catalog/PolarisCatalogHandlerWrapper.java:
##########
@@ -834,7 +834,10 @@ public LoadTableResponse loadTableWithAccessDelegation(
             callContext.getPolarisCallContext(),
             catalogEntity,
             PolarisConfiguration.ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING)) {
-      throw new ForbiddenException("Access Delegation is not supported for this catalog");
+      throw new ForbiddenException(
+          "Access Delegation is not enabled for this catalog. Please consult applicable "
+              + "documentation for the catalog config property '%s' to enable this feature",
+          PolarisConfiguration.ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING.catalogConfig());

Review Comment:
   I see, it makes sense to avoid prompting users to blindly set a config. 
   
   Ideally we can convey some nuance here, but I don't think the PolarisConfiguration descriptions are always adequate to do that. I'm concerned about pushing the error messages into there because some errors occur due to an interaction between configs or require other context.
   
   In the future, we should look more closely at error messages but the currently-proposed change seems beneficial for the time being.



-- 
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: issues-unsubscribe@polaris.apache.org

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


Re: [PR] Improve the error message in the exception thrown for credential-vending enablement [polaris]

Posted by "dennishuo (via GitHub)" <gi...@apache.org>.
dennishuo commented on code in PR #414:
URL: https://github.com/apache/polaris/pull/414#discussion_r1825022161


##########
polaris-service/src/main/java/org/apache/polaris/service/catalog/PolarisCatalogHandlerWrapper.java:
##########
@@ -834,7 +834,10 @@ public LoadTableResponse loadTableWithAccessDelegation(
             callContext.getPolarisCallContext(),
             catalogEntity,
             PolarisConfiguration.ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING)) {
-      throw new ForbiddenException("Access Delegation is not supported for this catalog");
+      throw new ForbiddenException(
+          "Access Delegation is not enabled for this catalog. Please consult applicable "
+              + "documentation for the catalog config property '%s' to enable this feature",
+          PolarisConfiguration.ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING.catalogConfig());

Review Comment:
   My thinking on the wording was to avoid establishing a precedent of users starting to blindly set configs recommended by error messages. Admittedly it adds a bit of friction since this now makes it sound like there might be a more complicated series of steps to enable the feature rather than simply setting the config=true, but longer-term we should indeed probably standardize a way to point at relevant docs from error messages while also maybe making it easy for users to assess whether they care enough about the pros/cons of different config choices.
   
   In any case, I totally agree we could have more clarity in the various config-related error messages, but I'm thinking we can do a bigger refactor to, for example, try to centralize error-message generation into `PolarisConfiuration.java` itself. But it'll take some refactoring of callsites.



-- 
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: issues-unsubscribe@polaris.apache.org

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


Re: [PR] Improve the error message in the exception thrown for credential-vending enablement [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard merged PR #414:
URL: https://github.com/apache/polaris/pull/414


-- 
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: issues-unsubscribe@polaris.apache.org

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


Re: [PR] Improve the error message in the exception thrown for credential-vending enablement [polaris]

Posted by "eric-maynard (via GitHub)" <gi...@apache.org>.
eric-maynard commented on code in PR #414:
URL: https://github.com/apache/polaris/pull/414#discussion_r1824808276


##########
polaris-service/src/main/java/org/apache/polaris/service/catalog/PolarisCatalogHandlerWrapper.java:
##########
@@ -834,7 +834,10 @@ public LoadTableResponse loadTableWithAccessDelegation(
             callContext.getPolarisCallContext(),
             catalogEntity,
             PolarisConfiguration.ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING)) {
-      throw new ForbiddenException("Access Delegation is not supported for this catalog");
+      throw new ForbiddenException(
+          "Access Delegation is not enabled for this catalog. Please consult applicable "
+              + "documentation for the catalog config property '%s' to enable this feature",
+          PolarisConfiguration.ALLOW_EXTERNAL_CATALOG_CREDENTIAL_VENDING.catalogConfig());

Review Comment:
   The message is a little unclear; you can set the catalog property but you can also set the featureConfig. I also don't know if we need to say "please consult applicable documentation ..." rather than just saying e.g. "to enable this, set X or Y"



-- 
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: issues-unsubscribe@polaris.apache.org

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