<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [Hue] Cannot create Spark session when user is not &amp;quot;mapr&amp;quot; in HPE Ezmeral Software platform</title>
    <link>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146319#M171</link>
    <description>&lt;P&gt;When I log in Hue as "mapr" and open pySpark editor everything works fine. I am able to run a script.&lt;BR /&gt;If I use other user, when I open pySpark editor, a red error pop-up message appears:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[18/Aug/2021 01:57:29 -0700] decorators   ERROR    Error running create_session
Traceback (most recent call last):
  File "/opt/mapr/hue/hue-4.6.0/desktop/libs/notebook/src/notebook/decorators.py", line 111, in wrapper
    return f(*args, **kwargs)
  File "/opt/mapr/hue/hue-4.6.0/desktop/libs/notebook/src/notebook/api.py", line 104, in create_session
    response['session'] = get_api(request, session).create_session(lang=session['type'], properties=properties)
  File "/opt/mapr/hue/hue-4.6.0/desktop/libs/notebook/src/notebook/connectors/spark_shell.py", line 229, in create_session
    raise QueryError(_('The Spark session could not be created in the cluster: %s') % info)
QueryError: The Spark session could not be created in the cluster: 	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1683)
	at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:144)
	at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:184)
	at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
	at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:943)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:952)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

YARN Diagnostics: &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that Livy session is created and the log is as follow:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;21/08/18 04:55:56 ERROR SparkSubmit$$anon$2: User abcd(user id 5003)  has been denied access to create application_1628147108709_0127
org.apache.hadoop.security.AccessControlException: User abcd(user id 5003)  has been denied access to create application_1628147108709_0127
	at com.mapr.fs.MapRFileSystem.makeDir(MapRFileSystem.java:1469)
	at com.mapr.fs.MapRFileSystem.mkdirs(MapRFileSystem.java:1488)
	at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:1920)
	at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:641)
	at org.apache.spark.deploy.yarn.Client.prepareLocalResources(Client.scala:428)
	at org.apache.spark.deploy.yarn.Client.createContainerLaunchContext(Client.scala:865)
	at org.apache.spark.deploy.yarn.Client.submitApplication(Client.scala:179)
	at org.apache.spark.deploy.yarn.Client.run(Client.scala:1135)
	at org.apache.spark.deploy.yarn.YarnClusterApplication.start(Client.scala:1530)
	at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:855)
	at org.apache.spark.deploy.SparkSubmit$$anon$1.run(SparkSubmit.scala:146)
	at org.apache.spark.deploy.SparkSubmit$$anon$1.run(SparkSubmit.scala:144)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1683)
	at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:144)
	at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:184)
	at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
	at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:943)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:952)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user has permission to create file/directory in /apps/spark/ (MapR FS), so " &lt;EM&gt;User abcd(user id 5003) has been denied access to create application_1628147108709_0127&lt;/EM&gt;" probably means something else.&lt;/P&gt;&lt;P&gt;Are there any additional user permissions for starting Spark jobs?&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 09:28:21 GMT</pubDate>
    <dc:creator>MaksREDS</dc:creator>
    <dc:date>2021-08-19T09:28:21Z</dc:date>
    <item>
      <title>[Hue] Cannot create Spark session when user is not "mapr"</title>
      <link>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146319#M171</link>
      <description>&lt;P&gt;When I log in Hue as "mapr" and open pySpark editor everything works fine. I am able to run a script.&lt;BR /&gt;If I use other user, when I open pySpark editor, a red error pop-up message appears:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;[18/Aug/2021 01:57:29 -0700] decorators   ERROR    Error running create_session
Traceback (most recent call last):
  File "/opt/mapr/hue/hue-4.6.0/desktop/libs/notebook/src/notebook/decorators.py", line 111, in wrapper
    return f(*args, **kwargs)
  File "/opt/mapr/hue/hue-4.6.0/desktop/libs/notebook/src/notebook/api.py", line 104, in create_session
    response['session'] = get_api(request, session).create_session(lang=session['type'], properties=properties)
  File "/opt/mapr/hue/hue-4.6.0/desktop/libs/notebook/src/notebook/connectors/spark_shell.py", line 229, in create_session
    raise QueryError(_('The Spark session could not be created in the cluster: %s') % info)
QueryError: The Spark session could not be created in the cluster: 	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1683)
	at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:144)
	at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:184)
	at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
	at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:943)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:952)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

YARN Diagnostics: &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found that Livy session is created and the log is as follow:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;21/08/18 04:55:56 ERROR SparkSubmit$$anon$2: User abcd(user id 5003)  has been denied access to create application_1628147108709_0127
org.apache.hadoop.security.AccessControlException: User abcd(user id 5003)  has been denied access to create application_1628147108709_0127
	at com.mapr.fs.MapRFileSystem.makeDir(MapRFileSystem.java:1469)
	at com.mapr.fs.MapRFileSystem.mkdirs(MapRFileSystem.java:1488)
	at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:1920)
	at org.apache.hadoop.fs.FileSystem.mkdirs(FileSystem.java:641)
	at org.apache.spark.deploy.yarn.Client.prepareLocalResources(Client.scala:428)
	at org.apache.spark.deploy.yarn.Client.createContainerLaunchContext(Client.scala:865)
	at org.apache.spark.deploy.yarn.Client.submitApplication(Client.scala:179)
	at org.apache.spark.deploy.yarn.Client.run(Client.scala:1135)
	at org.apache.spark.deploy.yarn.YarnClusterApplication.start(Client.scala:1530)
	at org.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:855)
	at org.apache.spark.deploy.SparkSubmit$$anon$1.run(SparkSubmit.scala:146)
	at org.apache.spark.deploy.SparkSubmit$$anon$1.run(SparkSubmit.scala:144)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1683)
	at org.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:144)
	at org.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:184)
	at org.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:86)
	at org.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:943)
	at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:952)
	at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The user has permission to create file/directory in /apps/spark/ (MapR FS), so " &lt;EM&gt;User abcd(user id 5003) has been denied access to create application_1628147108709_0127&lt;/EM&gt;" probably means something else.&lt;/P&gt;&lt;P&gt;Are there any additional user permissions for starting Spark jobs?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 09:28:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146319#M171</guid>
      <dc:creator>MaksREDS</dc:creator>
      <dc:date>2021-08-19T09:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: [Hue] Cannot create Spark session when user is not "mapr"</title>
      <link>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146398#M172</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Thanks for your post. Can you confirm on below please?&lt;/P&gt;&lt;P&gt;1) Is this unsecure or secure cluster?&lt;/P&gt;&lt;P&gt;2) Are you trying this with impersonation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 02:16:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146398#M172</guid>
      <dc:creator>Harshkohli</dc:creator>
      <dc:date>2021-08-19T02:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: [Hue] Cannot create Spark session when user is not "mapr"</title>
      <link>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146432#M174</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for asking.&lt;/P&gt;&lt;P&gt;1) The cluster is secure.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; No, I do not. As far as I know it is not possible to impersonate the mapr user (the only user that is permitted to create Spark session in my case).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 07:19:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146432#M174</guid>
      <dc:creator>MaksREDS</dc:creator>
      <dc:date>2021-08-19T07:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: [Hue] Cannot create Spark session when user is not "mapr"</title>
      <link>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146518#M175</link>
      <description>&lt;P&gt;Thanks for the information. I was successfuly able to reproduce your issue and the fix is below.&lt;/P&gt;&lt;P&gt;Create a directory lilke below /mapr/&amp;lt;cluster_name&amp;gt;/user/&amp;lt;customer user&amp;gt;/.sparkStaging&amp;nbsp; on MaprFS and provide 775 permissions as mentioned below.&lt;/P&gt;&lt;P&gt;hadoop dfs -chmod 775 /user/&amp;lt;customer user&amp;gt;/.sparkStaging&lt;/P&gt;&lt;P&gt;After the same try submitting a test job using spark submit on node and then via Hue, it should work hopefully.&lt;/P&gt;&lt;P&gt;/opt/mapr/spark/spark-2.4.4/bin/run-example --master yarn --deploy-mode cluster SparkPi 10&lt;/P&gt;&lt;P&gt;Kindly let me know if it works for you or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2021 01:33:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146518#M175</guid>
      <dc:creator>Harshkohli</dc:creator>
      <dc:date>2021-08-21T01:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: [Hue] Cannot create Spark session when user is not "mapr"</title>
      <link>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146774#M177</link>
      <description>&lt;P&gt;It works, thank you.&lt;BR /&gt;&lt;SPAN&gt;The directory /mapr/&amp;lt;cluster_name&amp;gt;/user/&amp;lt;customer user&amp;gt;/.sparkStaging must exist before creating a SparkSession. For some Spark Jobs it is also necessary to create /mapr/&amp;lt;cluster_name&amp;gt;/user/&amp;lt;customer user&amp;gt;/.&lt;/SPAN&gt;&lt;SPAN class="s1"&gt;tmp/hive directory.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Aug 2021 09:00:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/hpe-ezmeral-software-platform/hue-cannot-create-spark-session-when-user-is-not-quot-mapr-quot/m-p/7146774#M177</guid>
      <dc:creator>MaksREDS</dc:creator>
      <dc:date>2021-08-23T09:00:27Z</dc:date>
    </item>
  </channel>
</rss>

