Can't login into Confluece after copy to new server
Asked by Samuel Tinapp:

Hey,

I'm doing the following things:

* SQL-dump from postgresql database from old server - copy to new server
* copy jira-home/conf-home from old server to new server
* replace in the sql-dump the old-domain with the new domain and the old ip with the new ip
* restore database with sql dump on new server
* start jira/confluence

Jira works fine. But on confluence I can't login. The url is on both server the same. You can acces jira with /jira and confluence with /confluence. The connection between jira and confluence on left top corner is working aswell.

> The following error(s) occurred:
>
> Sorry, an error occurred trying to log you in. Please try again.

Confluence used jira for login on the old server.

I thought confluence will just use the new url to check if a user can login. I hope someon can help me.

Kindly regards

-Sam

EDIT:

confluence-logs

```
Server startup logs are located in /var/atlassian/conf-app/logs/catalina.out
---------------------------------------------------------------------------
Using Java: /var/atlassian/conf-app/jre//bin/java
2018-02-19 20:01:39,320 INFO [main] [atlassian.confluence.bootstrap.SynchronyProxyWatchdog] A Context element for ${confluence.context.path}/synchrony-proxy is found in /var/atlassian/conf-app/conf/server.xml. No further action is required
---------------------------------------------------------------------------
19-Feb-2018 20:01:39.490 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server} Setting property 'debug' to '0' did not find a matching property.
19-Feb-2018 20:01:39.523 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'debug' to '0' did not find a matching property.
19-Feb-2018 20:01:39.529 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property.
19-Feb-2018 20:01:39.532 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'debug' to '0' did not find a matching property.
19-Feb-2018 20:01:39.552 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
19-Feb-2018 20:01:39.566 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
19-Feb-2018 20:01:39.727 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8090"]
19-Feb-2018 20:01:39.735 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
19-Feb-2018 20:01:39.737 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 288 ms
19-Feb-2018 20:01:39.741 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Tomcat-Standalone
19-Feb-2018 20:01:39.741 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.48
19-Feb-2018 20:01:40.712 INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log Spring WebApplicationInitializers detected on classpath: [com.atlassian.synchrony.proxy.SynchronyDispatcherServletInitializer@478f681c]
2018-02-19 20:01:40,816 INFO [localhost-startStop-1] [com.atlassian.confluence.lifecycle] contextInitialized Starting Confluence 6.7.0 [build 7601 based on commit hash 6017a6228c95ac4ab2c23e1488007fb69b3151df] - synchrony version 2.1.0-release-confluence_6.5-1a01ab2d
19-Feb-2018 20:01:40.912 INFO [localhost-startStop-2] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'dispatcher'
19-Feb-2018 20:01:40.912 INFO [localhost-startStop-2] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization started
19-Feb-2018 20:01:40.916 INFO [localhost-startStop-2] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Feb 19 20:01:40 UTC 2018]; root of context hierarchy
19-Feb-2018 20:01:40.959 INFO [localhost-startStop-2] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions Registering annotated classes: [class com.atlassian.synchrony.proxy.websocket.WebSocketConfig,class com.atlassian.synchrony.proxy.web.SynchronyWebMvcConfig]
19-Feb-2018 20:01:41.292 INFO [localhost-startStop-2] org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.initialize Initializing ExecutorService? 'defaultSockJsTaskScheduler'
19-Feb-2018 20:01:41.321 INFO [localhost-startStop-2] org.springframework.web.socket.server.support.WebSocketHandlerMapping.registerHandler Mapped URL path [/v1/bayeux-sync1] onto handler of type [class org.springframework.web.socket.server.support.WebSocketHttpRequestHandler]
19-Feb-2018 20:01:41.627 INFO [localhost-startStop-2] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{[/healthcheck]}" onto public com.atlassian.synchrony.proxy.web.HealthCheckResult com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.getSynchronyProxyInfo()
19-Feb-2018 20:01:41.644 INFO [localhost-startStop-2] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{[/reload],methods=[PUT]}" onto public org.springframework.http.ResponseEntity com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.reloadConfiguration(com.atlassian.synchrony.proxy.web.SynchronyProxyConfigPayload)
19-Feb-2018 20:01:41.668 INFO [localhost-startStop-2] org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandler Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler]
19-Feb-2018 20:01:41.694 INFO [localhost-startStop-2] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.initControllerAdviceCache Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Feb 19 20:01:40 UTC 2018]; root of context hierarchy
19-Feb-2018 20:01:41.778 INFO [localhost-startStop-2] org.springframework.context.support.DefaultLifecycleProcessor.start Starting beans in phase 2147483647
19-Feb-2018 20:01:41.800 INFO [localhost-startStop-2] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization completed in 888 ms
2018-02-19 20:01:42,712 INFO [localhost-startStop-1] [atlassian.confluence.cluster.DefaultClusterConfigurationHelper] lambda$populateExistingClusterSetupConfig$1 Populating setup configuration if running with Cluster mode...
19-Feb-2018 20:02:21.702 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying configuration descriptor /var/atlassian/conf-app/conf/Standalone/localhost/synchrony-proxy.xml
19-Feb-2018 20:02:21.707 WARNING [localhost-startStop-3] org.apache.catalina.startup.SetContextPropertiesRule.begin [SetContextPropertiesRule]{Context} Setting property 'debug' to '0' did not find a matching property.
19-Feb-2018 20:02:22.285 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log Spring WebApplicationInitializers detected on classpath: [com.atlassian.synchrony.proxy.SynchronyDispatcherServletInitializer@b9cc9d2]
19-Feb-2018 20:02:22.400 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'dispatcher'
19-Feb-2018 20:02:22.400 INFO [localhost-startStop-3] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization started
19-Feb-2018 20:02:22.403 INFO [localhost-startStop-3] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Feb 19 20:02:22 UTC 2018]; root of context hierarchy
19-Feb-2018 20:02:22.443 INFO [localhost-startStop-3] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions Registering annotated classes: [class com.atlassian.synchrony.proxy.websocket.WebSocketConfig,class com.atlassian.synchrony.proxy.web.SynchronyWebMvcConfig]
19-Feb-2018 20:02:22.701 INFO [localhost-startStop-3] org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.initialize Initializing ExecutorService? 'defaultSockJsTaskScheduler'
19-Feb-2018 20:02:22.721 INFO [localhost-startStop-3] org.springframework.web.socket.server.support.WebSocketHandlerMapping.registerHandler Mapped URL path [/v1/bayeux-sync1] onto handler of type [class org.springframework.web.socket.server.support.WebSocketHttpRequestHandler]
19-Feb-2018 20:02:22.962 INFO [localhost-startStop-3] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{[/healthcheck]}" onto public com.atlassian.synchrony.proxy.web.HealthCheckResult com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.getSynchronyProxyInfo()
19-Feb-2018 20:02:22.963 INFO [localhost-startStop-3] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{[/reload],methods=[PUT]}" onto public org.springframework.http.ResponseEntity com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.reloadConfiguration(com.atlassian.synchrony.proxy.web.SynchronyProxyConfigPayload)
19-Feb-2018 20:02:22.973 INFO [localhost-startStop-3] org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandler Mapped URL path [/**] onto handler of type [class org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler]
19-Feb-2018 20:02:22.989 INFO [localhost-startStop-3] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.initControllerAdviceCache Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date [Mon Feb 19 20:02:22 UTC 2018]; root of context hierarchy
19-Feb-2018 20:02:23.045 INFO [localhost-startStop-3] org.springframework.context.support.DefaultLifecycleProcessor.start Starting beans in phase 2147483647
19-Feb-2018 20:02:23.060 INFO [localhost-startStop-3] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization completed in 660 ms
19-Feb-2018 20:02:23.061 INFO [localhost-startStop-3] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of configuration descriptor /var/atlassian/conf-app/conf/Standalone/localhost/synchrony-proxy.xml has finished in 1,358 ms
19-Feb-2018 20:02:23.063 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8090"]
19-Feb-2018 20:02:23.070 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 43333 ms
19-Feb-2018 20:02:23.343 INFO [http-nio-8090-exec-1] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.8-atlassian-16 03/23/2015 10:20 PM'


After a login try
19-Feb-2018 20:06:10.800 INFO [http-nio-8090-exec-10] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.8-atlassian-16 03/23/2015 10:20 PM'
19-Feb-2018 20:06:10.804 INFO [http-nio-8090-exec-1] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.8-atlassian-16 03/23/2015 10:20 PM'
19-Feb-2018 20:06:10.814 INFO [http-nio-8090-exec-1] com.sun.jersey.api.wadl.config.WadlGeneratorLoader.loadWadlGenerator Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorApplicationDoc
19-Feb-2018 20:06:10.815 INFO [http-nio-8090-exec-1] com.sun.jersey.api.wadl.config.WadlGeneratorLoader.loadWadlGenerator Loading wadlGenerator com.sun.jersey.server.wadl.generators.WadlGeneratorGrammarsSupport
19-Feb-2018 20:06:10.816 INFO [http-nio-8090-exec-1] com.sun.jersey.api.wadl.config.WadlGeneratorLoader.loadWadlGenerator Loading wadlGenerator com.atlassian.plugins.rest.doclet.generators.resourcedoc.AtlassianWadlGeneratorResourceDocSupport
19-Feb-2018 20:06:11.356 INFO [http-nio-8090-exec-2] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.8-atlassian-16 03/23/2015 10:20 PM'



```

EDIT:

curl from confluence-container [https://domain.de/jira](https://domain.de/confluence)

curl -vvv <https://domain.de/jira>  
\* Trying 43.3.98.179...  
\* TCP_NODELAY set  
\* Connected to domain.de (43.3.98.179) port 443 (#0)  
\* ALPN, offering h2  
\* ALPN, offering http/1.1  
\* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH  
\* successfully set certificate verify locations:  
\* CAfile: /etc/ssl/certs/ca-certificates.crt  
CApath: /etc/ssl/certs  
\* TLSv1.2 (OUT), TLS header, Certificate Status (22):  
\* TLSv1.2 (OUT), TLS handshake, Client hello (1):  
\* TLSv1.2 (IN), TLS handshake, Server hello (2):  
\* TLSv1.2 (IN), TLS handshake, Certificate (11):  
\* TLSv1.2 (IN), TLS handshake, Server key exchange (12):  
\* TLSv1.2 (IN), TLS handshake, Server finished (14):  
\* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):  
\* TLSv1.2 (OUT), TLS change cipher, Client hello (1):  
\* TLSv1.2 (OUT), TLS handshake, Finished (20):  
\* TLSv1.2 (IN), TLS change cipher, Client hello (1):  
\* TLSv1.2 (IN), TLS handshake, Finished (20):  
\* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384  
\* ALPN, server accepted to use h2  
\* Server certificate:  
\* subject: CN=domain.de  
\* start date: Feb 19 10:00:47 2018 GMT  
\* expire date: May 20 10:00:47 2018 GMT  
\* subjectAltName: host "domain.de" matched cert's "domain.de"  
\* issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3  
\* SSL certificate verify ok.  
\* Using HTTP2, server supports multi-use  
\* Connection state changed (HTTP/2 confirmed)  
\* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0  
\* Using Stream ID: 1 (easy handle 0x55d7df949da0)  
\> GET /jira HTTP/1.1  
\> Host: domain.de  
\> User-Agent: curl/7.52.1  
\> Accept: \*/\*  
\>  
\* Connection state changed (MAX_CONCURRENT_STREAMS updated)!  
\< HTTP/2 302  
\< server: nginx/1.13.8  
\< date: Mon, 19 Feb 2018 20:43:04 GMT  
\< location: <https://domain.de/jira/>  
\< x-frame-options: ALLOW  
\<  
\* Curl_http_done: called premature == 0  
\* Connection #0 to host domain.de left intact


Answers:
author: Dave Theodore [Coyote Creek Consulting]
body: I suggest shutting down Confluence, deleting the application logs (or move them to another directory,) then restart. Watch the logs during the restart and you should see what the problem is. My hunch is that it is not connecting to the external directory that you have configured. If you're using SSL, check that the configuration is valid by using curl or ssl_poke.

comments: author: Samuel Tinapp
body: Hey I edit the confluence logs. I can't really see the problem. I'm using ssl but this is working. What do you mean with "not connecting to the extenal directory" which directory?

Kindly Regards

-Sam


author: Dave Theodore [Coyote Creek Consulting]
body: If you can't log in, it's most likely because Confluence cannot connect to the directory that it is configured to verify accounts with.

Off the top of my head, in no particular order, the most likely culprits will be:

* DNS - Confluence server can't resolve the IP of the directory server
* SSL - Confluence doesn't like the SSL configuration of the directory server, for some reason
* Network - There is a connectivity issue preventing Confluence to connect to the directory server
* Whitelist - The directory server had the old Confluence server IP whitelisted and not the new server IP.

I'm sure there are other possibilities too, but I'd expect the problem to be one or more of those.

With regard to "SSL working," you need to test it by pointing \`curl\` to it or some other utility that will verify that the SSL configuration is correct. Web browsers are much more tolerant to SSL misconfiguration than Java and curl are. If you get the "use the -k option" error from curl, you found the problem.


author: Samuel Tinapp
body: Ok I edit the curl command.

The ssl configuration are the same like on the main server.

I didnt change the whitelist ip. This is maybe a good guess.

I replaced the old ip with the new ip in the sql dump. but still the same issue.