[resolved] Issue while using tSalesforceInput

Hi all,
i'm using a tSalesforceInput in a job developed few months ago.
This job has been working perfectly until now.
Now sometimes i receive this error on that component.
com.salesforce.soap.partner.UnexpectedErrorFault:INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Session timed out
The point is, why?
My job is very simple, i open a tSalesforceConecction and the component can open a salesforce connection, then i use the tSalesforceInput and i get this error.
My question is: Is talend failing something?
I opened this topic to understand if i have to open a ticket on talend for a bug or you think could be a problem from Salesforce or the connection bandwith on the server in which i deployed my job.
I developed the job with TOS 5.3.1 and linking with Salesforce api version 28.0
Thank you!
1 ACCEPTED SOLUTION

Accepted Solutions

Re: [resolved] Issue while using tSalesforceInput

Finally,
i found a workaround, not a solution.
Salesforce.com uses a token (Session ID), so when Talend wants to communicate with Salesforce.com it needs a token from Salesforce to perform an operation.
I found that in Salesforce tokens generated are not generated for a single use, each token expires after an amount of time you can specify on Salesforce and i think each time a scheduled job starts and wants to communicate with Salesforce, the job uses the same token if it's not expired yet.
My situation: In my salesforce organization, my token was expiring each 2 hours, and my Talend job was starting each 2 hours.
Reading the logs from Talend and from Salesforce i found that each 2 hours Talend was trying to perform a call on Salesforce at the same time Salesforce was expiring that token. (In a range of about 200 milliseconds).
So, sometimes Salesforce was faster than Talend and expired the token before Talend was able to perform the call (and here come the exception i had), sometimes not, and Talend could perform the operation some milliseconds before Salesforce expired its token.
And this would explain also why i was receiving this exception randomly.
My solution: I changed the Salesforce token expiration time and the Talend job schedule time in a way that the situation above should never repeat.
After this change i had no more problems.
I think this is not the best solution but maybe this can help someone with the same problem.
8 REPLIES
Moderator

Re: [resolved] Issue while using tSalesforceInput

Hi Luca.venanzetti,
It seems that you have got the solution for your issue quickly, could you please share it with us?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: [resolved] Issue while using tSalesforceInput

No it's not true, i'm really sorry i opened a lot of times this topic a short while ago and i tried to remove them setting them as resolved but them didn't gone.
So, this topic would not be solved
Sorry again.
Moderator

Re: [resolved] Issue while using tSalesforceInput

Hi,
The issue is random? Is it probably caused by your firewall? Is the Salesforce installed in local or server?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: [resolved] Issue while using tSalesforceInput

Thank you for your answer, the issue is related to a job which has been in a production server for months whitout having problem. Last week the job started firing this exception. The job is scheduled and runs every 2 hours. Sometimes i receive this error (during the day), sometimes not. So if the job runs 8 times in a day, i would receive 3 times this exception.
Moderator

Re: [resolved] Issue while using tSalesforceInput

Hi,
Could you give us more description about your job so that we can address your issue quickly. What scheduler are you using? Is the net working fine?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Re: [resolved] Issue while using tSalesforceInput

Sure.
I put a data integration job exported as .bat in a windows server.
The job runs every two hours using the windows scheduler.
The net yeah i think is working fine, i mean, i checked the connection as first reaction to this problem.
When i received this kind of error i tried immediately to run again (manually) the job double clicking the .bat and job run well.
My job starts a tSalesforceConnection and then i have the tSalesforceInput using this connection and in that component i get this exception.
Since i don't know what other info i can give you i put beneath this the statistics that i'm logging on a database table with the tStatCathcer, maybe this can help you.
moment pid father_pid root_pid system_pid project job job_repository_id job_version context origin message_type message duration
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default NULL end success 52171
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tLogCatcher_1 begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tLogCatcher_1 end success 0
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tFileOutputDelimited_2 end success 16
20/01/2014 10:00 RFHZC0 QM6xRZ QM6xRZ 2984 PARAH_LUCA ZipFileManagerLogs _v8g0ACIAEeONPeIa-Sxaww 0.1 Default tSendMail_1 end success 45921
20/01/2014 10:00 RFHZC0 QM6xRZ QM6xRZ 2984 PARAH_LUCA ZipFileManagerLogs _v8g0ACIAEeONPeIa-Sxaww 0.1 Default NULL end success 48265
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tRunJob_6 end success 48296
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tFileOutputDelimited_2 begin NULL NULL
20/01/2014 10:00 RFHZC0 QM6xRZ QM6xRZ 2984 PARAH_LUCA ZipFileManagerLogs _v8g0ACIAEeONPeIa-Sxaww 0.1 Default tSendMail_1 begin NULL NULL
20/01/2014 10:00 RFHZC0 QM6xRZ QM6xRZ 2984 PARAH_LUCA ZipFileManagerLogs _v8g0ACIAEeONPeIa-Sxaww 0.1 Default tFileArchive_1 end success 2312
20/01/2014 10:00 RFHZC0 QM6xRZ QM6xRZ 2984 PARAH_LUCA ZipFileManagerLogs _v8g0ACIAEeONPeIa-Sxaww 0.1 Default tFileArchive_1 begin NULL NULL
20/01/2014 10:00 RFHZC0 QM6xRZ QM6xRZ 2984 PARAH_LUCA ZipFileManagerLogs _v8g0ACIAEeONPeIa-Sxaww 0.1 Default NULL begin NULL NULL
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default NULL end success 47
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tRunJob_1 end success 94
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tRunJob_6 begin NULL NULL
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_1 end success 15
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_2 end success 15
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default tMSSqlConnection_1 begin NULL NULL
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default tMSSqlConnection_1 end success 0
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_2 begin NULL NULL
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_1 begin NULL NULL
20/01/2014 10:00 t8sadE QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_ErrorManager _TiROcD1_EeO3ceA9m5ayNw 0.1 Default NULL begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tSalesforceInput_1 end failure 3515
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tRunJob_1 begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tMSSqlOutput_1 begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tSalesforceInput_1 begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tMSSqlConnection_2 end success 16
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_3 begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_2 begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_2 end success 0
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tMSSqlRow_3 end success 0
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default tMSSqlConnection_2 begin NULL NULL
20/01/2014 10:00 QM6xRZ QM6xRZ QM6xRZ 2984 PARAH_LUCA OrEnt_SendOrdersToAS400 _fdDa4D1-EeO3ceA9m5ayNw 0.1 Default NULL begin NULL NULL

The exception related to that failure is:
com.salesforce.soap.partner.UnexpectedErrorFault:INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Session timed out
Thank you

Re: [resolved] Issue while using tSalesforceInput

Maybe i can give you a hint.
My Salesforce org which i'm trying to connect with the tSalesforceInput, has a Session Time out set to 2 hours. And my Talend job is scheduled to run every two hours. The gmt time is the same both for Salesforce and the server which is running the talend job.
Last friday my job ran at 8.00, 12.00 and 16.00, but didn't run at 10.00, 14.00 and 18.00.

Re: [resolved] Issue while using tSalesforceInput

Finally,
i found a workaround, not a solution.
Salesforce.com uses a token (Session ID), so when Talend wants to communicate with Salesforce.com it needs a token from Salesforce to perform an operation.
I found that in Salesforce tokens generated are not generated for a single use, each token expires after an amount of time you can specify on Salesforce and i think each time a scheduled job starts and wants to communicate with Salesforce, the job uses the same token if it's not expired yet.
My situation: In my salesforce organization, my token was expiring each 2 hours, and my Talend job was starting each 2 hours.
Reading the logs from Talend and from Salesforce i found that each 2 hours Talend was trying to perform a call on Salesforce at the same time Salesforce was expiring that token. (In a range of about 200 milliseconds).
So, sometimes Salesforce was faster than Talend and expired the token before Talend was able to perform the call (and here come the exception i had), sometimes not, and Talend could perform the operation some milliseconds before Salesforce expired its token.
And this would explain also why i was receiving this exception randomly.
My solution: I changed the Salesforce token expiration time and the Talend job schedule time in a way that the situation above should never repeat.
After this change i had no more problems.
I think this is not the best solution but maybe this can help someone with the same problem.