"Unable to authenticate. Try again." error while logging into VAMI despite credentials being correct
search cancel

"Unable to authenticate. Try again." error while logging into VAMI despite credentials being correct

book

Article ID: 315403

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • When Logging into the VAMI using the correct credentials, the UI displays the error
"Unable to authenticate. Try again.".
  • In the /var/log/vmware/applmgmt/vami.log, you may see messages similar to:
2017-03-21T09:20:38.080 [36425]ERROR:session_management:Session Available check failed: 
No JSON object could be decoded Traceback (most recent call last):
File "/opt/vmware/share/htdocs/vami/backend/session_management.py", line 113, in sessionsAvailable 
cls.expiredSession(ConfigManager(f))):   
File "/usr/lib/applmgmt/base/py/vmware/vherd/base/config_manager.py", line 25, in __init__    
object_hook=lambda d: defaultdict(ConfigManager.defaultFactory,d))   
File "/usr/lib/python2.7/json/__init__.py", line 291, in load     **kw)   
File "/usr/lib/python2.7/json/__init__.py", line 352, in loads     return cls(encoding=encoding, **kw).decode(s)   
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode     obj, end = self.raw_decode(s, idx=_w(s, 0).end())   
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode     raise ValueError("No JSON object could be decoded") 
ValueError: No JSON object could be decoded

Note: The preceding log excerpts are only examples. Date, time, and environmental variables may vary depending on your environment.


Environment

VMware vCenter Server 7.0.x
VMware vCenter Server Appliance 6.7.x
VMware vCenter Server Appliance 6.5.x

Cause

The issue occurs when any of the files in the directory (/var/vmware/applmgmt/session/) is not a valid JSON string.

The VAMI uses the Python script session_management.py to manage the user sessions. For each session, a file with a UUID as the name is created that contains the username, csrfToken, startTime, and lastaccessTime. For each login attempt, all of these files are opened and parsed. If a parse error is thrown, the login fails.

Resolution

To resolve this issue:
  1. Create a full backup of the vCenter Server Appliance (do not skip this step!)
  2. Launch an SSH session onto the Appliance.
  3. Run the following commands:
    # cd /var/vmware/applmgmt
    # mv session/ session.bak/
    #
    mkdir session
  4. Attempt logging into the VAMI


Additional Information

VCSA patching succeeded but failed to update the VAMI build (Unexpected content in /etc/issue file)