Why is my user activity missing?

2 minute readKnowledge base

Issue

After an upgrade you notice missing users, sudden fluctuations, or inconsistent reports of User Activity Monitoring data. This issue happens when there is a deserialization error of the user-activity-monitoring-v2.json file. In reported cases, the deserialization error was caused when there was a comma in an SCM user name like lastName, firstName. When the deserialization error occurs, the content of the json file is deleted, and you see a message in the logs like the following:

 WARNING o.j.p.u.dao.JsonUserActivityDao#loadJsonData: Failed to read user activity from /var/jenkins_home/user-activity-monitoring-v2.json
    com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize Map key of type `org.jenkinsci.plugins.useractivity.dao.JsonUserActivityDao$UserIdentifier` from String "LNSample, FNSample,SCM,emailsample@testcorporation.com": not a valid representation, problem: (java.lang.reflect.InvocationTargetException) Cannot deserialize a user identifier with missing parts
 at [Source: (File); line: 1, column: 10]
	at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67)
	at com.fasterxml.jackson.databind.DeserializationContext.weirdKeyException(DeserializationContext.java:1979)
	at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdKey(DeserializationContext.java:1184)
    ...

Starting in the CloudBees CI 2.414.1.4 release (August 28th 2023), the User Activity Monitoring (UAM) plugin was updated to improve the way users were counted and de-duplicated. A bug was discovered in UAM versions starting in 1.13 that had resulted in the intermittent deletion of UAM data at the operations center and the controller level. This also affects the 1.18 and 1.19 versions of UAM, hence all CloudBees CI versions from 2.414.1.4 through to 2.452.1.2 are impacted.

Resolution

Upgrade to CloudBees CI version 2.452.2.3 (or newer).

Workaround

If you are unable to update to a version that includes the fix please open a new ticket with the CloudBees Support team.

We have released a UAM plugin version 1.50 that can be provided by our support team. The hpi file will need to be installed manually on affected instances. To avoid the loss of user data UAM 1.50 is compatible back to CI 2.401.2.3 so that it can be installed prior to upgrading to affected product versions.

Once UAM 1.50 is installed you will no longer see the deserialization error. The plugin will stay in place through upgrades to affected product versions. Installing UAM 1.50 will cause some beekeeper warnings so be sure that automatic downgrades of plugins on restart are disabled in the CAP settings or the plugin will revert back to an affected version on restart.

Tested product/plugin versions

  • CloudBees CI 2.401.2.3-2.452.1.2 User Activity Monitoring: 1.18, 1.19, 1.50