3

We are using SDL Web 8.5 along with DXA 2.0 Java version. The current situation is like this: On production Live, we have 2 CD servers which are basically a copy of each other. Both contain a discovery ,deployer, content, context, dxa-model service and for website we have configured two tomcat instance cluster on each CD server. Both CD sever are using same discovery and broker database. We have load balanced only discovery and deployer service which is in active/passive failover mode. Each CD server will use its own content service .inside topology manager configuration we have created a live cd-environment and defined load-balancer ip of discovery service .The Base URL and other parameter are defined correctly but when we try to access the url DXA always throw error Localization not found.below is configuration of discovery service

<ConfigRepository CacheEnabled="true" CacheExpirationDuration="600" ClientId="registration" ClientSecret="encrypted:HzfQh9wYwAKShDxCm4DnnBnysAz9PtbDMFXMbPszSVY=" ConnectionTimeout="40000" ServiceMonitorPollDuration="10" ServiceUri="http://localhost:8082/discovery.svc" TokenServiceUrl="http://localhost:8082/token.svc">
    <Roles>
        <Role Name="TokenServiceCapability" Url="http://localhost:8082/token.svc"/>
        <Role Name="PreviewWebServiceCapability" Url="http://localhost:8083/ws/preview.svc"/>
        <Role Name="ContextServiceCapability" Url="http://localhost:8087/context.svc"/>
        <Role Name="DeployerCapability" Url="http://load-balancer-ip:8084/httpupload">
            <Property Name="undo.enabled" Value="false"/>
            <Property Name="encoding" Value="UTF-8"/>
        </Role>
        <Role Name="ContentServiceCapability" Url="http://localhost:8081/content.svc">
            <Property Name="dxa-model-service" Value="http://localhost:8998/ModelService"/>
        </Role>
    </Roles>
</ConfigRepository>

we had also run following command

java -jar discovery-registration.jar update 

at CMS side we run following command

Sync-TtmCdEnvironment -Id Live_Environment -Force

The Live_Environment contains load balanced discovery url

Edit

enter image description here

Error

Configuration exception
com.tridion.configuration.ConfigurationException: Can't resolve publication from given URL: http://10.40.5.21:9012/en/personal
    at com.sdl.web.api.dynamic.DynamicMappingsRetrieverImpl.getPublicationMapping(DynamicMappingsRetrieverImpl.java:32)
    at com.sdl.webapp.tridion.TridionLocalizationResolver.getPublicationMappingData(TridionLocalizationResolver.java:100)
    at com.sdl.webapp.tridion.TridionLocalizationResolver.getLocalization(TridionLocalizationResolver.java:69)
    at com.sdl.webapp.common.impl.WebRequestContextImpl.localization(WebRequestContextImpl.java:205)
    at com.sdl.webapp.common.impl.WebRequestContextImpl.getLocalization(WebRequestContextImpl.java:82)
    at com.sdl.webapp.common.impl.WebRequestContextImpl.isPreview(WebRequestContextImpl.java:105)
    at com.sdl.webapp.common.impl.WebRequestContextImpl$$FastClassBySpringCGLIB$$2bfec188.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
    at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
    at com.sdl.webapp.common.impl.WebRequestContextImpl$$EnhancerBySpringCGLIB$$fec7d99e.isPreview(<generated>)
    at com.sdl.webapp.common.impl.interceptor.StaticContentInterceptor.preHandle(StaticContentInterceptor.java:103)
    at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:134)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:958)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at com.tridion.ambientdata.web.AbstractAmbientDataServletFilter.doFilter(AbstractAmbientDataServletFilter.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:193)
    at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:322)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
6
  • What is logged in the DXA and Content Service log files? Commented May 22, 2018 at 6:08
  • Impressive network diagram, but I still don't really get it. How are Webserver 1 and 2 and Tomcat 1,2, 1' and 2' related? Both Webservers seem to be connected somehow to all four Tomcat instances? Commented May 22, 2018 at 15:22
  • Regarding the error: which of the boxes has IP address 10.40.5.21? Did you register this IP address in Topology Manager? Commented May 22, 2018 at 15:24
  • @RickPannekoek Webserver 1 and 2 are load balanced using a Barracuda WAF. All 4 tomcat instances are setup in a cluster and both webserver (Apache) are configured to talk to all 4 tomcat (mod_jk). 10.40.5.21 is CD server1 (lets say the box on the left is CD1 and the one on the right is CD2). Commented May 22, 2018 at 17:41
  • OK, it’s remarkable that the DXA Web App apparently sees the incoming request destined for the IP address of the back-end server (I assume the original request is not?). Question remains: did you register that IP address in Topology Manager? Commented May 22, 2018 at 18:51

2 Answers 2

2

If you are using a Load Balancer between your CIL (which is used by DXA) and the CIS (microservices), you must ensure that all Capabilities (at least Token, Content and Context) are registered with the Load Balancer’s DNS name or IP address.

5
  • we want that each CD server use its own content and model service so that we can reduce network latency. We have load balanced discovery and deployer microservice only for publishing reason so that if one deployer stopped publishing will continue with other deployer. Commented May 20, 2018 at 7:44
  • It is unclear how you intent to distribute the web app load over those two environments, then (or configure a fail-over for that matter). Regardless, I assume your web app runs on a different box than the CIS environment(s)? In that case, you should never register the Capabilities with localhost. Commented May 20, 2018 at 15:52
  • @RickPannekoek we have 2 CD servers and each CD server is hosting the CD Environment as well as acts as the Presentation Server. We have a load balancer between the CM and CD servers. This is to ensure that publishing is not affected in case one of the servers is down and offline for maintenance. In our case the web app runs on the same box as the CIS environment. With this in mind, how do you suggest we register the capabilities? Commented May 20, 2018 at 18:49
  • But how do you ensure that both environments are kept in sync, then? Commented May 22, 2018 at 6:10
  • @RickPannekoek We are using common discovery and broker database for both CD server .i have included diagram of the infrastructure please check this as well Commented May 22, 2018 at 8:30
0

The problem seems to be in the way your Load Balancing works versus your Topology Manager Website registration.

I assume the original request is destined for the Load Balancer's IP address (10.40.5.23) or DNS name. However, the error message reveals that the DXA web app sees that the request is destined for the back-end server on which it runs (10.40.5.21). So, apparently, the Load Balancer is not transparent (i.e. it doesn't keep the original Host header).

You could try if the Load Balancer can be configured to be transparent. Alternatively, you can adjust the Website Base URLs in Topology Manager: specify the IP addresses of the back-end servers instead of the Load Balancer.

In general, DXA maps URLs to Publications (through URLs and Mappings configured in Topology Manager). It uses the URL of the incoming request and in your case that seems to be different than the original URL.

This doesn't have to be a problem (you can adjust the Website registration in Topology Manager accordingly) unless you want more complex Publication mappings: if you want to map to different Publications depending on the DNS/Host name, the DXA web app should see the original Host name (so the Load Balancer should be transparent and keep the original Host header).

2
  • in the topology manager we can define multiple BaseURL for a website we have defined all possible base url like direct individual tomcat url, webserver url and load balancer url none of them working . Can u please explain also how DXA exactly get publication from URL. Commented May 23, 2018 at 12:18
  • The Base URL you have to register is in the error message: http://10.40.5.21:9012. Did you include the port number? Did you register both back-end servers? Please provide the output of Get-TtmWebsite and Get-TtmMapping. Commented May 23, 2018 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.