Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jdk_security4 test failed with credential exception because server returned HTTP response code 401 #11268

Closed
LongyuZhang opened this issue Nov 24, 2020 · 2 comments · Fixed by #11664 or adoptium/aqa-tests#2175

Comments

@LongyuZhang
Copy link
Contributor

Failure link

Grinder Link: Internal_Grinder/12223
Similar to issue #2990

Test Category: extended.openjdk
JDK Version: 11 and 8
JDK Impl: openj9
OS: xlinux, mac, and maybe others
Jdk11 Failure Output (Internal_Grinder/12223):

15:45:46  >>>>> UDP request honored
15:45:46  >>> KrbKdcReq send: #bytes read=771
15:45:46  >>> KdcAccessibility: remove kdc.web.domain:17617
15:45:46  >>> EType: sun.security.krb5.internal.crypto.Aes256CtsHmacSha1EType
15:45:46  >>> KrbAsRep cons in KrbAsReq.getReply web
15:45:46  Negotiate support not initiated, will fallback to other scheme if allowed. Reason:
15:45:46  STDERR:
15:45:46  Creating GSSCredential
15:45:46  Creating GSSCredential
15:45:46  GSSException: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Attempt to obtain new INITIATE credentials failed! (null)))
15:45:46  	at java.security.jgss/sun.security.jgss.spnego.SpNegoContext.initSecContext(SpNegoContext.java:453)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:266)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:196)
15:45:46  	at java.security.jgss/sun.net.www.protocol.http.spnego.NegotiatorImpl.init(NegotiatorImpl.java:108)
15:45:46  	at java.security.jgss/sun.net.www.protocol.http.spnego.NegotiatorImpl.<init>(NegotiatorImpl.java:117)
15:45:46  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
15:45:46  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
15:45:46  	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15:45:46  	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
15:45:46  	at java.base/sun.net.www.protocol.http.Negotiator.getNegotiator(Negotiator.java:65)
15:45:46  	at java.base/sun.net.www.protocol.http.NegotiateAuthentication.firstToken(NegotiateAuthentication.java:207)
15:45:46  	at java.base/sun.net.www.protocol.http.NegotiateAuthentication.setHeaders(NegotiateAuthentication.java:182)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getServerAuthentication(HttpURLConnection.java:2579)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1766)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1520)
15:45:46  	at HttpNegotiateServer.test6829283(HttpNegotiateServer.java:277)
15:45:46  	at HttpNegotiateServer.main(HttpNegotiateServer.java:231)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
15:45:46  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:45:46  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
15:45:46  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
15:45:46  	at java.base/java.lang.Thread.run(Thread.java:836)
15:45:46  Caused by: GSSException: No valid credentials provided (Mechanism level: Attempt to obtain new INITIATE credentials failed! (null))
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:384)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:160)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:126)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:193)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:218)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:230)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:196)
15:45:46  	at java.security.jgss/sun.security.jgss.spnego.SpNegoContext.GSS_initSecContext(SpNegoContext.java:882)
15:45:46  	at java.security.jgss/sun.security.jgss.spnego.SpNegoContext.initSecContext(SpNegoContext.java:316)
15:45:46  	... 22 more
15:45:46  Caused by: javax.security.auth.login.LoginException: No password provided
15:45:46  	at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:897)
15:45:46  	at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:738)
15:45:46  	at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:592)
15:45:46  	at java.base/javax.security.auth.login.LoginContext.invoke(LoginContext.java:726)
15:45:46  	at java.base/javax.security.auth.login.LoginContext$4.run(LoginContext.java:665)
15:45:46  	at java.base/javax.security.auth.login.LoginContext$4.run(LoginContext.java:663)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:770)
15:45:46  	at java.base/javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:663)
15:45:46  	at java.base/javax.security.auth.login.LoginContext.login(LoginContext.java:574)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSUtil.login(GSSUtil.java:258)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5Util.getInitialTicket(Krb5Util.java:175)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential$1.run(Krb5InitCredential.java:376)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential$1.run(Krb5InitCredential.java:372)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:734)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:371)
15:45:46  	... 30 more
15:45:46  
15:45:46  
15:45:46  Expecting to succeed when executing with the the logged in subject.
15:45:46  GSSException: No valid credentials provided (Mechanism level: No valid credentials provided (Mechanism level: Attempt to obtain new INITIATE credentials failed! (null)))
15:45:46  	at java.security.jgss/sun.security.jgss.spnego.SpNegoContext.initSecContext(SpNegoContext.java:453)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:266)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:196)
15:45:46  	at java.security.jgss/sun.net.www.protocol.http.spnego.NegotiatorImpl.init(NegotiatorImpl.java:108)
15:45:46  	at java.security.jgss/sun.net.www.protocol.http.spnego.NegotiatorImpl.<init>(NegotiatorImpl.java:117)
15:45:46  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
15:45:46  	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
15:45:46  	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15:45:46  	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
15:45:46  	at java.base/sun.net.www.protocol.http.Negotiator.getNegotiator(Negotiator.java:65)
15:45:46  	at java.base/sun.net.www.protocol.http.NegotiateAuthentication.firstToken(NegotiateAuthentication.java:207)
15:45:46  	at java.base/sun.net.www.protocol.http.NegotiateAuthentication.setHeaders(NegotiateAuthentication.java:182)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getServerAuthentication(HttpURLConnection.java:2579)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1766)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1512)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1510)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:942)
15:45:46  	at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:984)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
15:45:46  	at HttpNegotiateServer.testConnect(HttpNegotiateServer.java:293)
15:45:46  	at HttpNegotiateServer$3.run(HttpNegotiateServer.java:381)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:770)
15:45:46  	at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
15:45:46  	at HttpNegotiateServer.test8077155(HttpNegotiateServer.java:390)
15:45:46  	at HttpNegotiateServer.main(HttpNegotiateServer.java:237)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
15:45:46  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:45:46  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
15:45:46  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
15:45:46  	at java.base/java.lang.Thread.run(Thread.java:836)
15:45:46  Caused by: GSSException: No valid credentials provided (Mechanism level: Attempt to obtain new INITIATE credentials failed! (null))
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:384)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential.getInstance(Krb5InitCredential.java:160)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5MechFactory.getCredentialElement(Krb5MechFactory.java:126)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5MechFactory.getMechanismContext(Krb5MechFactory.java:193)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSManagerImpl.getMechanismContext(GSSManagerImpl.java:218)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:230)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:196)
15:45:46  	at java.security.jgss/sun.security.jgss.spnego.SpNegoContext.GSS_initSecContext(SpNegoContext.java:882)
15:45:46  	at java.security.jgss/sun.security.jgss.spnego.SpNegoContext.initSecContext(SpNegoContext.java:316)
15:45:46  	... 30 more
15:45:46  Caused by: javax.security.auth.login.LoginException: No password provided
15:45:46  	at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.promptForPass(Krb5LoginModule.java:897)
15:45:46  	at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.attemptAuthentication(Krb5LoginModule.java:738)
15:45:46  	at jdk.security.auth/com.sun.security.auth.module.Krb5LoginModule.login(Krb5LoginModule.java:592)
15:45:46  	at java.base/javax.security.auth.login.LoginContext.invoke(LoginContext.java:726)
15:45:46  	at java.base/javax.security.auth.login.LoginContext$4.run(LoginContext.java:665)
15:45:46  	at java.base/javax.security.auth.login.LoginContext$4.run(LoginContext.java:663)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:770)
15:45:46  	at java.base/javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:663)
15:45:46  	at java.base/javax.security.auth.login.LoginContext.login(LoginContext.java:574)
15:45:46  	at java.security.jgss/sun.security.jgss.GSSUtil.login(GSSUtil.java:258)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5Util.getInitialTicket(Krb5Util.java:175)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential$1.run(Krb5InitCredential.java:376)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential$1.run(Krb5InitCredential.java:372)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:734)
15:45:46  	at java.security.jgss/sun.security.jgss.krb5.Krb5InitCredential.getTgt(Krb5InitCredential.java:371)
15:45:46  	... 38 more
15:45:46  java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 401 for URL: http://host.web.domain:46496/a/b/c
15:45:46  	at HttpNegotiateServer.testConnect(HttpNegotiateServer.java:302)
15:45:46  	at HttpNegotiateServer$3.run(HttpNegotiateServer.java:381)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:770)
15:45:46  	at java.base/javax.security.auth.Subject.doAs(Subject.java:423)
15:45:46  	at HttpNegotiateServer.test8077155(HttpNegotiateServer.java:390)
15:45:46  	at HttpNegotiateServer.main(HttpNegotiateServer.java:237)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
15:45:46  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:45:46  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
15:45:46  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
15:45:46  	at java.base/java.lang.Thread.run(Thread.java:836)
15:45:46  Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://host.web.domain:46496/a/b/c
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1924)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1512)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1510)
15:45:46  	at java.base/java.security.AccessController.doPrivileged(AccessController.java:942)
15:45:46  	at java.base/java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:984)
15:45:46  	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
15:45:46  	at HttpNegotiateServer.testConnect(HttpNegotiateServer.java:293)
15:45:46  	... 11 more
15:45:46  java.lang.RuntimeException: Test error
15:45:46  	at HttpNegotiateServer.main(HttpNegotiateServer.java:244)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:45:46  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
15:45:46  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:45:46  	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
15:45:46  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
15:45:46  	at java.base/java.lang.Thread.run(Thread.java:836)
15:45:46  
15:45:46  JavaTest Message: Test threw exception: java.lang.RuntimeException: Test error
15:45:46  JavaTest Message: shutting down test

JDK8 Failure output (Internal_Grinder/12185):

12:00:21  >>>>> UDP request honored
12:00:21  STDERR:
12:00:21  Creating GSSCredential
12:00:21  Creating GSSCredential
12:00:21  
12:00:21  
12:00:21  Expecting to succeed when executing with the the logged in subject.
12:00:21  java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 401 for URL: http://host.web.domain:36223/a/b/c
12:00:21  	at HttpNegotiateServer.testConnect(HttpNegotiateServer.java:286)
12:00:21  	at HttpNegotiateServer$3.run(HttpNegotiateServer.java:361)
12:00:21  	at java.security.AccessController.doPrivileged(AccessController.java:770)
12:00:21  	at javax.security.auth.Subject.doAs(Subject.java:422)
12:00:21  	at HttpNegotiateServer.test8077155(HttpNegotiateServer.java:369)
12:00:21  	at HttpNegotiateServer.main(HttpNegotiateServer.java:220)
12:00:21  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:00:21  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:00:21  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:00:21  	at java.lang.reflect.Method.invoke(Method.java:498)
12:00:21  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
12:00:21  	at java.lang.Thread.run(Thread.java:822)
12:00:21  Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://host.web.domain:36223/a/b/c
12:00:21  	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
12:00:21  	at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:92)
12:00:21  	at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1490)
12:00:21  	at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1488)
12:00:21  	at java.security.AccessController.doPrivileged(AccessController.java:942)
12:00:21  	at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:984)
12:00:21  	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1487)
12:00:21  	at HttpNegotiateServer.testConnect(HttpNegotiateServer.java:277)
12:00:21  	... 11 more
12:00:21  java.lang.RuntimeException: Test error
12:00:21  	at HttpNegotiateServer.main(HttpNegotiateServer.java:227)
12:00:21  	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
12:00:21  	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
12:00:21  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12:00:21  	at java.lang.reflect.Method.invoke(Method.java:498)
12:00:21  	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
12:00:21  	at java.lang.Thread.run(Thread.java:822)
12:00:21  
12:00:21  JavaTest Message: Test threw exception: java.lang.RuntimeException: Test error
12:00:21  JavaTest Message: shutting down test
@JasonFengJ9
Copy link
Member

Will look into this a bit later.

Related #2990

@JasonFengJ9
Copy link
Member

Created adoptium/aqa-tests#2175 to enable jdk_security4 for OpenJ9 assuming #11664 is to be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants