function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Dave Silva 10Dave Silva 10 

Trailhead: INVALID_SESSION_ID

I'm getting the following error when checking the hands-on Global Quick Action challenge:

"There was an unhandled exception. Please reference ID: SAKVUFFZ. Error: Restforce::UnauthorizedError. Message: INVALID_SESSION_ID: Session expired or invalid"

​Any ideas what might be causing this?
Mansi RaoMansi Rao
Error Handling

The API calls return error data that your client application can use to identify and resolve runtime errors. If an error occurs during the invocation of most API calls, then the API provides the following types of error handling:

For errors resulting from badly formed messages, failed authentication, or similar problems, the API returns a SOAP fault message with an associated ExceptionCode.
For most calls, if the error occurs because of a problem specific to the query, the API returns an Error. For example, if a create() request contains more than 200 objects.

Error Handling for Session Expiration

When you sign on via the login() call, a new client session begins and a corresponding unique session ID is generated. Sessions expire automatically after a predetermined length of inactivity, which can be configured in Salesforce from Setup by clicking Security Controls. The default is 120 minutes (two hours). If you make an API call, the inactivity timer is reset to zero.

When your session expires, the exception code INVALID_SESSION_ID is returned. If this happens, you must invoke the login() call again.
Dave Silva 10Dave Silva 10
Hi Mansi, it has been over a day now and I'm still getting the same error. If it was a session error, shouldn't it eventually go away?
I've since logged out and logged back in again but I'm still getting the error.