REST API forces trace with the error U00045014 Exception 'java.lang.IllegalArgumentException: "Username is missing a department or separator: USER"'
search cancel

REST API forces trace with the error U00045014 Exception 'java.lang.IllegalArgumentException: "Username is missing a department or separator: USER"'

book

Article ID: 406040

calendar_today

Updated On:

Products

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

Issue/Introduction

The below exception can be seen within the REST API logs upon upgrade to v24 and while opening a User Group

U00045098 Method 'GET', URL: 'https://<hostname_or_ip>:<port>/ae/api/v1/<client>/system/users', received from IP: 'xxx.xx.xx.xx' 'User: <User>/<Dept>'
U00045014 Exception 'java.lang.IllegalArgumentException: "Username is missing a department or separator: USER"' at 'com.automic.persistence.api.UserDefinition.parseObjectName():116'.
U00003620 Routine 'com.automic.rest.provider.BaseExceptionMapper' forces trace because of error.

In some cases, it is observed that the user groups do not show any assigned users within the group due to this error.

Environment

Release: 24.x

Component: Automation Engine

Functional Area: Export/Import

Cause

The issue was caused by an incorrectly named object, “USER”, which does not conform to the expected object naming convention of NAME/DEPARTMENT for USER-type objects.

An object with the name “USER” and type USER should not have been created in a non-zero client. This is further supported by the fact that it cannot be deleted or renamed using the old XREQ code.

There are two likely scenarios for how this object was introduced in the old legacy systems from which the customer's are upgrading:

  1. It was imported via DBLoad as part of a transport case, bypassing validation.

  2. The validation mechanisms at the time were insufficient.

In current versions, validation checks are in place across all APIs, including those used for transport cases via REST. The issue with the list not appearing is due to the AWI now utilizing a REST endpoint, which correctly enforces validation.

Resolution

In such case, you will not be able to rename/delete/update this object within the AWI, below is what you can do.

Identify if you have an object with the name "USER" in a non-zero client using the below query 

SELECT oh_name, oh_idnr, oh_otype , OH_Client
FROM oh
WHERE oh_name LIKE '%USER%'
  AND oh_otype = 'USER';

Based on the results, if you notice any such object then you can do either of the following 

1) Update the object name within the database using the below query (for the non-zero client)

update oh set oh_name = 'USER/USER' where oh_idnr = <oh_idnr>;
update oh set oh_modcnt = oh_modcnt+1 where oh_Idnr = <oh_idnr>;
commit;

This should allow you to then update/rename/delete this object from the AWI.

or

2) Delete this object directly from the database using the <oh_idnr> as reference 

This should fix the forced traces as well as the display issue with the UserGroup within the AWI.