Jump to content

Error when running Python Data Function in Web Player


Go to solution Solved by David Boot-Olazabal,

Recommended Posts

Posted
Could not execute function call 'Function'
 
Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.
 
 
Server stack trace: 
   at System.Net.Sockets.NetworkStream.BeginMultipleWrite(BufferOffsetSize[] buffers, AsyncCallback callback, Object state)
   at System.Net.Security._SslStream.StartWriting(SplitWritesState splitWrite, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ProcessWrite(BufferOffsetSize[] buffers, SplitWriteAsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.BeginWrite(BufferOffsetSize[] buffers, AsyncCallback asyncCallback, Object asyncState)
   at System.Net.TlsStream.BeginMultipleWrite(BufferOffsetSize[] buffers, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.IO.Compression.DeflateStream.WriteDeflaterOutput(Boolean isAsync)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)
 
Exception rethrown at [0]: 
   at System.Net.ConnectStream.InternalWrite(Boolean async, Byte[] buffer, Int32 offset, Int32 size, AsyncCallback callback, Object state)
   at System.Net.ConnectStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at System.IO.Compression.DeflateStream.WriteDeflaterOutput(Boolean isAsync)
   at System.IO.Compression.DeflateStream.PurgeBuffers(Boolean disposing)
   at System.IO.Compression.DeflateStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at System.IO.Compression.GZipStream.Dispose(Boolean disposing)
   at System.IO.Stream.Close()
   at Spotfire.Dxp.Data.DataFunctions.Executors.RemoteServiceClient.<>c__DisplayClass23_1.<RunFunction>b__1(HttpWebRequest uploadReq)
   at Spotfire.Dxp.Data.DataFunctions.Executors.RemoteServiceClient.<>c__DisplayClass45_0.<ExecuteDirectWebRequestWithRetry>g__RequestApplyFromParameters|0(HttpWebRequest request)
   at Spotfire.Dxp.Services.Http.SpotfireRequest.<>c__DisplayClass15_0.<ExecuteRequestOnSpecificSpotfireServerWithRetry>b__0()
   at Spotfire.Dxp.Services.Http.SpotfireRequest.ExecuteSpotfireServerRequestWithRetry(SpotfirePrincipal principal, ServerInformation server, Func`1 requestCreator, RetryOptions retryOptions)
   at Spotfire.Dxp.Data.DataFunctions.Executors.RemoteServiceClient.RunFunction(DataFunctionInvocation invocation)
   at Spotfire.Dxp.Data.DataFunctions.Executors.PythonScriptExecutor.<ExecuteFunction>d__9.MoveNext()
   at Spotfire.Dxp.Data.DataFunctions.DataFunctionExecutorService.<ExecuteFunction>d__8.MoveNext()

Hello,

I have attached the error I am getting when running Python Data Function in web.

When I run this function on limited number of rows it is working fine. Issue only occurs when I pass huge data to the function for processing. However, in Analyst there are no issues.

May I know what is causing this error? And also how I can solve this?

Thank you.

  • Solution
Posted

Hi Padmini,

Depending on your setup, it could be due to a couple of things, such as:
- available resources;
- is Python service installed on a separate node manager;
- etc.

Assuming you have not yet configured the service (and uses it's default settings), you may want/need to configure your Python service (on the web that is) and try to find a couple of settings that may affect the current error. More information on who to configure the service is found here: https://docs.tibco.com/pub/sf-pysrv/latest/doc/html/TIB_sf-pysrv_install/_shared/install/topics/configuring_the_service.html.


In that same document, you can can find more information the different settings you can edit: https://docs.tibco.com/pub/sf-pysrv/latest/doc/html/TIB_sf-pysrv_install/_shared/install/topics/custom_configuration_properties.html.

Kind regards,

David

  • Like 2
Posted

Hello Padmini!

When a data function is executed in the web client, it typically uses the server's python instance. When a data function is executed in the analyst client, it instead typically uses the local python instance. My guess is that when passing data through the function in the web client and thus the server python instance, it times out the server connection if too much data is passed. You might be able to get around this by forcing the function to use the local python instance instead, but that might not work if the local PC opening the report doesn't have python installed. 

image.png.78caf6b125e17a9dcdcdbbdd3e7bb2ce.png

Outside of doing that, other solutions would be... more difficult to implement. I'm not sure how to prevent the connection from timing out since I don't typically work with server infrastructure. It might be better to either reduce the amount of data that needs to be processed in the data function, optimize the processing of the data, or break up the data into smaller bundles and execute the data function multiple times.

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...