-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-52613][CORE][SQL] Restore printing full stacktrace when HBase/Hive DelegationTokenProvider hit exception #51320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…Hive DelegationTokenProvider hit exception
cc @vinodkc (who authored SPARK-35747) @dongjoon-hyun @yaooqinn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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/[email protected], 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+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 <[email protected]> Signed-off-by: Kent Yao <[email protected]> (cherry picked from commit e8384d5) Signed-off-by: Kent Yao <[email protected]>
Merged to master and 4.0, thank you @pan3793 @dongjoon-hyun |
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 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
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.