VMware {code} Community
SreeSindhuSruth
Enthusiast
Enthusiast

vSphere SDK 6.7 - Error with session and client Id

Hi,

We are getting the following error:

[ERROR] p-bio-127.0.0.1-9090-exec-10 70000542 100001 ###### com.vmware.vise.util.session.SessionUtil                          Tried to associate a session to an invalid clientId. (sessionId 100001, clientId null, the actual clientId is not null, the new clientId doesn't exist (no history data available))

[2019-04-24T17:41:48.532-04:00] [ERROR] p-bio-127.0.0.1-9090-exec-10 70000542 100001 ###### com.vmware.vise.messaging.remoting.JavaAdapterEx                  The clientId is invalid. This is probably because a different session associated with the clientId has expired or logged out. destination = userSessionServiceInternal, operation = ping, messageId = 2CEB4783-25AE-5F4B-66F0-514C2F88AAB7

[2019-04-24T17:41:48.551-04:00] [INFO ] tp-bio-127.0.0.1-9090-exec-8 70000543 100046 ###### org.springframework.flex.servlet.MessageBrokerHandlerAdapter      Channel endpoint amf received request.

[2019-04-24T17:41:48.551-04:00] [ERROR] tp-bio-127.0.0.1-9090-exec-8 70000543 100046 ###### com.vmware.vise.util.session.SessionUtil                          Tried to associate a session to an invalid clientId. (sessionId 100046, clientId null, the actual clientId is not null, the new clientId doesn't exist (no history data available))

[2019-04-24T17:41:48.551-04:00] [ERROR] tp-bio-127.0.0.1-9090-exec-8 70000543 100046 ###### com.vmware.vise.messaging.remoting.JavaAdapterEx                  The clientId is invalid. This is probably because a different session associated with the clientId has expired or logged out. destination = userSessionServiceInternal, operation = sessionPing, messageId = E4C041E9-D223-ACD3-4B42-514C2F892B4D

Please let us know on this.

Reply
0 Kudos
7 Replies
Plam_Dimitrov
VMware Employee
VMware Employee

Hi,

It seems that the clientId was destroyed or it never existed.

Can you please describe the steps you took to get to this error?

How does this manifest in the UI? Does it imapct the work of your plugin?

Did that start happening when you upgrade to vSphere SDK 6.7, i.e. was this reproducible on earlier versions? Is it happening only on the Flex client?

Also, sending us the vsphere_client_virgo.log will be helpful.

Regards,

Plam

Reply
0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

Hi Plam,

We are getting this error when we call certain logic in a for loop

In our existing  code there is this line of code inside the for loop

vimPort.logout(serviceContent.getSessionManager());

Can this be the cause of the error we are seeing.

The impact of this as per our observation is when   (range of for loop increases ) we see some errors  inside the code with in the loop which affects the behaviour of the application.

We have observed some issues with 6.7 in flex. However if this is due to the explicit logout then the environment is not an issue.

Please let us know if my analysis is right.

Reply
0 Kudos
Plam_Dimitrov
VMware Employee
VMware Employee

Hello,

It is unlikely to be related. The logs indicate that the Tomcat (Virgo) session is invalidated. Here, you are logging out from the vCenter (thus destroying the session between your plugin and the vCenter). Are you maybe destroying the tomcat session as well (i.e. between the browser and your plugin)?

Can you please:

1) Try to comment out the logout code from your plugin and see if the error persists.

2) Tell us how you login in the VCs (e.g. loginByToken)

3) Try your plugin on the H5 client, if possible, and see if it works.

Also, the vsphere_client_virgo.log may help us figure out what's causing the issue.

Reply
0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

Hi Plam,

Attached virgo logs.

We login using login() method.

As per my understanding this error doesn't depend on flex/html client. So didn't try that one.

Before we remove the logout code and check we would like to understand on the session active duration and how to keep the session alive.

Every time we execute block of code we invoke login() and then execute the logic and then do logout().

vimPort.login(serviceContent.getSessionManager(), credentials.getUsername(),

  credentials.getPassword(), null);

Reply
0 Kudos
LokeshN
Contributor
Contributor

Hi,<br>

From the logs I could see that Caused by: com.vmware.vise.vim.commons.security.NotAuthenticatedError: The session is not authenticated. for the web client. The default session timeout for the client is set to 120 minutes. <br>Also, vimport.logout() which logs out from a vCenter should not have an impact on tomcat Virgo session getting invalidated.

Reply
0 Kudos
SreeSindhuSruth
Enthusiast
Enthusiast

Can you suggest how do we fix this so that we won't get session unauthenticated as it impacts piece of code when we call some VMware apis.

Reply
0 Kudos
LokeshN
Contributor
Contributor

Hi,

As suggested by Plam, can you try the following

1) Try to comment out the logout code from your plugin and see if the error persists.

2) Try your plugin on the H5 client, if possible, and see if it works.

Thanks

Reply
0 Kudos