cancel
Showing results for 
Search instead for 
Did you mean: 

Datahub: Target system publication error

Former Member
0 Kudos

Hello

I am getting this error after every publication to hybris. The publication itself seems to work correctly. But this error fills my log and looks nasty. Can somebody help me to get rid of this:

 2017-10-26 15:57:22,351 [INFO] [c.h.d.r.r.CoreAdapterResource] Core adapter completes publication 2 with status SUCCESS
 2017-10-26 15:57:22,376 [DEBUG] [c.h.d.s.i.DefaultPublicationActionService] Publication Result for publication 2 : with status SUCCESS
 2017-10-26 15:57:22,378 [ERROR] [c.h.d.r.r.m.BaseExceptionMapper] An exception intercepted
 java.lang.IllegalStateException: Target system publication with id 2 has already been completed or is pending. Aborting further completion actions.
     at com.hybris.datahub.service.impl.DefaultPublicationActionService.completeTargetSystemPublication(DefaultPublicationActionService.java:120) ~[datahub-service-6.0.0.1-RC1.jar:6.0.0.1-RC1]
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
     at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at com.sun.proxy.$Proxy133.completeTargetSystemPublication(Unknown Source) ~[na:na]
     at com.hybris.datahub.core.adapter.facade.DefaultCoreAdapterFacade.completePublication(DefaultCoreAdapterFacade.java:76) ~[datahub-core-export-service-6.0.0.1-RC1.jar:na]
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
     at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at com.sun.proxy.$Proxy164.completePublication(Unknown Source) ~[na:na]
     at com.hybris.datahub.rest.resources.CoreAdapterResource.completePublication(CoreAdapterResource.java:91) ~[datahub-core-export-service-6.0.0.1-RC1.jar:na]
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
     at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
     at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84) ~[jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542) [jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473) [jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419) [jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409) [jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409) [jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558) [jersey-bundle-1.19.jar:1.19]
     at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733) [jersey-bundle-1.19.jar:1.19]
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) [servlet-api.jar:na]
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) [catalina.jar:7.0.75]
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.75]
     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat7-websocket.jar:7.0.75]
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.75]
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.75]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:168) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:213) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:98) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176) [spring-security-web-4.0.0.RELEASE.jar:na]
     at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) [spring-web-4.1.5.RELEASE.jar:4.1.5.RELEASE]
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.75]
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.75]
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218) [catalina.jar:7.0.75]
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) [catalina.jar:7.0.75]
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) [catalina.jar:7.0.75]
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) [catalina.jar:7.0.75]
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) [catalina.jar:7.0.75]
     at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) [catalina.jar:7.0.75]
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.75]
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) [catalina.jar:7.0.75]
     at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1087) [tomcat-coyote.jar:7.0.75]
     at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) [tomcat-coyote.jar:7.0.75]
     at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) [tomcat-coyote.jar:7.0.75]
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_144]
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_144]
     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.75]
     at java.lang.Thread.run(Thread.java:748) [na:1.8.0_144]
 

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

In the hybris log I found some communication problems with datahub. Maybe its the cause of the original problem:

 INFO  [TaskExecutor-master-95-Task [8798157636534]] [ImpexDataImportClient] Response status from http://localhost:8080/datahub-webapp/v1/core-publications/2: 400
 ERROR [TaskExecutor-master-95-Task [8798157636534]] [ImpexDataImportClient] Failed to communicate to http://localhost:8080/datahub-webapp/v1/core-publications/2
 java.lang.IllegalStateException: Bad Request response from http://localhost:8080/datahub-webapp/v1/core-publications/2
     at com.hybris.datahub.core.rest.client.ImpexDataImportClient.returnImportResult(ImpexDataImportClient.java:79) [datahubadapterserver.jar:?]
     at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.callbackToDataHub(DefaultItemImportFacade.java:117) [datahubadapterserver.jar:?]
     at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.importItems(DefaultItemImportFacade.java:60) [datahubadapterserver.jar:?]
     at com.hybris.datahub.core.tasks.ItemImportTaskRunner.run(ItemImportTaskRunner.java:48) [datahubadapterserver.jar:?]
     at com.hybris.datahub.core.tasks.DefaultDataHubTaskExecutionStrategy.run(DefaultDataHubTaskExecutionStrategy.java:33) [datahubadapterserver.jar:?]
     at de.hybris.platform.task.impl.DefaultTaskService.processTask(DefaultTaskService.java:1505) [processingserver.jar:?]
     at de.hybris.platform.task.impl.DefaultTaskService.process(DefaultTaskService.java:1409) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService.processInTenant(DefaultTaskService.java:1378) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService$5.run(DefaultTaskService.java:1257) [processingserver.jar:?]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
      at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
  ERROR [TaskExecutor-master-95-Task [8798157636534]] [DefaultTaskService] Failed to execute task 8798157636534(hjmpTS:0).
  de.hybris.platform.servicelayer.exceptions.SystemException: java.lang.IllegalStateException: Failed to communicate to http://localhost:8080/datahub-webapp/v1/core-publications/2
      at com.hybris.datahub.core.tasks.DefaultDataHubTaskExecutionStrategy.run(DefaultDataHubTaskExecutionStrategy.java:41) ~[datahubadapterserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService.processTask(DefaultTaskService.java:1505) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService.process(DefaultTaskService.java:1409) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService.processInTenant(DefaultTaskService.java:1378) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService$5.run(DefaultTaskService.java:1257) [processingserver.jar:?]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
      at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
  Caused by: java.lang.IllegalStateException: Failed to communicate to http://localhost:8080/datahub-webapp/v1/core-publications/2
      at com.hybris.datahub.core.rest.client.ImpexDataImportClient.returnImportResult(ImpexDataImportClient.java:85) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.callbackToDataHub(DefaultItemImportFacade.java:117) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.importItems(DefaultItemImportFacade.java:60) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.ItemImportTaskRunner.run(ItemImportTaskRunner.java:48) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.DefaultDataHubTaskExecutionStrategy.run(DefaultDataHubTaskExecutionStrategy.java:33) ~[datahubadapterserver.jar:?]
      ... 7 more
  Caused by: java.lang.IllegalStateException: Bad Request response from http://localhost:8080/datahub-webapp/v1/core-publications/2
      at com.hybris.datahub.core.rest.client.ImpexDataImportClient.returnImportResult(ImpexDataImportClient.java:79) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.callbackToDataHub(DefaultItemImportFacade.java:117) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.importItems(DefaultItemImportFacade.java:60) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.ItemImportTaskRunner.run(ItemImportTaskRunner.java:48) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.DefaultDataHubTaskExecutionStrategy.run(DefaultDataHubTaskExecutionStrategy.java:33) ~[datahubadapterserver.jar:?]
      ... 7 more
  ERROR [TaskExecutor-master-95-Task [8798157636534]] [ItemImportTaskRunner] ItemImportTaskRunner.handleError()
  de.hybris.platform.servicelayer.exceptions.SystemException: java.lang.IllegalStateException: Failed to communicate to http://localhost:8080/datahub-webapp/v1/core-publications/2
      at com.hybris.datahub.core.tasks.DefaultDataHubTaskExecutionStrategy.run(DefaultDataHubTaskExecutionStrategy.java:41) ~[datahubadapterserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService.processTask(DefaultTaskService.java:1505) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService.process(DefaultTaskService.java:1409) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService.processInTenant(DefaultTaskService.java:1378) [processingserver.jar:?]
      at de.hybris.platform.task.impl.DefaultTaskService$5.run(DefaultTaskService.java:1257) [processingserver.jar:?]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
      at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
  Caused by: java.lang.IllegalStateException: Failed to communicate to http://localhost:8080/datahub-webapp/v1/core-publications/2
      at com.hybris.datahub.core.rest.client.ImpexDataImportClient.returnImportResult(ImpexDataImportClient.java:85) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.callbackToDataHub(DefaultItemImportFacade.java:117) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.importItems(DefaultItemImportFacade.java:60) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.ItemImportTaskRunner.run(ItemImportTaskRunner.java:48) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.DefaultDataHubTaskExecutionStrategy.run(DefaultDataHubTaskExecutionStrategy.java:33) ~[datahubadapterserver.jar:?]
      ... 7 more
  Caused by: java.lang.IllegalStateException: Bad Request response from http://localhost:8080/datahub-webapp/v1/core-publications/2
      at com.hybris.datahub.core.rest.client.ImpexDataImportClient.returnImportResult(ImpexDataImportClient.java:79) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.callbackToDataHub(DefaultItemImportFacade.java:117) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.facades.impl.DefaultItemImportFacade.importItems(DefaultItemImportFacade.java:60) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.ItemImportTaskRunner.run(ItemImportTaskRunner.java:48) ~[datahubadapterserver.jar:?]
      at com.hybris.datahub.core.tasks.DefaultDataHubTaskExecutionStrategy.run(DefaultDataHubTaskExecutionStrategy.java:33) ~[datahubadapterserver.jar:?]
      ... 7 more

Maybe hybris tries to get the status from data hub twice due to a connection error.

Slava
Advisor
Advisor
0 Kudos

This is the same problem on the other side: the publication is not IN_PROGRESS anymore, so when Hybris sends publication result to http://localhost:8080/datahub-webapp/v1/core-publications/2, the exception is thrown on the DataHub side indicating that there is nothing to complete (your original stack trace), that exception results in 400 response to Hybris, which is logged on Hybris's side.

Slava
Advisor
Advisor
0 Kudos

Andreas,

I can explain what that means and then we can think of possible reasons, which may cause this problem.

The process of publication from DataHub to the hybris EC platform is asynchronous: DataHub sends a request to import data and does not wait for the data import to finish. When the platform finishes the import it sends a request to /core-publications/{publicationId} REST API path on the DataHub server with the results of the data import. In your case the publicationId is 2 and the result is SUCCESS, meaning all data have been published successfully. Upon receiving that request DataHub updates status of the publication action and depending on the result may perform other actions too. However in your case as DataHub tries to update the publication #2 status, if finds that the publication does not have IN_PROGRESS status. It's either has not started yet and has status PENDING or it has been already completed (status is SUCCESS, FAILURE or COMPLETE_W_ERRORS). You can check the publication status by either selecting it from the database: select * from PublicationAction where publicationId=2; or querying it through the REST API: /pools/{poolName}/publications

Now let's think why this may happen.

1) One most likely reason is that pub-recover extension is used with short publication timeout. In this case the pub-recover would check after certain time whether the publication is complete and, if not, would fail the publication (status=FAILURE). Later when platform responds with SUCCESS, it's too late - the publication has been interrupted already. Check why publication is taking so long or tweak the pub-recover configuration to give more time for publications to complete.

2) After sending data to the platform, DataHub crashes and assumes publication has failed. Also, the status would be FAILURE in this case and you also should see some stack trace in the log prior to the one you pasted here.

3) For some reason the platform responds more than once. Could it be the same data sent twice to the same target system within the same publication? This probably would mean some sort of customization or a really weird networking problem. However check if this possibly is happening.

4) Last reason that comes to mind, is also around customization done to the product: some sort of extension updates the publication status in addition to standard datahub update.

General recommendation: start by figuring out what status the publication has in the database when that exception is thrown. This alone may narrow down the cases to think about. Then check the log output for more stack traces. And finally think about possible customization done.

Former Member
0 Kudos

What is the pub-recover extension? Do you know the property for the publication timeout by any chance? Cannot find it.

Slava
Advisor
Advisor
0 Kudos

I explain more about it in https://experts.hybris.com/questions/87299/datahub-target-system-publication-items-gets-stuck-1.html... The standard pub-recover extension is not enabled by default, so if you don't know about it, probably it's not the reason. Let me know, if you still have more questions.

There is one more scenario to look at: check if there are other exceptions in the log during the publication. If publication crashes, it's marked as FAILED right away.