The below error is received in the logs intermittently while using the Salesforce Connector in Mule 4.
08:54:11.313 03/29/2021 Worker-0 [MuleRuntime].uber.540: [api-sf-].get:\all.BLOCKING @123456 WARN
event:cccccc-abcdef-34567-12345-aaa Couldn't execute action over partner client because an unexpected error has occurred. An exception will be thrown.
[UnexpectedErrorFault [ApiFault exceptionCode='INVALID_SESSION_ID'
exceptionMessage='Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: ABCDEFG+=
This error usually occurs after a session expires or a user logs out. Decoder: DataInDbSessionKeyDecoder'
extendedErrorDetails='{[0]}'
]
]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:721)
at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:593)
at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:250)
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:224)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:163)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:108)
at com.sforce.soap.partner.PartnerConnection.query(PartnerConnection.java:1196)
at org.mule.extension.salesforce.internal.service.CoreServiceImpl.lambda$query$27(CoreServiceImpl.java:541)
Salesforce by default sets all organizations to log out of the sessions after 2 hours. However, there are a few issues on the Mulesoft side that have this same stack trace. Here is a list:
9.x:
When using the SFDC Connector the session is timing out
OAuth 2.0:
"Invalid Session ID" Error with OAuth 2.0 connection to Salesforce
MuleSoft side:
Mule generic docs link
Salesforce Connector docs link
Here is a screenshot of configuring this on the Salesforce connector.
Please note that after applying the Reconnection Strategy, you might continue to receive the warning but the connector will perform a reconnection so there would be no impact on the flow.
Salesforce side:
**Warning: These changes will take effect org-wide. Please test this out on a lower environment first.
1. Login to your Salesforce organization.
2. Under "Setup", search for "Session Settings".
3. Uncheck the option "Force logout on session timeout" and set the "Timeout Value" to 24 hours:
4. Click "Save".
001121547

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.