Error while executing command for user audit in NSX Manager CLI
search cancel

Error while executing command for user audit in NSX Manager CLI

book

Article ID: 375623

calendar_today

Updated On: 04-14-2025

Products

VMware NSX VMware NSX Networking VMware NSX-T Data Center

Issue/Introduction

NSX Manager admin CLI returned error "Invalid value for argument <username>: audit" on every command execution for user audit.


NSX-Manager> get user audit ssh-keys 
Fri Oct 14 2022 UTC 10:44:48.224
Invalid value for argument <username>: audit

NSX-Manager> get user audit status
Fri Oct 14 2022 UTC 10:45:00.667
Invalid value for argument <username>: audit

NSX-Manager> get user audit password-expiration 
Fri Oct 14 2022 UTC 10:45:07.553
Invalid value for argument <username>: audit

Environment

NSX-T
NSX Data Center

Cause

Problem validation :

1. Go to NSX UI > System > User Settings > Local Users.

2. Ensure user 'audit' (User ID as 10002) status as Active.

3. Run admin CLI commands for user 'audit'. No error returned.

nsx-mngr-01> get user audit ssh-keys
Fri Oct 14 2022 UTC 03:03:54.005
No ssh-keys configured

nsx-mngr-01> get user audit status
Fri Oct 14 2022 UTC 03:04:32.252
Full name:
Username:  audit
Status:    ACTIVE

nsx-mngr-01> get user audit password-expiration
Fri Oct 14 2022 UTC 03:04:43.674
Password expiration not configured for this user

4. Switch to root to fetch user list. Confirm user 'audit' ID and its existence.

root@nsx-mngr-01:~# cat /etc/passwd | grep audit
audit:x:10002:10002::/home/audit:/opt/vmware/nsx-cli/bin/scripts/nsxcli_passwd

root@nsx-mngr-01:~# chage -l audit
Last password change                                    : Oct 14, 2022
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

5. Delete user 'audit' using NSX manager root shell.

root@nsx-mngr-01:~# userdel audit

6. Validate user 'audit' existence.

root@nsx-mngr-01:~# cat /etc/passwd | grep audit

root@nsx-mngr-01:~# chage -l audit
chage: user 'audit' does not exist in /etc/passwd

7. User 'audit' no longer exists under NSX UI > System > User Settings > Local Users.

8. Run admin CLI commands for user 'audit'. Reported error can now be seen.

root@nsx-mngr-01:~# su admin -c get user audit status
Fri Oct 14 2022 UTC 03:48:20.854
% Invalid value for argument <username>: audit

root@nsx-mngr-01:~# su admin -c get user audit password-expiration
Fri Oct 14 2022 UTC 03:48:52.593
% Invalid value for argument <username>: audit

root@nsx-mngr-01:~# su admin -c get user audit ssh-keys
Fri Oct 14 2022 UTC 03:52:12.098
% Invalid value for argument <username>: audit


No additional users can be created. We cannot delete the default users, only deactivate the audit and guest user accounts.

Even if we deactivate user "audit" from NSX UI > System > User Settings > Local Users, user "audit" will still be listed as local user in NSX UI but as "Not activated ", until we would use "userdel audit" to delete user audit form root bash shell.

Only when you would have used "userdel audit" to delete user audit form root bash shell, you will not see user "audit" listed under NSX UI > System > User Settings > Local Users.

Resolution

Deletion of any NSX local node users namely root, admin, audit, guestuser1, guestuser2, including the change of user id is not supported in any release before NSX 4.1.  

In other words, any local node user manual deletion before NSX 4.1 version is not recommended and might have a side-effect on the working of appliance. 
Without all local node users in system, no feature related to node user management will work; whether it would be changing password expiry warning or changing the passwords or any other.
NSX requires all the node local users to be present in appliance all the times for node management APIs i.e. /api/v1/node/users/... [PUT|POST...] to work.

If the Linux utility command 'userdel' was used to delete the local node user/users, please open a case with Broadcom Support referencing this article.

Creating and managing Broadcom support cases

Additional Information

Command to check NSX local node user :

From NSX root shell, execute the below command which will later prompt credentials for user 'admin'.

root@NSX_Manager:~# curl -k -H "Content-Type:application/json" -u admin -X GET https://localhost/api/v1/node/users