[DELETE THIS THREAD] Activities suddenly stopped working

cancel
Showing results for 
Search instead for 
Did you mean: 
upforsin
Senior Member

[DELETE THIS THREAD] Activities suddenly stopped working

Hello

I have an Alfresco instance that was up and running a couple of months and then, suddenly new activities stopped showing up both in Share dashlets and with REST API. 

I can see new activities in the alf_activity_post table but not in the alf_activity_feed table.

In the logs, I did not find anything useful (what loggers can I check?).

Do you have any idea what can cause the issue?

After setting the insert_activity_feed logger to DEBUG I can only see lots of "Preparing" logs

2020-12-20 14:56:18,622 DEBUG [alfresco.activities.insert.insert_activity_feed] [LocalFeedGenerator2] <==    Updates: 1
2020-12-20 14:56:18,624 DEBUG [alfresco.activities.insert.insert_activity_feed] [LocalFeedGenerator2] ==>  Preparing: insert into alf_activity_feed (id, activity_type, activity_summary, feed_user_id, post_user_id, post_date, post_id, site_network, app_tool, feed_date) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 
2020-12-20 14:56:18,624 DEBUG [alfresco.activities.insert.insert_activity_feed] [LocalFeedGenerator2] ==> Parameters: 1013936685(Long), org.alfresco.documentlibrary.file-previewed(String), {"firstName":"John","lastName":"Smith","parentNodeRef":"workspace://SpacesStore/af0dha0a-cf60-5997-8129-17364e154a83","nodeRef":"workspace://SpacesStore/2ee995dj-1af4-4a96-9fja-02eeda9384a9","page":"document-details?nodeRef=workspace://SpacesStore/2ee995dj-1af4-4a96-9fja-02eeda9384a9","title":"x1kw(sample_name)_2020.12.02.pdf"}(String), r.johnson(String), l.smith(String), 2020-12-09 08:15:47.983(Timestamp), 5541(Long), sample-site-test(String), documentlibrary(String), 2020-12-20 14:56:18.624(Timestamp)

 

 

EDIT. Thread has been solved in this post. 

howkymike
Alfresco Developer
1 Reply
upforsin
Senior Member

Re: Activities suddenly stopped working

Alright, sorry guys, it seems like my mistake. I added a few lines to LocalFeedTaskProcessor.java to add parentNodeName to the activityPost. It was working for a while but then it was causing an issue (but why?). After commenting out this code it's working again.

I added this code to the selectPost method:

 

for(ActivityPostEntity activityPost : activityPosts) {
try { JSONObject activiyDataJson = new JSONObject(activityPost.getActivityData()); String parentNodeName = (String) nodeService.getProperty(new NodeRef(activiyDataJson.get("parentNodeRef").toString()), ContentModel.PROP_TITLE); if(parentNodeName == null || parentNodeName.length() == 0) { parentNodeName = (String) nodeService.getProperty(new NodeRef(activiyDataJson.get("parentNodeRef").toString()), ContentModel.PROP_NAME); } activiyDataJson.put("parentTitle", parentNodeName); activityPost.setActivityData(activiyDataJson.toString()); } catch (JSONException e) { logger.debug("[LocalFeedTaskProcessor]: could not load JSON while getting parent node!\n"); } catch (Exception e ) {
logger.debug("[LocalFeedTaskProcessor]: could not get parent node!\n"); }
}

(I know it is very inefficient and it should be done in PostLookup but I didn't want to interfere in code too much as I would have to reimplement almost every class connected to the activities)

 

PS. Merry Christmas! 

howkymike
Alfresco Developer