Troubleshooting for Access Management for Apache Spark OLAC¶
Steps to Retrieve Logs for Troubleshooting¶
To enable debug for Apache Spark OLAC, before executing the build_spark_plugin.sh script, update the log4j2.properties file to enable debug logging.
-
Navigate to the
oss-plugin/configplugin directory:Bash -
Open the
log4j2.propertiesfile and update the following property: -
Once the pod is up, navigate to the
~/tmp/<user>folder.Bash -
Logs will be saved in file
privacera.log -
Command to get logs on machine:
Bash
Configuration Issues Causing Access Control Failures in Apache Spark Jobs and Spark Operator Deployments¶
This guide helps you troubleshoot configuration issues that prevent Privacera from enforcing access control in Apache Spark jobs and deployments using Spark Operator.
Overwriting Java Options in Spark Job Code¶
Problem
Setting spark.executor.extraJavaOptions or spark.driver.extraJavaOptions directly in your Spark job code (for example, in Python or Scala) overrides the default Privacera agent configuration. As a result, the Privacera agent may fail to load correctly.
Default Configuration
By default, the following properties are defined in /opt/spark/conf/spark-defaults.conf:
spark.executor.extraJavaOptions -javaagent:/opt/spark/jars/privacera-agent.jar -Dlog4j.configurationFile=file:///privacera-conf/log4j2.properties
spark.driver.extraJavaOptions -javaagent:/opt/spark/jars/privacera-agent.jar -Dlog4j.configurationFile=file:///privacera-conf/log4j2.properties
Incorrect Configuration Example
Instead of overwriting these properties, append your custom Java options to the existing Privacera configuration. This ensures that the Privacera agent settings are preserved. For example, in Python:
| Python | |
|---|---|
Impact
- The Privacera agent and required JARs are not loaded on the Spark driver or executors.
- The Spark job may still succeed; however, Privacera will not be able to enforce access control.
Solution
Instead of overwriting these properties, append your options to the existing Privacera configuration. For example, in Python:
- Prev topic: Advanced Configuration