API Call: Error 'Login session for sessionId=websxxx not

Posted by Rollbase User on 10-Jan-2012 04:08

We frequently encounter this error: Error 'Login session for sessionId=websxxxxxxxxxxxxxxxxx not found' even after calling the Rollbase.LogIn() method. This is a snippet of the code. responseValid = False While Not responseValid Try returnValue = _rb.selectQuery(session, query, maxRows) responseValid = True Catch ex As Exception retries += 1 Threading.Thread.Sleep(1000) DoLogIn() If retries > errorTolerance Then Throw End If End Try End While Due to API problems with Rollbase, this is an aggressive code and WILL NOT exit until Rollbase gives a valid response or the threshold has been reached, whichever comes first. The DoLogIn function performs: _session = _rb.login(username, password) where _rb is the Rollbase instance. Please help. This is an inconsistent error as following the code above performs

All Replies

Posted by Admin on 10-Jan-2012 11:49

1. I don't see where and how you call DoLogin from your snippet code.



2. I would recommend simple combination of calls:

login

selectQuery

logout

Posted by Admin on 10-Jan-2012 19:54

I apologize. Before this function is called, DoLogin has been called once. It tries to SelectQuery but Rollbase reports that the Session is not found. That's why we have Try...Catch block. In this case, the Catch block catches the error, and tries to log in again. It loops back and tries the select once more. However, the same error persists. It tries this up to 10 times (threshold) and gives up, finally Throwing the error.

Posted by Admin on 10-Jan-2012 21:21

I suggest you do some printout to verify that you're using correct session ID.

Posted by Admin on 10-Jan-2012 23:25

Ok. will post if anything comes up. Thanks!

Posted by Admin on 18-Jan-2012 06:11

Upon checking the variables, the session ID returned by Rollbase is used on the API call, and yet Rollbase still refuses the recognize that the session is a valid one.

Posted by Admin on 18-Jan-2012 11:54

Please check log file(s) to find out more.

Posted by Admin on 25-Jan-2012 00:33

We do not have access to log files.

However, we tried to create a simple program that retrieves data from rollbase that triggers the error.



1. Login using a correct username and password combination. The session is returned by Rollbase. The session is saved on a variable to be later used.



2. The program does some work, which is initializing variables and formulating a select query for rollbase



3. A SelectQuery is called, passing the session obtained on step 1 on the session parameter. However, Rollbase triggers an error indicating that the session is not found.







Without actually calling the Login method once again, the operation fails. Calling the Login function increases the API calls and sometimes tie up our Rollbase instance, rendering the server

Posted by Admin on 25-Jan-2012 00:48

If you're Rollbase.com customer please submit support request and I'll take a look at your logs.



If you're Private Cloud customer please use Master Zone > Customer View page > View logs to check log files.



Are you able to run calls other than SelectQuery ?



Posted by Admin on 25-Jan-2012 00:54

It is not clear why you're having API issues, but it may be a good idea to use REST API instead - it may be simpler and more transparent.

Posted by Admin on 25-Jan-2012 03:53

Hi Pavel, thank you for the reply. Yes we are able use the Update and Logout functions as well. It is not clear or there is no definite pattern on when Rollbase expires our session. We are using a Private Cloud and will try to request the log files you are asking for.



About the REST API, we will look into the method, as we have to have additional development time to adjust to the new API.



One again, thank you

Posted by Admin on 25-Jan-2012 11:47

Your error message does not say that session is expired - it says that session not found. That means that there is no record in DB with session ID provided.



Sessions for Web API obeys the same expiration rules as regular UI sessions and depend on Security Level.



Is is possible that another API client logs in with the same credentials? That would kick out currently opened session.



Anyway I will add link to log file on Application Setup > Web API page.



In the mean time check user's Login History - this should include API login records as well.

Posted by Admin on 25-Jan-2012 11:49

It is a good idea to login, perform operations, than logout. Do you follow this pattern?

This thread is closed