on ‎2019 Jul 26 4:14 PM
Hello All,
The datahub publication is getting stuck 'In Progress' state.
We have been facing this issue for a long time now, and every time we are doing a datahub server restart to kill the publication.
We tried to kill this publication thread, using below: http://(server address)/datahub-webapp/v1/core-publications/(publication id) Body: {"crashReport":"fail"}
Have tried using the main publication id and also sub publication id. But both doesn't work.
Error we get when hitting this service: com.hybris.datahu.runtime.domain.jpa.entities.CompositeTargetSystemPublicationEntity (loaded by org.apache.catalina.loader.WebappClassLoader@0x00000007f021b000) cannot be cast to com.datahub.runtime.domain.SubTarget.Publication (loaded by org.apache.catalina.loader.WebappClassLoader@0x00000007f021b000)
Please suggest!
Thanks Sushmitha
Request clarification before answering.
Hi Sushmitha,
Please go thru the below link.
One catch here. when you tried this crashreport report you need to try this from postman using the http method as PUT. Not as POST
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This question has been answered many times, so rather than repeating again I will simply follow you to the previous answers pertaining the problem:
https://answers.sap.com/questions/12756488/datahub-exception-in-publication-grouping-handler.html
https://answers.sap.com/questions/12760140/data-hub-publications-are-in-progress-but-but-noth.html
https://experts.hybris.com/questions/42122/datahub-publication-in-progress-for-a-long-time.html
This is probably just a few answers. There can be more but these should be enough. Search for "IN_PROGRESS" to find more
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Slava, Thanks for the response.
I've tried almost everything suggested here, but couldn't kill the 'In Progress' publication and so I had to post it again! 😞 😞
Response from : datahub-webapp/v1/target-system-publications?q=status%3AIN_PROGRESS

Error I get when I hit PUT :datahub-webapp/v1/core-publications/153
com.hybris.datahub.runtime.domain.jpa.entities.CompositeTargetSystemPublicationEntity (loaded by org.apache.catalina.loader.WebappClassLoader@0x00000007f01f3248) cannot be cast to com.hybris.datahub.runtime.domain.SubTargetSystemPublication (loaded by org.apache.catalina.loader.WebappClassLoader@0x00000007f01f3248)
Let me know if I am doing something wrong here 😞
Thanks!
The mistake you're making is that you're using the target system publication ID in your PUT request. But you need to use an ID of a sub-publication. Details about why and how to find it here: https://answers.sap.com/questions/12772259/put-request-on-datahub-not-working.html?childToView=12806...
Hello Slava,
I am not sure how subpublication id looks! the response I got is below. and the only thread in progress is the first publication:
<publicationActionData>
<actionId>52</actionId>
<type>PUBLICATION</type>
<startTime>2019-07-30T14:08:04.937Z</startTime>
<status>IN_PROGRESS</status>
<poolName>H_SAP_PLM_POOL</poolName>
<targetSystemPublications>
<publicationId>739</publicationId>
<startTime>2019-07-30T14:08:05.166Z</startTime>
<status>IN_PROGRESS</status>
<targetSystemName>HybrisCore</targetSystemName>
<actionId>52</actionId>
<poolName>H_SAP_PLM_POOL</poolName>
<canonicalItemCount>0</canonicalItemCount>
<internalErrorCount>0</internalErrorCount>
<externalErrorCount>0</externalErrorCount>
<ignoredCount>0</ignoredCount>
</targetSystemPublications>
</publicationActionData>
<publicationActionData>
<actionId>13</actionId>
<type>PUBLICATION</type>
<startTime>2019-07-23T12:57:55.816Z</startTime>
<endTime>2019-07-23T13:00:45.361Z</endTime>
<status>COMPLETE_W_ERRORS</status>
<poolName>H_SAP_PLM_POOL</poolName>
<targetSystemPublications>
<publicationId>65</publicationId>
<startTime>2019-07-23T12:57:56.045Z</startTime>
<endTime>2019-07-23T13:00:44.960Z</endTime>
<status>COMPLETE_W_ERRORS</status>
<targetSystemName>HybrisCore</targetSystemName>
<actionId>13</actionId>
<poolName>H_SAP_PLM_POOL</poolName>
<canonicalItemCount>269</canonicalItemCount>
<internalErrorCount>0</internalErrorCount>
<externalErrorCount>70</externalErrorCount>
<ignoredCount>0</ignoredCount>
</targetSystemPublications>
</publicationActionData>
Thanks
In the other answer I explained that sub-publications are not exposed publicly, they're done under the hood, so you won't see them in the API responses. I also said the only way to get them is either from the datahub database (if you have access to it) - check table TargetSystemPub; or from the log. Also, Usually sub-publication IDs sequentially follow the target system publication ID, e.g. if target system publication ID is 739, then the first sub-publication has ID 740, second 741, etc.
Thanks for the patience!! really! BUT...
I tried it again, my targetSystemPublication id was 169, through logs I got compositePublicationId=169, subPublicationId=170. So I tried PUT request /datahub-webapp/v1/core-publications/170 and I got 200 OK response.
But the publication is still In Progress.
I get this in logs: SubPublicationContextInfo{poolName='H_SAP_PLM_POOL', compositePublicationId=169, subPublicationId=170, publicationActionId=22} with status COMPLETE_W_ERRORS
I tried with 171,172.. but they were all gave me null object.
<publicationActionData>
<actionId>22</actionId>
<type>PUBLICATION</type>
<startTime>2019-07-31T13:46:22.776Z</startTime>
<status>IN_PROGRESS</status>
<poolName>H_SAP_PLM_POOL</poolName>
<targetSystemPublications>
<publicationId>169</publicationId>
<startTime>2019-07-31T13:46:23.245Z</startTime>
<status>IN_PROGRESS</status>
<targetSystemName>HybrisCore</targetSystemName>
<actionId>22</actionId>
<poolName>H_SAP_PLM_POOL</poolName>
<canonicalItemCount>526</canonicalItemCount>
<internalErrorCount>12</internalErrorCount>
<externalErrorCount>0</externalErrorCount>
<ignoredCount>466</ignoredCount>
</targetSystemPublications>
</publicationActionData>
Do you think restart is the only option I have now?!!!
Thanks/
The sure way to find and complete the right publication would be to check the database. You can find all publication actions IN_PROGRESS, you can find all target system publications IN_PROGRESS and all sub-publications (`compositetargetsystempub` is the id of the IN_PROGRESS target system publication). It's always the last sub-publication that is stuck.
Also, take a look into the log on the hybris side. It logs what PUT requests it received from datahub and the URLs contain the sub-publication ID.
You need to find the right sub-publication ID and stop guessing what publication to stop.
you mean after the restart, it starts working?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.