cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Datahub publication stuck in 'In Progress'

0 Likes
1,940

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

Accepted Solutions (0)

Answers (3)

Answers (3)

VinayKumarS
Active Contributor
0 Likes

Hi Sushmitha,

Please go thru the below link.

https://help.sap.com/viewer/50c996852b32456c96d3161a95544cdb/6.7.0.0/en-US/bdba2e337caa44b693df740cc...

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

Slava
Product and Topic Expert
Product and Topic Expert
0 Likes
0 Likes

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!

Slava
Product and Topic Expert
Product and Topic Expert
0 Likes

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...

0 Likes

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

Slava
Product and Topic Expert
Product and Topic Expert
0 Likes

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.

Slava
Product and Topic Expert
Product and Topic Expert
0 Likes

You can try to use publicationID 739 in the PUT request, but more likely using 740 will stop that publication. Also, you can restart DataHub. On restart it will make current IN_PROGRESS publication as failed and will attempt to republish the data

0 Likes

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/

Slava
Product and Topic Expert
Product and Topic Expert
0 Likes

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.

Former Member
0 Likes

you mean after the restart, it starts working?

0 Likes

Yes it works after restart.