Error "Unable to write data to the transport connection" when executing Data Functions in Spotfire

book

Article ID: KB0137358

calendar_today

Updated On:

Products Versions
Spotfire Enterprise Runtime for R - Server Edition 1.17

Description

When executing a Spotfire data function, the following error occurs:
Could not execute function call 'data_function_name'
Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.

This error typically occurs when the data being uploaded to the service exceeds the file size upload limit set in the TERR Service. The default limit is 100MB. When a data function sends data beyond this threshold, the service rejects the request, leading to the error.

Environment

All Supported OS

Resolution

To resolve this issue, increase the file size upload limits by modifying the following properties in the TERR Service configuration:
1. Increase File Upload Limits:
i. spring.servlet.multipart.max-file-size (Default Value:100 MB):
The total file size for upload cannot exceed the value for this setting.

ii. spring.servlet.multipart.max-request-size (Default Value:100 MB):
The total request size for a multipart file upload cannot exceed the value for this setting.

Recommended values:
i. spring.servlet.multipart.max-file-size=1000MB
ii. spring.servlet.multipart.max-request-size=1000MB

If the error persists, consider increasing the limit further (e.g., 1GB)

2. Adjust Execution Timeout Settings:
i. engine.execution.timeout (Default Value:600):
The length of time, in seconds, that the TERR service allows the TERR engine to execute a request before stopping the execution with a timeout error.

ii. engine.session.maxtime (Default Value:1800):
The length of time, in seconds, that the TERR service allows the TERR engine session to exist before killing it.
To disable session pruning, set this value to -1.

Recommended values:
i. engine.execution.timeout=3600
ii. engine.session.maxtime=7200

3. Update the TERR Service Configuration:
i. Export the current TERR service configuration.
ii. Edit the necessary properties in the custom.properties file.
iii. Import the updated configuration back into the TERR service.
iv. Restart the TERR service to apply the changes.
Note: These changes should be made in the TERR Service configuration, not in the Web Player service.

Note: Increasing these thresholds serves as a cap rather than an allocation of resources, meaning it does not inherently slow down or negatively impact the baseline processing speed of the TERR engine, other DXP files, or data functions. For example, a minor data function (such as 5 MB) continues to process only its own data size, completely unaffected by a higher ceiling like 1000 MB.
However, raising this ceiling permits the service to handle much larger files, which temporarily demands more CPU and memory resources while that specific function runs. If the hosting Node Manager for the TERR Service hits its capacity during the parsing of a massive file, concurrent or queued data functions will experience processing delays.

Furthermore, the Release Notes and Known Issues highlight a distinct risk regarding Java Heap Exhaustion:
Note: At a certain point, the Java Heap size fails to handle very large files. The threshold for this behavior is dependent on the amount of RAM Spotfire Service for TERR nodes has. When the Java Heap Size is exceeded, the following error message is displayed: Error from Remote Service: Internal Server Error (500) - java.lang.OutOfMemoryError: Java heap space.

Issue/Introduction

Spotfire TERR Data Function Execution Error.

Could not execute function call 'data_function_name':
Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.

Additional Information