[SPARK-52613][CORE][SQL] Restore printing full stacktrace when HBase/Hive DelegationTokenProvider hit exception#51320
[SPARK-52613][CORE][SQL] Restore printing full stacktrace when HBase/Hive DelegationTokenProvider hit exception#51320pan3793 wants to merge 1 commit into
Conversation
…Hive DelegationTokenProvider hit exception
|
cc @vinodkc (who authored SPARK-35747) @dongjoon-hyun @yaooqinn |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
To @pan3793 , given the posted example, this PR may leak a user information more as a new security vulnerability.
Caused by: org.apache.hadoop.hbase.ipc.RemoteWithExtrasException: org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions (user=bdms_admin.mammut/dev@BDMS.COM, scope=hbase:meta, params=[table=hbase:meta,],action=EXEC)
|
@dongjoon-hyun thank you for raising concerns. I would argue that the username/principal is relatively insensitive information in such a context, username/principal is also displayed in the Spark UI / Environment page without redaction, and users would see a similar error message when they access Hive databases/tables or HDFS files without permission. |
|
Got it. It sounds reasonable to me. |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM (from my side). Thank you always, @pan3793 .
…Hive DelegationTokenProvider hit exception ### What changes were proposed in this pull request? After SPARK-35747(3.2.0), Spark stops printing full stacktrace when HBase/Hive/Kafka DelegationTokenProvider hit exceptions. SPARK-35747 actually makes two changes: 1. Remove full stacktrace from logs 2. Guide disabling unused DelegationTokenProvider - `If $serviceName is not used, set spark.security.credentials.$serviceName.enabled to false` I think 2 is useful, but 1 is incorrect, this PR logically reverts 1 (changes in KafkaDelegationTokenProvider have been reverted in SPARK-47593(4.0.0)) We recently hit an issue related to HBaseDelegationTokenProvider, the printed error message is ``` [WARN] [main] HBaseDelegationTokenProvider#94 - Failed to get token from service hbase due to java.lang.reflect.InvocationTargetException. If hbase is not used, set spark.security.credentials.hbase.enabled to false. Retrying to fetch HBase security token with hbase connection parameter. ``` it makes us think it's related to a classpath issue, but eventually, after we changed the code to print the full stacktrace, we found the root cause is ``` org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions (user=***/******.COM, scope=hbase:meta, params=[table=hbase:meta,],action=EXEC) ``` Full stacktrace: https://gist.github.com/pan3793/46a3f6b956a7982646e1ee75603a1865 ### Why are the changes needed? Improve the diagnosis experience. ### Does this PR introduce _any_ user-facing change? Yes, the user would see rich error messages when HBase/Hive DelegationTokenProvider hit exceptions. ### How was this patch tested? Manual test. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51320 from pan3793/SPARK-52613. Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: Kent Yao <yao@apache.org> (cherry picked from commit e8384d5) Signed-off-by: Kent Yao <yao@apache.org>
|
Merged to master and 4.0, thank you @pan3793 @dongjoon-hyun |
…Hive DelegationTokenProvider hit exception ### What changes were proposed in this pull request? After SPARK-35747(3.2.0), Spark stops printing full stacktrace when HBase/Hive/Kafka DelegationTokenProvider hit exceptions. SPARK-35747 actually makes two changes: 1. Remove full stacktrace from logs 2. Guide disabling unused DelegationTokenProvider - `If $serviceName is not used, set spark.security.credentials.$serviceName.enabled to false` I think 2 is useful, but 1 is incorrect, this PR logically reverts 1 (changes in KafkaDelegationTokenProvider have been reverted in SPARK-47593(4.0.0)) We recently hit an issue related to HBaseDelegationTokenProvider, the printed error message is ``` [WARN] [main] HBaseDelegationTokenProvider#94 - Failed to get token from service hbase due to java.lang.reflect.InvocationTargetException. If hbase is not used, set spark.security.credentials.hbase.enabled to false. Retrying to fetch HBase security token with hbase connection parameter. ``` it makes us think it's related to a classpath issue, but eventually, after we changed the code to print the full stacktrace, we found the root cause is ``` org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions (user=***/******.COM, scope=hbase:meta, params=[table=hbase:meta,],action=EXEC) ``` Full stacktrace: https://gist.github.com/pan3793/46a3f6b956a7982646e1ee75603a1865 ### Why are the changes needed? Improve the diagnosis experience. ### Does this PR introduce _any_ user-facing change? Yes, the user would see rich error messages when HBase/Hive DelegationTokenProvider hit exceptions. ### How was this patch tested? Manual test. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#51320 from pan3793/SPARK-52613. Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: Kent Yao <yao@apache.org> (cherry picked from commit eeab1d2) Signed-off-by: Kent Yao <yao@apache.org>
What changes were proposed in this pull request?
After SPARK-35747(3.2.0), Spark stops printing full stacktrace when HBase/Hive/Kafka DelegationTokenProvider hit exceptions.
SPARK-35747 actually makes two changes:
If $serviceName is not used, set spark.security.credentials.$serviceName.enabled to falseI think 2 is useful, but 1 is incorrect, this PR logically reverts 1 (changes in KafkaDelegationTokenProvider have been reverted in SPARK-47593(4.0.0))
We recently hit an issue related to HBaseDelegationTokenProvider, the printed error message is
it makes us think it's related to a classpath issue, but eventually, after we changed the code to print the full stacktrace, we found the root cause is
Full stacktrace: https://gist.github.com/pan3793/46a3f6b956a7982646e1ee75603a1865
Why are the changes needed?
Improve the diagnosis experience.
Does this PR introduce any user-facing change?
Yes, the user would see rich error messages when HBase/Hive DelegationTokenProvider hit exceptions.
How was this patch tested?
Manual test.
Was this patch authored or co-authored using generative AI tooling?
No.