4

We are getting this error:

Caused by: org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:327)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:117)
    ... 18 common frames omitted
Caused by: java.io.EOFException: null
    at org.postgresql.core.PGStream.receiveChar(PGStream.java:290)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1962)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
    ... 22 common frames omitted

The query is a prepared statement with a simple SELECT with 4 arguments. Then executeQuery is called, I get the error above. The error only happens when using stolon, if we use PostgreSQL directly, everything works as expected.

Anyone faced a similar situation?

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
rgomesf
  • 702
  • 1
  • 10
  • 20
  • Look into the PostgreSQL server log, maybe there is a problem. – Laurenz Albe Oct 08 '18 at 13:48
  • No errors/warnings in server log. Also, no errors in jdbc driver log... – rgomesf Oct 10 '18 at 11:41
  • Well, the error seems to indicate that the TCP connection was unexpectedly closed. This could mean that the database server crashed or was shut down (which is why I recommended to consult the log). But it could also mean a network outage or a firewall that cut the connection. – Laurenz Albe Oct 10 '18 at 15:33
  • I think the idle connections are being closed more aggressively by stolon. Didn't find why tho. – rgomesf Oct 18 '18 at 10:08
  • Well, stolon *uses* the JDBC driver, it does not have access to the underlying TCP connections so that it can close them. The problem must be on a lower level. – Laurenz Albe Oct 18 '18 at 10:31

1 Answers1

3

I had the same trace in another context: I fixed it updating the postgresql jdbc driver.

Remy
  • 502
  • 6
  • 19