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
rocksoccerrocksoccer 

Problems with uploading file to Document with partner API

I get the error after I start uploading a file.

 

By checking the connection with Salesforce server, I see that almost every connection will send out about 190~210kb data, and then it will stop. After the timeout time, the connection disappears and the error codes below are given.

 

I have been able to upload the file about 1 one week ago. And then since April 7, I found I could not upload. If I try to upload the file for a few times, I cannot log in at all, but that will be unlock in about 20 min.

 

I also try uploading from my account page, it sometimes gives me some timeout errors too. Are there any problems with your server? Or you change some file limit on the developer accounts.

 

I am in UK, does it matter where I am located?

 

My app needs to upload the files to document, the size of the files are usually between 300kb and 3mb.

 

Any help will be appreciated! Thanks

 

 

 

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host
。. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
。

   at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags)

   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)

   --- End of inner exception stack trace ---

   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)

   at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)

   at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)

   at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)

   at System.Net.Connection.Write(ScatterGatherBuffers writeBuffer)

   at System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream, Boolean suppressWrite)

   --- End of inner exception stack trace ---

   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)

   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)

   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

 

 

tf_ianrtf_ianr

I'm getting similar errors with the Enterprise API, and just sending batches of normal data.

 

 

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.Connection.Write(ScatterGatherBuffers writeBuffer)
   at System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream, Boolean suppressWrite)
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
   at System.Net.Sockets.Socket.MultipleSend(BufferOffsetSize[] buffers, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.TlsStream.MultipleWrite(BufferOffsetSize[] buffers)
   at System.Net.Connection.Write(ScatterGatherBuffers writeBuffer)
   at System.Net.ConnectStream.ResubmitWrite(ConnectStream oldStream, Boolean suppressWrite)
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

 

I suspect its something to do with firewalls on the network (its a network thats run by a third party) ... I'm looking into it ...

 

PatxiPatxi

I have exactly the same problem using Enterprise API and C#. What looks odd to me is that it does not happen always, we only face it whenever our integration service is busy sending data to Salesforce.

 

Surfing the web I have found some similar cases in which they suggest modifying References.cs automatically generated by Visual Studio. I do not know, I do not feel comfortable modifying an automatically generated stuff, I think there can be a problem that should be solved by SFDC.

 

Has anybody found a solution? Thanks in advance.