We have a nightly Java process which uses the Force.com API library (which underneath looks to use the SOAP API). The Apex code that this calls uses SendGrid to send emails with status updates to our customers. This usually works without issue, though since Thursday night we've been getting the following error each night when it runs. (And of course there doesn't appear to be anything different on our side that we've changed.)
com.sforce.ws.SoapFaultException: connection was cancelled here Error Id: 96113758-10240 (1804090163) at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:205) ~[force-wsc-28.0.0.jar:na] at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:149) ~[force-wsc-28.0.0.jar:na] at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:98) ~[force-wsc-28.0.0.jar:na] at com.sforce.soap.BatchEmailSender.SoapConnection.clearErrors(SoapConnection.java:172) ~[BatchEmailSender-28.jar:na] (...omitting stacktrace into our proprietary code which just calls the BatchEmailSender apex code...)
Making things more interesting is that when I rerun the same process in the morning, it works fine. This would imply that there isn't a bug in the code or some bad data or something, but that there's some limit being hit or some kind of caching involved, such that it works on the rerun.
The Java exception is reporting a SOAP Fault that Force.com has sent us of "connection was cancelled here", but I can't find much anywhere on what the meaning of that is. In my research I've found another SFSE question which doesn't have an answer and a message on the Salesforce Developer Forums which isn't any more helpful. The most promising lead is another Salesforce Developer forum message that says that it's related to having too much in the Recycle Bin. But it'd be nice to know if that was the issue in this case.
Is there some Force logging of SOAP call errors that could give me a more helpful error message? Is there anything more we can log on the Java side with more details about the exception? How does one go about figuring out why a "connection was cancelled here", wherever "here" may be? Thank you.