Help Center> GaussDB(DWS)> Troubleshooting> Database Connections> Error "An I/O error occurred while sending to the backend" Is Reported During Service Execution
Updated on 2024-01-25 GMT+08:00

Error "An I/O error occurred while sending to the backend" Is Reported During Service Execution

Symptom

Error "An I/O error occurred while sending to the backend" is reported during service execution on a client connected to GaussDB(DWS).

Possible Causes

The client is disconnected from the database. The disconnection may be one of the following two cases:

  • Disconnected at the database side.

    After the database is disconnected, if there are applications depend on the connection running, this error will be reported. The possible causes are as follows:

    1. The CN process restarts unexpectedly.
    2. The session times out.
    3. A user manually runs a command to terminate the session.
  • Disconnected at the client side.

Handling Procedure

If the disconnection occurs at the database side. The handling methods corresponding to the preceding causes are as follows:

  1. Run the following command to check whether the CN process restarts unexpectedly:
    1
    ps -eo pid,lstart,etime,cmd | grep coo
    

    If the connection exists before the CN process is started, the connection will be disconnected after the CN process is restarted. If the service side continues to use the connection, an error is reported.

  2. The parameter session_timeout is set. The default value is 10 minutes. The value 0 indicates that timeout is disabled. When the session time exceeds the value of this parameter, the database automatically clears the connection. In scenarios that require long time connections. You can set session_timeout to the expected duration on the client. For details, see JDBC Error Occurs Due to session_timeout Settings.
  3. Check whether CN logs contain "due to".

    Check whether a user manually runs the select pg_terminate_backend(pid); command to terminate the session based on the corresponding time in the log. In most cases, the session is terminated due to user operations.

    1
    ERROR: dn_6003_6004: abort transaction due to concurrent update test 289502.
    
    1
    FATAL: terminating connection due to administrator command
    

If the disconnection occurs at the client side:

If the disconnection is not at the database side, it may be at the client side.

  1. Check whether the timeout parameter socketTimeout is set on the client. If yes, set this parameter to a proper value.
  2. Check whether the disconnection is caused by network problems.