Unable to Export User Objects in JSON Format – NullPointerException in REST API Logs
search cancel

Unable to Export User Objects in JSON Format – NullPointerException in REST API Logs

book

Article ID: 406856

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine Automic SaaS CA Automic One Automation

Issue/Introduction

When attempting to export user objects in JSON format, the operation fails and the following error is recorded in the REST API log files. A forced trace is also generated:

U00045098 Method 'GET', URL: 'https://<hostname>:<port>/ae/api/v1/<client>/objects/<username>', received from IP: 'xx.xxx.xxx.xxx' 'User: <username>/<department>'
U00045014 Exception 'java.lang.NullPointerException: "Cannot invoke "java.sql.Timestamp.equals(java.sql.Timestamp)" because "pwChange" is null"' at 'com.automic.rest.objects.OutObjectConverter.convertPasswordChangeToBoolean():1881'.
U00003620 Routine 'com.automic.rest.provider.BaseExceptionMapper' forces trace because of error.
U00003450 The TRACE file was opened with the switches '0000000000000000'.
U00003449 Output to the TRACE file is finished.
U00045099 The server replied with the following status: '500' SessionId: '000000001'

Environment

Release: v24

Component: Automic Web Interface

Cause

This issue occurs when the usr_pwChange field for the user object is null, causing a NullPointerException during the export process.

In Automic, the usr_pwchange field is updated only when a password change occurs and is never set to null during normal operations.

If this issue appeared after a migration or upgrade, customers should review older database backups (prior to the change) to determine whether the usr_pwchange field was already null before the migration/upgrade process.

Resolution

Identify and update affected user records where the usr_pwchange field is null. Use the queries below as a reference to check for impacted users:

For LDAP users:

SELECT * FROM USR  
WHERE usr_pwchange IS NULL  
  AND usr_ldap = 1;

For local users:

SELECT * FROM USR  
WHERE usr_pwchange IS NULL  
  AND usr_ldap = 0;

To fix the issue, update the usr_pwchange field for affected users.
Example (Oracle syntax for ldap users):

UPDATE USR  
SET usr_pwchange = SYSDATE  
WHERE usr_pwchange IS NULL  
  AND usr_ldap = 1;

Note: Always take a backup of the database or the affected table before performing any updates.