4

We have an app that connects from one Salesforce org to another Salesforce org. The code has been working perfectly fine for many months. The code connects to another org and gets all the metadata details.

However, we got this error today:

System.CalloutException: Web service callout failed: WebService returned a
SOAP Fault:

  INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session.

Session not found, missing session key: This is expected, it can happen if
the session has expired and swept away, or if the user logs out, or if its
just someone trying to hack in.

What could have changed so that we are getting this error? I am pretty sure that there is nothing wrong in the code.

2
  • If you have an API user, then check if their password has expired. I'm assuming you've already tried to log back in with the current creds -- note that there are no contractual guarantees about how long a session will last, so be prepared to log back in should you get this error. Commented Feb 4, 2015 at 6:33
  • I would suggest to check login History for API User. You might get some idea from there. Make sure , you are hitting the right URL with right credentials. Commented Feb 4, 2015 at 8:17

2 Answers 2

1

Check your credentials. Clear browser cache if calling from browser. Retry with fresh login.

0

One scenario where this error is returned if Lock sessions to the IP address from which they originated is enabled in the session security settings, and the IP from which you logged in is different from the IP from which you are calling the API.

As a workaround, you can turn off the restriction in security settings:

Session Security Settings in Salesforce

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .