Why do MySQL requests fail with the error “Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost”?
book
Article ID: KB0082875
calendar_today
Updated On:
Products
Versions
TIBCO Data Virtualization
7.0.0 and higher
Description
This article discusses reasons for MySQL requests failing to complete, with an error “Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost”.
Issue/Introduction
Why do MySQL requests fail with the error “Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost”?
Resolution
The error message indicates that connections are being closed, either at the TDV (TIBCO Data Virtualization server) end, or at the MySQL server end.
In order to ensure that the TIBCO Data Virtualization server does not close out connections, enter a Connection Validation Query in the Advanced panel of the MySQL data source.
The common reasons that MySQL closes connections at its end are:
Network Connectivity: Connectivity has been lost for a short while due to a temporary network problem. Network Latency: Network connectivity works, but it works slowly. When no traffic arrives over the connection for a long period of time, MySQL considers the connection to be idle and times out the connection. In order to resolve this, increase the connection timeout period in MySQL. The settings net_read_timeout and net_write_timeout control the connection timeout period. Ask your MySQL database administrator to increase the values of these settings.