cancel
Showing results for 
Search instead for 
Did you mean: 

Datahub - Publication gets stuck in IN_PROGRESS mode

chandnigideon13
Product and Topic Expert
Product and Topic Expert
0 Kudos
382

Hi All,

We are migrating Datahub with Commerce to CCV2. After migration, if we try to push an IDOC(via Postman) to commerce, the 1st IDOC creates the Product but it gets stuck in IN_PROGRESS status. Post that, all the requests go in Pending status.
We have tried to explicitly put the request in Failure status but that also doesn't seem to work.

It seems as if the acknowledgment from Commerce to Datahub is not going because of which it remains in IN_PROGRESS status.

Could anybody please let us know if there is any specific configuration or property which needs to be done on Commerce or on datahub so that the acknowledgment callback starts working?

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Slava
Product and Topic Expert
Product and Topic Expert
0 Kudos

There are no properties specific to CCv2 environment. It's all the same as a stand-alone deployment.

Most likely DataHub sends the data to the platform but the platform fails to notify the datahub about the publication status. If so, then you need to look at the configuration of `datahub.server.url`, which should point back to the DataHub instance in the CCv2 environment. You can see how this property is configured in a sample deployment: https://github.com/SAP-samples/cloud-commerce-sample-setup/blob/2011-datahub/datahub/config/datahub-...


Another possible reason, is that the datahub user passwords are not configured correctly on the commerce side, so the callback to datahub fails authentication. As you see, the conf file above defines datahub user passwords, The platform manifest should configure `datahub.backoffice.rest.client.password.admin` and `datahub.backoffice.rest.client.password.developer` properties to match those values respectively. You can see how those properties are configured in the sample manifest: https://github.com/SAP-samples/cloud-commerce-sample-setup/blob/2011-datahub/core-customize/manifest...

chandnigideon13
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Vyacheslav,

I was missing the properties in manifest. Added those but still the 1st IDOC remains in IN_PROGRESS state. I can see it on /datahub-webapp/v1/pools/GLOBAL/publications

and the next one goes in PENDING state.

Also, the load and compose count increases in backoffice but the Publication count is always zero.

Slava
Product and Topic Expert
Product and Topic Expert
0 Kudos

Have you redeployed DataHub? If yes, then study the datahub and the platform logs to see what exactly is happening. Confirm that DataHub sends data to the platform, that the datahubadapter receives the data and imports them, that the datahubadapter sends a request back to datahub, and that datahub receives that request. The URLs should be logged along the way, so you can confirm whether your changes took the effect.

chandnigideon13
Product and Topic Expert
Product and Topic Expert
0 Kudos

Yes, I did redeploy datahub and if I check the logs, the publication is successful but it throws this exception

2022-05-17 08:51:34,487 [INFO ][http-nio-8080-exec-7][com.hybris.datahub.service.impl.DefaultTargetSystemPublicationCompletionService] Publication Result for publication 5 with status SUCCESS

2022-05-17 08:51:34,574 [DEBUG][http-nio-8080-exec-7][com.hybris.datahub.service.publication.impl.DefaultPublicationRetryService] Removed 0 retries for items published in CompositeTargetSystemPublicationEntity{id=1, status=IN_PROGRESS, publicationType=null, publicationAction=PublicationActionEntity{id=1, pool=DataHubPoolEntity{id=0, name=GLOBAL}}, targetSystem=TargetSystemEntity{id=1, targetSystemName='HybrisCore', targetSystemType='HybrisCore'}}

2022-05-17 08:51:34,601 [INFO ][defaultTaskExecutor-4][com.hybris.datahub.service.impl.AsynchronousEventPublicationService] Firing data hub event : com.hybris.datahub.api.event.DeletePublicationRetryEvent@58db582e[]

2022-05-17 08:51:34,617 [WARN ][poolEventTaskExecutor-1][com.hybris.datahub.service.publication.impl.DeletePublicationRetryEventListener] deleting 0 publication retries from target system id 1

2022-05-17 08:51:34,618 [INFO ][poolEventTaskExecutor-1][com.hybris.datahub.service.publication.impl.DeletePublicationRetryEventListener] deleting publication retries for the following canonical items [] in pool 0 for target system id 1

2022-05-17 08:51:34,658 [ERROR][http-nio-8080-exec-7][com.hybris.datahub.rest.resources.mapper.BaseExceptionMapper] An exception intercepted

java.lang.UnsupportedOperationException: query result offset is not supported

at org.hibernate.dialect.pagination.TopLimitHandler.processSql(TopLimitHandler.java:56)

at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2029)

at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2012)

at org.hibernate.loader.Loader.doQuery(Loader.java:948)

at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:349)

at org.hibernate.loader.Loader.doList(Loader.java:2843)

at org.hibernate.loader.Loader.doList(Loader.java:2825)

at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2657)

at org.hibernate.loader.Loader.list(Loader.java:2652)

at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:506)



And the again

2022-05-17 08:51:35,996 [INFO ][http-nio-8080-exec-1][com.hybris.datahub.rest.resources.CoreAdapterResource] Received PUT request /core-publications/{publicationId} with args [5,PublicationResult{status=SUCCESS, crashReport=null}]

2022-05-17 08:51:36,011 [INFO ][http-nio-8080-exec-1][com.hybris.datahub.rest.resources.CoreAdapterResource] Core adapter completes publication SubPublicationContextInfo{poolName='GLOBAL', compositePublicationId=1, subPublicationId=5, publicationActionId=1} with status SUCCESS

2022-05-17 08:51:36,117 [ERROR][http-nio-8080-exec-1][com.hybris.datahub.rest.resources.mapper.BaseExceptionMapper] An exception intercepted

java.lang.IllegalStateException: Target system publication with id 5 has already been completed or is pending. Aborting further completion actions.

at com.hybris.datahub.service.impl.DefaultTargetSystemPublicationCompletionService.completeTargetSystemPublication(DefaultTargetSystemPublicationCompletionService.java:98)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)

at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)

at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)

at com.sun.proxy.$Proxy173.completeTargetSystemPublication(Unknown Source)

at com.hybris.datahub.service.impl.DefaultPublicationActionService.completeTargetSystemPublication(DefaultPublicationActionService.java:57)

at com.hybris.datahub.core.adapter.facade.DefaultCoreAdapterFacade.completePublication(DefaultCoreAdapterFacade.java:80)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

Slava
Product and Topic Expert
Product and Topic Expert
0 Kudos

Your system must be configured correctly, if you get to that stack trace. The stack trace is a bug related to https://jira.tools.sap/browse/CXEC-8466. Create a bug ticket against CXEC project and "datahub" component in the Jira. Describe your version, extensions used, and a particular example of how to reproduce this problem. Looks like we either did not backport the fix entirely to your specific version or the program flow in your deployment goes a different path that is different form what we tested.