TeamCity - Unable to login / rest api authentication error when switching to 64bit Java

Hello,

I have recently upgraded to version 9.1.1 and also switched to use 64bit Java instead of the default 32bit that comes with the windows installer of TeamCity.

But I started getting authentication errors once I have switched to use 64bit -

[2015-08-28 10:55:05,613]   INFO [168.80.17; http-nio-443-exec-7] - Failed user login attempt for POST '/loginSubmit.html?username=someuser&remember=true&_remember=&submitLogin=Log%20in&publicKey=00b7b00499fb5fa71bbc204f748625e916cb444276f05d897c1d27e4d5e11191e1aaadae2bd3872719c57aa43c0a69a30c0353899016962234d4e8542f206ed40ce158b99a1949e5de43cda9b3fc2a7361c35aa6503fa3e68ea9c3ad5ee3bd13acfe3da9a7206da1fdc9b3bd6c6ef05f3d51955609dff3dc606fcd87f3244aadd5&encryptedPassword=83c501fe481e799f653ce1aa9423ab337997b04a8569a219e3fd2d734fa55e7c372e83e7514904b861d021d2ff7d8295acf127ab9b0df778cf07e7726ddbec23158bf86587855f7603d8eb93e54b230d16681b4ce786393c5c56db8b26de9532c71084c3b3419a700a47423d1fc3535187abb06db6d6a78a6a04bbdb19116190', from client 192.168.80.17:59686, no associated user: jetbrains.buildServer.serverSide.auth.AuthenticationFailedException: java.lang.IllegalStateException: Shaj did not initialize correctly.
 at com.cenqua.shaj.Authenticator.getDefault(Authenticator.java:22)
 at com.cenqua.shaj.Shaj.checkPassword(Shaj.java:81)
 at jetbrains.buildServer.serverSide.impl.auth.shaj.ShajBasedAuthenticator.authenticate(ShajBasedAuthenticator.java:52)
 at jetbrains.buildServer.serverSide.impl.auth.NTDomainLoginModule.login(NTDomainLoginModule.java:75)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at javax.security.auth.login.LoginContext.invoke(Unknown Source)
 at javax.security.auth.login.LoginContext.access$000(Unknown Source)
 at javax.security.auth.login.LoginContext$4.run(Unknown Source)
 at javax.security.auth.login.LoginContext$4.run(Unknown Source)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
 at javax.security.auth.login.LoginContext.login(Unknown Source)
 at jetbrains.buildServer.serverSide.impl.auth.ServerLoginModelImpl$1.run(ServerLoginModelImpl.java:6)
 at jetbrains.buildServer.plugins.PluginSupportUtil.switchClassLoader(PluginSupportUtil.java:19)
 at jetbrains.buildServer.serverSide.impl.auth.ServerLoginModelImpl.doTryToLogin(ServerLoginModelImpl.java:146)
 at jetbrains.buildServer.serverSide.impl.auth.ServerLoginModelImpl.tryToLogin(ServerLoginModelImpl.java:36)
 at jetbrains.buildServer.serverSide.impl.auth.ServerLoginModelImpl.doCheckCredentials(ServerLoginModelImpl.java:46)
 at jetbrains.buildServer.serverSide.impl.auth.ServerLoginModelImpl.login(ServerLoginModelImpl.java:144)
 at jetbrains.buildServer.controllers.login.WebLoginModelImpl$1.compute(WebLoginModelImpl.java:1)
 at jetbrains.buildServer.controllers.login.WebLoginModelImpl$1.compute(WebLoginModelImpl.java:2)
 at jetbrains.buildServer.controllers.login.WebLoginModelImpl.doLogin(WebLoginModelImpl.java:101)
 at jetbrains.buildServer.controllers.login.WebLoginModelImpl.login(WebLoginModelImpl.java:16)
 at jetbrains.buildServer.controllers.login.WebLoginModelImpl.loginFromRequest(WebLoginModelImpl.java:83)
 at jetbrains.buildServer.controllers.login.LoginSubmitController.doPost(LoginSubmitController.java:18)
 at jetbrains.buildServer.controllers.BaseFormXmlController$1.handleRequest(BaseFormXmlController.java:53)
 at jetbrains.buildServer.controllers.AjaxRequestProcessor.processRequest(AjaxRequestProcessor.java:45)
 at jetbrains.buildServer.controllers.BaseFormXmlController.doHandle(BaseFormXmlController.java:51)
 at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:78)
 at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:154)
 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
 at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
 at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:34)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.web.DependencyParametersCalculationContextFilter.doFilter(DependencyParametersCalculationContextFilter.java:1)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:10)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.diagnostic.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:63)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:26)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Unknown Source)

This error would disappear when I swtich back to using 32bit.

Is there something I have missed that needs to be set on the server to enable 64 bit to work?

But apart from the login / authentication issues, I can see that TeamCity can communicate with agents, and builds are running fine as usual when using 64 bit java, just not able to authenticate if you are not already logged into the server etc.

Have attached auth log from teamcity server.



Attachment(s):
Shaj-errors.txt.zip
6 comments
Comment actions Permalink

Hello, does anyone have any suggestions? or should I be logging a support ticket?

Thanks,
Gavin

0
Comment actions Permalink

Hi Gavin,

Sorry for delay.
Do you have <TeamCity data directory>/config/ntlm-config.properties file on the server? If yes, then please try to remove the file and restart the TeamCity server to see if it helps.

0
Comment actions Permalink

Thanks Alina, will give it a try and let you know asap.

0
Comment actions Permalink

Hi Alina,

Sorry haven't got around to test the change until now.

I can confirm that it is working after removing the ntlm file as described.

Thanks for your help.

Cheers,
Gavin

0
Comment actions Permalink

I'm glad that the issue was resolved and thank you for the update!

0
Comment actions Permalink

Thanks this same worked for me as well.

0

Please sign in to leave a comment.