error: 'local path ______ cannot be added to user session' in Apache Livy

807 views Asked by At

I am trying to submit Python file to REST API but it is always giving the error. I am using the local mode and the command which I am running is given below:

$curl -X POST --data '{"file":"/Users/neha/Desktop/spark_project/examples/spark_livy_ex3.py"}' -H "Content-Type: application/json" localhost:8998/batches

"requirement failed: Local path /Users/neha/Desktop/spark_project/examples/spark_livy_ex3.py cannot be added to user sessions."

From this link https://groups.google.com/a/cloudera.org/forum/#!topic/livy-user/mm-XEhANDHU I found that I have to modify the livy.conf by modifying the livy.conf by adding /Users/neha/Desktop/spark_project/examples/ directory to livy.file.local-dir-whitelist. Again I run the code with above curl command but now also I am getting the same error.

Note that 'spark_livy_ex3.py' is my python file which I want to run.

How I can resolve this problem?

0

There are 0 answers