You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "dev-lpq (via GitHub)" <gi...@apache.org> on 2023/06/13 05:40:26 UTC

[GitHub] [kyuubi] dev-lpq opened a new pull request, #4952: Enhance AWS Glue database does not exist error message on opening engine session

dev-lpq opened a new pull request, #4952:
URL: https://github.com/apache/kyuubi/pull/4952

   <!--
   Thanks for sending a pull request!
   
   Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
     2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
   -->
   
   ### _Why are the changes needed?_
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you add a feature, you can talk about the use case of it.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   When the default databases of glue do not exist, initializing the engine session failed.
   `Caused by: software.amazon.awssdk.services.glue.model.AccessDeniedException: User: arn:aws:iam::xxxxx:user/vault-token-wap-udp-int-readwrite-1686560253-eVgl3oauuaB7v0V6wX9 is not authorized to perform: glue:GetDatabase on resource: arn:aws:glue:us-east-1:xxxxx:database/default because no identity-based policy allows the glue:GetDatabase action (Service: Glue, Status Code: 400, Request ID: 3f816608-0cb2-467b-9181-05c5bfcd29b3, Extended Request ID: null)`
   ![image](https://github.com/apache/kyuubi/assets/43336508/a0e9ccac-7fdb-4036-a4f3-2885d7bd0ac5)
   
   The default initialize sql "SHOW DATABASES" when Kyuubi spark accesses the glue catalog. Try to change the initialize sql "use glue.wap" has the same error. 
   ```
   kyuubi.engine.initialize.sql=use glue.wap
   kyuubi.engine.session.initialize.sql=use glue.wap
   ```
   The root cause is that hive defines a use:database, which will initialize access to the database default.
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on a diff in pull request #4952: Enhance AWS Glue database does not exist error message on opening engine session

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on code in PR #4952:
URL: https://github.com/apache/kyuubi/pull/4952#discussion_r1227558583


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSessionImpl.scala:
##########
@@ -76,6 +76,11 @@ class SparkSessionImpl(
         case e
             if database == "default" &&
               StringUtils.containsAny(e.getMessage, "not found", "SCHEMA_NOT_FOUND") =>
+        case e
+            if database == "default" && StringUtils.containsAny(
+              e.getMessage,
+              "is not authorized to perform: glue:GetDatabase",
+              "database/default") =>

Review Comment:
   Maybe just
   ```suggestion
                 StringUtils.containsAny(
                   e.getMessage,
                   "not found",
                   "SCHEMA_NOT_FOUND",
                   "no identity-based policy allows the glue:GetDatabase action") =>
   ```



-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 closed pull request #4952: Enhance AWS Glue default database does not exist error message on opening session

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 closed pull request #4952: Enhance AWS Glue default database does not exist error message on opening session 
URL: https://github.com/apache/kyuubi/pull/4952


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


[GitHub] [kyuubi] pan3793 commented on pull request #4952: Enhance AWS Glue default database does not exist error message on opening session

Posted by "pan3793 (via GitHub)" <gi...@apache.org>.
pan3793 commented on PR #4952:
URL: https://github.com/apache/kyuubi/pull/4952#issuecomment-1588607723

   Thanks, merged to master/1.7


-- 
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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org