Skip to main content
NetApp Knowledge Base

"Invalid session id received"error message while running API call

Views:
124
Visibility:
Public
Votes:
0
Category:
fabric-interconnect-and-management-switches
Specialty:
brocade
Last Updated:

Applies to

  • Brocade 
  • SANnav

Issue

  • Post generating the session ID using the login API call, the generated session ID is being used to run the follow up API calls, however an Invalid session id received error message is thrown. 

[root@xxxxxxxx ~]# curl -k -H 'username: ' -H 'password: ' -H 'Content-Type: application/json' -X POST https://10.225.xx.xx/external-api/v1/login/
{"sessionId":"4a84bce3-b086-4df6-b209-fbff6a54bb55"}[root@xxxxxxxx ~]#
[root@xxxxxxxx ~]#
[root@xxxxxxxx ~]# curl -vv -k -H 'Authorization: 4a84bce3-b086-4df6-b209-fbff6a54bb55' -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://10.225.xx.xx/external-api/v1/discovery/fabrics
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying 10.225.xx.xx...
* TCP_NODELAY set
* Connected to 10.225.xx.xx (10.225.xx.xx) port 443 (#0)
* ALPN, offering h2

.

.

.
* Connection #0 to host 10.225.xx.xx left intact
{"code":401,"errorMessage":"UnAuthorizedException","detailedErrorMessage":"Invalid authorization token in the request: {\"ResponseCode\":\"AUTHENTICATION_2017\",\"ResponseId\":\"authentication.sessionvalidation.invalidsessionid\",\"ResponseMessage\":\"Invalid session id received\"}"}
 
 

  • The session ID is associated with the host IP address that performed the initial login.If there is an HTTPS proxy in use, the IP address could change, and the session ID would appear invalid.However, the host is not using a proxy for HTTPS.
  • SANnav logs only has one reference to the IP address:
    authentication-rbac-mw - [INFO ] 2024-04-01 16:45:07.665 [http-nio-12009-exec-3] com.brocade.dcm.authentication.server.controller.AuthenticationController - Login Request from client : 10.1.xx.xx with isGlobal flag: [null]
    authentication-rbac-mw - [INFO ] 2024-04-01 16:45:07.727 [http-nio-12009-exec-3] com.brocade.dcm.authentication.server.controller.AuthenticationController - Authentication successful and sessionId is e947f2c3-d66e-4c01-8655-cd05f129d9e0 for user ROuser, client 10.1.xx.xx
    10.1.42.81 - - [01/Apr/2024:16:45:07 +0530] "POST /external-api/v1/login/ HTTP/2.0" 200 52 "-" "curl/7.61.1"

 

  • If the session ID from this date is known, it should still be usable for subsequent REST commands, or it can be logged out.
  • REST can also be used in session-less mode, which does not use session IDs.
  • Tried session less authentication as well, but  authentication fails with invalid username and password error However, same credentials are working fine through GUI console.

 

All the test logins fail in the same way:

2024-04-23 16:29:51 curl -k -H 'Authorization: Basic ' -H 'Accept: application/json' -H 'Content-Type: application/json' -X GET https://10.225.xx.xx/external-api/v1/discovery/fabrics

SANnav access log:

10.1.xx.xx - ROuser [23/Apr/2024:16:29:51 +0530] "GET /external-api/v1/discovery/fabrics HTTP/2.0" 401 148 "-" "curl/7.61.1"

SANnav authentication log:

authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.550 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.controller.AuthenticationController - Login Request from client : 10.1.xx.xx with isGlobal flag: [null]
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.558 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.controller.AuthenticationController -  Maximum session limit: 25, current session count: 8, current sessionLess count: 0 and  totalSessionCount: 8
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.558 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Primary authentication setting is Local Database and secondary authentication setting is None
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.565 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.LocalDbRealm - Authentication status after verifying using MD5 encryption false
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Done with primary authentication. Auth status: false, fallback status: 0
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Falling back to local authentication false .....?
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Login status for user ROuser after authentication and user role check: false Is locally Authenticated false
authentication-rbac-mw - [INFO ] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Authentication failed for user ROuser status 0 
authentication-rbac-mw - [ERROR] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.shiro.DCMRealmAuthenticator - Authentication failed for user ROuser authType Local Database
authentication-rbac-mw - [ERROR] 2024-04-23 16:29:51.572 [http-nio-12009-exec-17] com.brocade.dcm.authentication.server.controller.AuthenticationController - Login failed! Authentication exception occured for client 10.1.xx.xx
org.apache.shiro.authc.AuthenticationException: Invalid username and password

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.