title: Querying hive tables from Presto db returns error -javax.security.auth.login.LoginException: java.lang.NullPointerException: invalid null input: name
body: <p>I have built docker images as mentioned here - <a href="https://prestodb.io/docs/current/installation/deployment.html" rel="nofollow noreferrer">https://prestodb.io/docs/current/installation/deployment.html</a></p>
  <p>I can run this docker image as a container and query hive tables.</p>
  <p><strong>Content of Dockerfile</strong></p>
  <pre><code>FROM openjdk:8-jre
  
  # Presto version will be passed in at build time
  ARG PRESTO_VERSION
  
  # Set the URL to download
  ARG PRESTO_BIN=https://repo1.maven.org/maven2/com/facebook/presto/presto-server/${PRESTO_VERSION}/presto-server-${PRESTO_VERSION}.tar.gz
  
  # Update the base image OS and install wget and python
  RUN apt-get update
  RUN apt-get install -y wget python less
  
  # Download Presto and unpack it to /opt/presto
  RUN wget --quiet ${PRESTO_BIN}
  RUN mkdir -p /opt
  RUN tar -xf presto-server-${PRESTO_VERSION}.tar.gz -C /opt
  RUN rm presto-server-${PRESTO_VERSION}.tar.gz
  RUN ln -s /opt/presto-server-${PRESTO_VERSION} /opt/presto
  
  # Copy configuration files on the host into the image
  COPY etc /opt/presto/etc
  
  # Download the Presto CLI and put it in the image
  RUN wget --quiet https://repo1.maven.org/maven2/com/facebook/presto/presto-cli/${PRESTO_VERSION}/presto-cli-${PRESTO_VERSION}-executable.jar
  RUN mv presto-cli-${PRESTO_VERSION}-executable.jar /usr/local/bin/presto
  RUN chmod +x /usr/local/bin/presto
  
  # Specify the entrypoint to start
  ENTRYPOINT /opt/presto/bin/launcher run
  </code></pre>
  <p><strong>Content of etc/ directory</strong></p>
  <p>config.properties</p>
  <pre><code>coordinator=true
  node-scheduler.include-coordinator=true
  http-server.http.port=8080
  query.max-memory=5GB
  query.max-memory-per-node=1GB
  query.max-total-memory-per-node=2GB
  discovery-server.enabled=true
  discovery.uri=http://localhost:8080
  </code></pre>
  <p>jvm.config</p>
  <pre><code>-server
  -Xmx16G
  -XX:+UseG1GC
  -XX:G1HeapRegionSize=32M
  -XX:+UseGCOverheadLimit
  -XX:+ExplicitGCInvokesConcurrent
  -XX:+HeapDumpOnOutOfMemoryError
  -XX:+ExitOnOutOfMemoryError
  -DHADOOP_USER_NAME=hive
  -Djdk.attach.allowAttachSelf=true
  </code></pre>
  <p>log.properties</p>
  <pre><code>com.facebook.presto=INFO
  </code></pre>
  <p>node.properties</p>
  <pre><code>node.environment=production
  node.id=ffffffff-ffff-ffff-ffff-ffffffffffff
  node.data-dir=/var/presto/data
  </code></pre>
  <p>catalog/hive.properties</p>
  <pre><code>connector.name=hive-hadoop2
  hive.metastore.uri=thrift://hadoop-host:9083
  </code></pre>
  <p>I have deployed this on k8s and I am able to see hive tables. But when I try to query hive tables, getting below error:</p>
  <pre><code>./presto-cli-0.271-executable.jar --server 127.0.0.1:31113 --catalog hive
  presto:default&gt; select * from my_table limit 5;
  Query 20220601_143427_00004_y8ige failed: failure to login: javax.security.auth.login.LoginException: java.lang.NullPointerException: invalid null input: name
      at jdk.security.auth/com.sun.security.auth.UnixPrincipal.&lt;init&gt;(UnixPrincipal.java:67)
      at jdk.security.auth/com.sun.security.auth.module.UnixLoginModule.login(UnixLoginModule.java:129)
      at java.base/javax.security.auth.login.LoginContext.invoke(LoginContext.java:726)
      at java.base/javax.security.auth.login.LoginContext$4.run(LoginContext.java:665)
      at java.base/javax.security.auth.login.LoginContext$4.run(LoginContext.java:663)
      at java.base/java.security.AccessController.doPrivileged(Native Method)
      at java.base/javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:663)
      at java.base/javax.security.auth.login.LoginContext.login(LoginContext.java:574)
      at org.apache.hadoop.security.UserGroupInformation$HadoopLoginContext.login(UserGroupInformation.java:1926)
      at org.apache.hadoop.security.UserGroupInformation.doSubjectLogin(UserGroupInformation.java:1837)
      at org.apache.hadoop.security.UserGroupInformation.createLoginUser(UserGroupInformation.java:710)
      at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:660)
      at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:571)
      at org.apache.hadoop.fs.PrestoFileSystemCache.getInternal(PrestoFileSystemCache.java:82)
      at org.apache.hadoop.fs.PrestoFileSystemCache.get(PrestoFileSystemCache.java:65)
      at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:479)
      at org.apache.hadoop.fs.Path.getFileSystem(Path.java:361)
      at io.prestosql.plugin.hive.HdfsEnvironment.lambda$getFileSystem$0(HdfsEnvironment.java:77)
      at io.prestosql.plugin.hive.authentication.NoHdfsAuthentication.doAs(NoHdfsAuthentication.java:23)
      at io.prestosql.plugin.hive.HdfsEnvironment.getFileSystem(HdfsEnvironment.java:76)
      at io.prestosql.plugin.hive.HdfsEnvironment.getFileSystem(HdfsEnvironment.java:70)
      at io.prestosql.plugin.hive.BackgroundHiveSplitLoader.loadPartition(BackgroundHiveSplitLoader.java:371)
      at io.prestosql.plugin.hive.BackgroundHiveSplitLoader.loadSplits(BackgroundHiveSplitLoader.java:337)
      at io.prestosql.plugin.hive.BackgroundHiveSplitLoader$HiveSplitLoaderTask.process(BackgroundHiveSplitLoader.java:266)
      at io.prestosql.plugin.hive.util.ResumableTasks$1.run(ResumableTasks.java:38)
      at io.prestosql.$gen.Presto_350_e_2____20220601_143333_2.run(Unknown Source)
      at io.airlift.concurrent.BoundedExecutor.drainQueue(BoundedExecutor.java:80)
      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      at java.base/java.lang.Thread.run(Thread.java:834)
  </code></pre>
  <p>Hadoop cluster is not kerberos enabled.</p>