[jira] [Comment Edited] (HIVE-24083) hcatalog error in Hadoop 3.3.0: authentication type needed

2022-08-23 Thread Zhiguo Wu (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-24083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17583397#comment-17583397
 ] 

Zhiguo Wu edited comment on HIVE-24083 at 8/23/22 6:42 AM:
---

[~zabetak] 

 

With patch: [https://github.com/apache/hive/pull/3543]

Now this can be reproduced in master branch

Should I create another PR for master branch?
{code:java}
ERROR | 23 Aug 2022 06:34:27,027 | org.apache.hive.hcatalog.templeton.Main | 
Server failed to start: 
javax.servlet.ServletException: Authentication type must be specified: 
simple|kerberos|https://github.com/apache/hive/pull/3543]

Now this can be reproduced in master branch
{code:java}
ERROR | 23 Aug 2022 06:34:27,027 | org.apache.hive.hcatalog.templeton.Main | 
Server failed to start: 
javax.servlet.ServletException: Authentication type must be specified: 
simple|kerberos|
        at 
org.apache.hadoop.security.authentication.server.AuthenticationFilter.init(AuthenticationFilter.java:164)
 ~[hadoop-auth-3.3.4.jar:?]
        at 
org.apache.hadoop.security.authentication.server.ProxyUserAuthenticationFilter.init(ProxyUserAuthenticationFilter.java:57)
 ~[hadoop-common-3.3.4.jar:?]
        at 
org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:140) 
~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$0(ServletHandler.java:731)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) 
~[?:1.8.0_342]
        at 
java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:742) 
~[?:1.8.0_342]
        at 
java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647) 
~[?:1.8.0_342]
        at 
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:755) 
~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:379)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:911)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:288)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:169)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.eclipse.jetty.server.Server.start(Server.java:423) 
~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:110)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:97)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.eclipse.jetty.server.Server.doStart(Server.java:387) 
~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73)
 ~[jetty-runner-9.4.40.v20210413.jar:9.4.40.v20210413]
        at org.apache.hive.hcatalog.templeton.Main.runServer(Main.java:255) 
~[hive-webhcat-4.0.0-alpha-2-SNAPSHOT.jar:4.0.0-alpha-2-SNAPSHOT]
        at org.apache.hive.hcatalog.templeton.Main.run(Main.java:147) 
[hive-webhcat-4.0.0-alpha-2-SNAPSHOT.jar:4.0.0-alpha-2-SNAPSHOT]
        at org.apache.hive.hcatalog.templeton.Main.main(Main.java:394) 
[hive-webhcat-4.0.0-alpha-2-SNAPSHOT.jar:4.0.0-alpha-2-SNAPSHOT]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_342]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_342]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_342]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_342]
        at org.apache.hadoop.util.RunJar.run(RunJar.java:323) 
[hadoop-common-3.3.4.jar:?]
        at 

[jira] [Comment Edited] (HIVE-24083) hcatalog error in Hadoop 3.3.0: authentication type needed

2022-07-08 Thread Anmol Sundaram (Jira)


[ 
https://issues.apache.org/jira/browse/HIVE-24083?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17564223#comment-17564223
 ] 

Anmol Sundaram edited comment on HIVE-24083 at 7/8/22 10:35 AM:


I was able to get it run by the following (temporary?) fix : 

 
{code:java}
diff --git 
a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
 
b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
index d183b2e61b..5e5c4132f4 100644
— 
a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
+++ 
b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
@@ -38,6 +38,8 @@
import org.apache.hadoop.hive.shims.Utils;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authentication.client.PseudoAuthenticator;
+import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
+import 
org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler;
import 
org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler;
import org.apache.hadoop.security.SecurityUtil;
import org.apache.hadoop.util.GenericOptionsParser;
@@ -269,6 +271,11 @@ public FilterHolder makeAuthFilter() throws IOException {
authFilter.setInitParameter("dfs.web.authentication.kerberos.keytab",
conf.kerberosKeytab());
}
+
+ authFilter.setInitParameter(AuthenticationFilter.AUTH_TYPE, 
UserGroupInformation.isSecurityEnabled() ?
+ KerberosAuthenticationHandler.TYPE :
+ PseudoAuthenticationHandler.TYPE);
+
return authFilter;
}{code}


was (Author: JIRAUSER288438):
I was able to get it run by the following (temporary?) fix : 
diff --git 
a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
 
b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
index d183b2e61b..5e5c4132f4 100644
--- 
a/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
+++ 
b/hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java
@@ -38,6 +38,8 @@
 import org.apache.hadoop.hive.shims.Utils;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.authentication.client.PseudoAuthenticator;
+import org.apache.hadoop.security.authentication.server.AuthenticationFilter;
+import 
org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler;
 import 
org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler;
 import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.util.GenericOptionsParser;
@@ -269,6 +271,11 @@ public FilterHolder makeAuthFilter() throws IOException \{
   authFilter.setInitParameter("dfs.web.authentication.kerberos.keytab",
 conf.kerberosKeytab());
 }
+
+authFilter.setInitParameter(AuthenticationFilter.AUTH_TYPE, 
UserGroupInformation.isSecurityEnabled() ?
+KerberosAuthenticationHandler.TYPE :
+PseudoAuthenticationHandler.TYPE);
+
 return authFilter;
   }

> hcatalog error in Hadoop 3.3.0: authentication type needed
> --
>
> Key: HIVE-24083
> URL: https://issues.apache.org/jira/browse/HIVE-24083
> Project: Hive
>  Issue Type: Bug
>  Components: HCatalog
>Affects Versions: 3.1.2
>Reporter: Javier J. Salmeron Garcia
>Priority: Minor
>
> Using Hive 3.1.2, webhcat fails to start in Hadoop 3.3.0 with the following 
> error:
> ```
> javax.servlet.ServletException: Authentication type must be specified: 
> simple|kerberos
> ```
> I tried in Hadoop 3.2.1 with the exact settings and it starts without issues:
>  
> ```
> webhcat: /tmp/hadoop-3.2.1//bin/hadoop jar 
> /opt/bitnami/hadoop/hive/hcatalog/sbin/../share/webhcat/svr/lib/hive-webhcat-3.1.2.jar
>  org.apache.hive.hcatalog.templeton.Main
> webhcat: starting ... started.
> webhcat: done
> ```
>  
> I can provide more logs if needed. Detected authentication settings:
>  
> ```
> hadoop.http.authentication.simple.anonymous.allowed=true
> hadoop.http.authentication.type=simple
> hadoop.security.authentication=simple
> ipc.client.fallback-to-simple-auth-allowed=false
> yarn.timeline-service.http-authentication.simple.anonymous.allowed=true
> yarn.timeline-service.http-authentication.type=simple
> ```
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)