Org postgresql util psqlexception an i o error occurred while sending to the backend

Please read https://stackoverflow.com/help/minimal-reproducible-example Describe the issue Sorry I was not able to provide a minimal reproducible example for now, might need some triage information...

Please read https://stackoverflow.com/help/minimal-reproducible-example

Describe the issue
Sorry I was not able to provide a minimal reproducible example for now, might need some triage information to help me narrow down the issue. This error happen during a very complicated transaction, the callstack:

org.postgresql.util.PSQLException: An I/O error occurred while sending to the backend.
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:349)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
        at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
        at io.agroal.pool.wrapper.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:78)
......

I was executing a very large query, basicaly select * from mytable where id in (?,?,?........) where there’re about 40k ids to query. So I suspect this is related to the query size (sending too much data or receiving to much data), I see this error when my query size go above 30k~40k, is there any limitation regarding query size? But I thought I should be able to get a specific exception saying which limitation is exceeded if there’s such hard limit, so I’m quite confused. Could you pls provide me some triage information so that I think I should be able to narrow it down and provide a minimal reproduce.

Driver Version?
42.2.23
Java Version?

openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08)
OpenJDK 64-Bit Server VM GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08, mixed mode, sharing)

OS Version?

Linux sd-dub-527ca2 5.4.0-86-generic #97~18.04.1-Ubuntu SMP Sat Sep 18 03:11:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

PostgreSQL Version?
13
To Reproduce
Steps to reproduce the behaviour:

Expected behaviour
A clear and concise description of what you expected to happen.
And what actually happens

Logs
If possible PostgreSQL logs surrounding the occurrence of the issue
Additionally logs from the driver can be obtained adding

loggerLevel=TRACE&loggerFile=pgjdbc-trace.log 

to the connection string
Using the following template code make sure the bug can be replicated in the driver alone.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Properties;

public class TestNullsFirst {
    public static void main(String []args) throws Exception {


        String url = "jdbc:postgresql://localhost:5432/test";

        Properties props = new Properties();
        props.setProperty("user", "test");
        props.setProperty("password", "test");
        try ( Connection conn = DriverManager.getConnection(url, props) ){
            try ( Statement statement = conn.createStatement() ) {
                try (ResultSet rs = statement.executeQuery( "select lastname from users order by lastname asc nulls first") ){
                    if (rs.next())
                        System.out.println( "Get String: " + rs.getString(1));
                }
            }
        }
    }
}

Hi Team,

We are using PostgreSQL 11 wherein intermittently the below exception is
popping up, causing our application to lose connection with the database.
It isn’t reconnecting until the application is restarted.

org.postgresql.util.PSQLException: An I/O error occurred while sending
to the backend.
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:335)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at
org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:224)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:479)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1506)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException
at org.postgresql.core.PGStream.receiveChar(PGStream.java:308)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1952)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)

We have checked the PostgreSQL logs in detail, however we are unable to
find any significant errors related to this issue.

We have setup HAProxy between our application and DB. So, the requests are
coming to the DB via HAProxy.

PostgresSQL Version : 11

JDBC Version: 42.2.5

All the servers are present in the same region and building.

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Symptoms

Postgres database seems to go up and down, leading to the following exceptions in confluence:

org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:216)
at org.postgresql.jdbc2.AbstractJdbc2Connection.executeTransactionCommand(AbstractJdbc2Connection.java:619)
at org.postgresql.jdbc2.AbstractJdbc2Connection.commit(AbstractJdbc2Connection.java:639)
at org.postgresql.jdbc2.AbstractJdbc2Connection.setAutoCommit(AbstractJdbc2Connection.java:602)
at org.apache.tomcat.dbcp.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:268)
at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:293)
at net.sf.hibernate.transaction.JDBCTransaction.toggleAutoCommit(JDBCTransaction.java:104)
at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:95)
at org.springframework.orm.hibernate.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:526)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:753)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:730)
...
Caused by: java.io.IOException: Stream closed
at sun.nio.cs.StreamEncoder.ensureOpen(StreamEncoder.java:38)
at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:151)
at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:213)
at org.postgresql.core.PGStream.flush(PGStream.java:531)
at org.postgresql.core.v3.QueryExecutorImpl.sendSync(QueryExecutorImpl.java:674)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:189)
... 89 more

Diagnosis

Obtain the Postgres logs. They contain:

2008-06-22 12:40:45 CEST LOG: transaction ID wrap limit is 2147484146, limited by database "postgres"
2008-06-22 12:42:46 CEST LOG: autovacuum: processing database "confluencedb"
2008-06-22 12:43:09 CEST LOG: server process (PID 12352) was terminated by signal 11
2008-06-22 12:43:09 CEST LOG: terminating any other active server processes
2008-06-22 12:43:09 CEST WARNING: terminating connection because of crash of another server process

Cause

Signal 11 indicates that the Postgres database server is crashing due to bad hardware.

Resolution

Move your Postgres database to another server or identify the faulty hardware. Refer to this third party forum for more information: http://www.nabble.com/terminating-connection-because-of-crash-of-another-server-process-td15468324.html


Last modified on Aug 9, 2022

Related content

  • No related content found

Содержание

  1. SQL Error [08006]: An I/O error occurred while sending to the backend. #11391
  2. Comments
  3. System information:
  4. Describe the problem you’re observing:
  5. PSQLException: An I/O error occurred while sending to the backend in large query #2307
  6. Comments
  7. Thread: An I/O error occured while sending to the backend.
  8. An I/O error occured while sending to the backend.
  9. PSQLException: An I/O error occurred while sending to the backend.
  10. Confluence Support
  11. Get started
  12. Knowledge base
  13. Products
  14. Jira Software
  15. Jira Service Management
  16. Jira Work Management
  17. Confluence
  18. Bitbucket
  19. Resources
  20. Documentation
  21. Community
  22. System Status
  23. Suggestions and bugs
  24. Marketplace
  25. Billing and licensing
  26. Viewport
  27. Confluence
  28. Plugin Install Fails — An I/O error occurred while sending to the backend
  29. Related content
  30. Still need help?
  31. Summary
  32. Diagnosis
  33. Cause
  34. Solution

SQL Error [08006]: An I/O error occurred while sending to the backend. #11391

System information:

  • Windows 10 Enterprise 1909
  • DBeaver version 7.3.5

Describe the problem you’re observing:

Not sure exactly what the issue is, but if a Query takes longer than 2 mins I get this error

Error Log:
org.jkiss.dbeaver.model.sql.DBSQLException: SQL Error [08006]: An I/O error occurred while sending to the backend.
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:133)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:509)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$0(SQLQueryJob.java:440)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:168)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:427)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:812)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:3226)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:118)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:168)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:116)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:4516)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
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:335)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.execute(JDBCStatementImpl.java:327)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCStatementImpl.executeStatement(JDBCStatementImpl.java:130)
. 12 more
Caused by: java.io.EOFException
at org.postgresql.core.PGStream.receiveChar(PGStream.java:308)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1952)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
. 20 more

The text was updated successfully, but these errors were encountered:

Источник

PSQLException: An I/O error occurred while sending to the backend in large query #2307

Describe the issue
Sorry I was not able to provide a minimal reproducible example for now, might need some triage information to help me narrow down the issue. This error happen during a very complicated transaction, the callstack:

I was executing a very large query, basicaly select * from mytable where id in (. ) where there’re about 40k ids to query. So I suspect this is related to the query size (sending too much data or receiving to much data), I see this error when my query size go above 30k

40k, is there any limitation regarding query size? But I thought I should be able to get a specific exception saying which limitation is exceeded if there’s such hard limit, so I’m quite confused. Could you pls provide me some triage information so that I think I should be able to narrow it down and provide a minimal reproduce.

Driver Version?
42.2.23
Java Version?

OS Version?

PostgreSQL Version?
13
To Reproduce
Steps to reproduce the behaviour:

Expected behaviour
A clear and concise description of what you expected to happen.
And what actually happens

Logs
If possible PostgreSQL logs surrounding the occurrence of the issue
Additionally logs from the driver can be obtained adding

to the connection string
Using the following template code make sure the bug can be replicated in the driver alone.

The text was updated successfully, but these errors were encountered:

Источник

Thread: An I/O error occured while sending to the backend.

An I/O error occured while sending to the backend.

I am running PostgreSQL version 8.3 with this conf[1].
The Operating System is a GNU/Linux x86_64 Kernel 2.6.28-11-server, Distribution: Ubuntu SMP.
Some sysctl I think it’s important to relate[2]
Memory and Proc information [3].
The log error is [4].
Aditional information:
I am getting this error using glassfish and postgresql: » Caused by: org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.»
Both glassfish and pgsql are localhost. The connection is made using JPA (using localhost to connect)[5].
There’s no firewall filtering or blocking it.
I have other environment but CentOS using the same version of pgsql and glassfish with no errors.
What can it be? No errors in pgsql logs.

[1] — postgresql.conf
data_directory = ‘/var/lib/postgresql/8.3/main’В В В В В В В В
hba_file = ‘/etc/postgresql/8.3/main/pg_hba.conf’В В В В В В
ident_file = ‘/etc/postgresql/8.3/main/pg_ident.conf’В В
external_pid_file = ‘/var/run/postgresql/8.3-main.pid’В В В В В В В В В
В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В В
port = 5432В В В В В В В В В В В В В В В В В В В В В В В В В В В В
max_connections = 500В В В В В В В В В В В В В В В В В В
shared_buffers = 32MBВ В В В В В В В В В В В В В В В В В
max_fsm_pages = 204800В В В В В В В В В В В В В В В В В

log_min_messages = errorВ В В В В В В В В В В В В В В
log_min_error_statement = error
debug_print_parse = off
debug_print_rewritten = off
debug_print_plan = off
debug_pretty_print = off
log_connections = on
log_disconnections = on
log_line_prefix = ‘%t ‘В В В В В В В В В В В В В В В
log_statement = ‘all’В В В В В В В В В В В В В В В В В
datestyle = ‘iso, mdy’
lc_messages = ‘en_US.UTF-8’В В В В В В В В В В В В В В В В В В В В
lc_monetary = ‘en_US.UTF-8’В В В В В В В В В В В В В В В В В В В В
lc_numeric = ‘en_US.UTF-8’В В В В В В В В В В В В В В В В В В В В В
lc_time = ‘en_US.UTF-8’В В В В В В В В В В В В В В В В В В В В В В В В
default_text_search_config = ‘pg_catalog.english’

vm.overcommit_memory = 0
vm.panic_on_oom = 0
vm.oom_kill_allocating_task = 0
vm.oom_dump_tasks = 0
vm.overcommit_ratio = 50
vm.page-cluster = 3
vm.dirty_background_ratio = 40
vm.dirty_ratio = 40
vm.dirty_writeback_centisecs = 500
vm.dirty_expire_centisecs = 3000
vm.nr_pdflush_threads = 2
vm.swappiness = 60
vm.nr_hugepages = 0
vm.hugetlb_shm_group = 0
vm.hugepages_treat_as_movable = 0
vm.nr_overcommit_hugepages = 0
vm.lowmem_reserve_ratio = 256В В 256В В В В 32
vm.drop_caches = 0
vm.min_free_kbytes = 9939
vm.percpu_pagelist_fraction = 0
vm.max_map_count = 65536
vm.laptop_mode = 0
vm.block_dump = 0
vm.vfs_cache_pressure = 100
vm.legacy_va_layout = 0
vm.stat_interval = 1
vm.mmap_min_addr = 65536
kernel.shmmax = 68719476736
kernel.shmmni = 4096

[3] — Proc / Mem Info
Proc 16 cores:
model nameВ В В В В : Intel(R) Xeon(R) CPUВ В В В В В В В В В E5520В @ 2.27GHz
cpu MHzВ В В В В В В В : 2260.929
cache sizeВ В В В В : 8192 KB
flagsВ В В В В В В В В В : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp l
m constant_tsc arch_perfmon pebs bts rep_good xtopology pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 lahf_lm ida tpr_shadow v
nmi flexpriority ept vpid
bogomipsВ В В В В В В : 4521.85
clflush sizeВ В В : 64
cache_alignment : 64
address sizesВ В : 40 bits physical, 48 bits virtual

Mem:
В В В В В В В В В В В В totalВ В В В В В usedВ В В В В В freeВ В В В sharedВ В В buffersВ В В В cached
Mem:В В В В В В 6023960В В В 4969208В В В 1054752В В В В В В В В В 0В В В В 156176В В В 3833340
-/+ buffers/cache:В В В В 979692В В В 5044268
Swap:В В В В В 3903784В В В В В 47752В В В 3856032

Any ideas will be welcome!

Let me know if I need to post more information or if this is not the adequated place for the post.

Источник

PSQLException: An I/O error occurred while sending to the backend.

From: Argha Deep Ghoshal
To: pgsql-general(at)postgresql(dot)org
Subject: PSQLException: An I/O error occurred while sending to the backend.
Date: 2020-07-30 07:56:18
Message-ID: CAPJci=MY99uk3aQG=NkyzuN_QcfVswrYfVE=b_s5bpGws14ZpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

We are using PostgreSQL 11 wherein intermittently the below exception is
popping up, causing our application to lose connection with the database.
It isn’t reconnecting until the application is restarted.

org.postgresql.util.PSQLException: An I/O error occurred while sending
to the backend.
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:335)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
at
org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
at
org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:224)
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:728)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:470)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:316)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:528)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:479)
at
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:810)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1506)
at
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException
at org.postgresql.core.PGStream.receiveChar(PGStream.java:308)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1952)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)

We have checked the PostgreSQL logs in detail, however we are unable to
find any significant errors related to this issue.

We have setup HAProxy between our application and DB. So, the requests are
coming to the DB via HAProxy.

PostgresSQL Version : 11

JDBC Version: 42.2.5

All the servers are present in the same region and building.

Источник

Confluence Support

Get started

Knowledge base

Products

Jira Software

Project and issue tracking

Jira Service Management

Service management and customer support

Jira Work Management

Manage any business project

Confluence

Bitbucket

Git code management

Resources

Documentation

Usage and admin help

Answers, support, and inspiration

System Status

Cloud services health

Suggestions and bugs

Feature suggestions and bug reports

Marketplace

Billing and licensing

Frequently asked questions

Viewport

Confluence

Plugin Install Fails — An I/O error occurred while sending to the backend

Related content

Still need help?

The Atlassian Community is here for you.

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms .

Summary

When trying to install a plugin, the installation fails and shows an I/O error in the application logs.

Diagnosis

When installing a plugin, users will find an unexpected error when close to ending the installation of the plugin. The Atlassian-confluence.log indicates an issue from the DB side when trying to update the information to add the plugin.

To confirm the issue, when checking the database logs, you will find similar log entries:

Cause

This error is caused by the starvation of resources on the database side when trying to update the DB. By not having the necessary memory available to complete the installation steps, the database sends a rollback signal to confluence as an integrity fail-safe action.

Solution

Check database server resources and make sure there are available Memory/CPU to complete the plugin installation.

Источник

I am using Oracle Application Server and PostgreSQL for my application.
When i am calling a procedure it gives me following error. But this happens sometimes not frequently.

I am not able to find out what exactly the problem is.

org.postgresql.util.PSQLException: An I/O error occured while sending to the backend. 
Exception: java.io.IOException: Stream closed 
Stack Trace: 
java.io.IOException: Stream closed 
at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:145) 
at java.io.BufferedInputStream.read(BufferedInputStream.java:239) 
at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:241) 
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1122) 
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175) 
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:392) 
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330) 
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:321) 
at common.Functions.getBrokerValues(Functions.java:186) 
at common.BrokerInfoBean.getBrokerValues(BrokerInfoBean.java:212) 
at _common._Index._jspService(_Index.java:90) 
at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59) 
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416) 
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478) 
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) 
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719) 
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376) 
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870) 
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451) 
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:299) 
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:187) 
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) 
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) 
at java.lang.Thread.run(Thread.java:595) 
End of Stack Trace 

Thanks,

# #java #postgresql #google-cloud-sql

Вопрос:

Окружающая среда

База данных: Облачный SQL(Postgres) на GCP

Приложение: ServiceA (написано на java 8)

Ниже приведен упрощенный фрагмент кода, в котором происходит ошибка:

 for(String id: ids){
   int result = dao.getCountForId(id) // where the error is thrown
   if(result>0){
     ...
   }
}
 

Запрос, отправленный в Postgres:

 SELECT COUNT(*) FROM t WHERE id = ?
 

Выброс ошибки выглядит так, как показано ниже:

 xxxxx.postgres.PostgresRuntimeException: Failed get count for id 7dddfdsfdsewr345234sd.........
xxxx.postgres.PostgresRuntimeException: Failed get result for id ....
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:339) ~[app.jar:?]
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448) ~[app.jar:?]
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369) ~[app.jar:?]
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:153) ~[app.jar:?]
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:103) ~[app.jar:?]
    at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
    at org.postgresql.ds.PGPooledConnection$StatementHandler.invoke(PGPooledConnection.java:428) ~[app.jar:?]
    at com.sun.proxy.$Proxy40.executeQuery(Unknown Source) ~[?:?]
Caused by: java.io.EOFException
    at org.postgresql.core.PGStream.receiveChar(PGStream.java:372) ~[app.jar:?]
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2043) ~[app.jar:?]
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:312) ~[app.jar:?]
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:448) ~[app.jar:?]
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:369) ~[app.jar:?]
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:153) ~[app.jar:?]
    at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:103) ~[app.jar:?]
    at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171]
    at org.postgresql.ds.PGPooledConnection$StatementHandler.invoke(PGPooledConnection.java:428) ~[app.jar:?]
 

Эта ошибка произошла в производстве, когда количество идентификаторов было большим. Но я не могу реплицироваться в тестовой или локальной среде.

Попытки

Я думал, что причиной ошибки было много запросов, выданных из-за больших идентификаторов массивов, что привело к насыщению пулов соединений Postgres. Для проверки этой гипотезы я создал интеграционный тест, который насыщает пул соединений множеством запросов, как показано ниже(упрощенная версия):

 //FILE_PATH contains the input and expected output for the test
  @Test
    @FileParameters(value = FILE_PATH)
    public test(String taskId, int expected){
        int result = dao.getCountForId(id) 
        Assert.assertEquals(expected,result);
    }
 

Ошибка из насыщенного пула соединений с большим количеством запросов выглядит так, как показано ниже:

 org.postgresql.util.PSQLException: FATAL: sorry, too many clients already
    at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:525) ~[postgresql-42.2.14.jar:42.2.14]
    at org.postgresql.core.v3.ConnectionFactoryImpl.tryConnect(ConnectionFactoryImpl.java:146) ~[postgresql-42.2.14.jar:42.2.14]
    at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:197) ~[postgresql-42.2.14.jar:42.2.14]
    at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49) ~[postgresql-42.2.14.jar:42.2.14]
    at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:217) ~[postgresql-42.2.14.jar:42.2.14]
    at org.postgresql.Driver.makeConnection(Driver.java:458) ~[postgresql-42.2.14.jar:42.2.14]
    at org.postgresql.Driver.connect(Driver.java:260) ~[postgresql-42.2.14.jar:42.2.14]
    at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[?:1.8.0_282]
    at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[?:1.8.0_282]
    at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:98) ~[postgresql-42.2.14.jar:42.2.14]
    at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:83) ~[postgresql-42.2.14.jar:42.2.14]
 

Я ищу в журналах GCP ошибку org.PostgreSQL.util.PSQLException: FATAL: sorry, too many clients already , но не нашел никаких записей. Похоже, что эта ошибка не возникает.

Я буду признателен за любую помощь или рекомендации в решении этой проблемы.

С наилучшими пожеланиями, Рэндо.

Комментарии:

1. Найдите соответствующее сообщение об ошибке в файле журнала сервера для первой ошибки. Что касается второй ошибки, которую вы не найдете org.PostgreSQL.util.PSQLException в журнале сервера, то это украшение, добавленное клиентом.

2. Первая строка ошибки выглядит так, как показано ниже: io.dexi.postgres.PostgresRuntimeException: Failed get count for id 7dddfdsfdsewr345234sd

org.postgresql.util.PSQLException: An I/O error occured while sending to the backend.

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:281)

at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)

at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:331)

at com.spy2k3.core.business.processor.ProcessorImpl.executeUpdate(ProcessorImpl.java:237)

at com.spy2k3.core.business.object.BusinessObject.executeUpdate(BusinessObject.java:54)

at com.spy2k3.core.business.object.LoginObject.deleteSession(LoginObject.java:127)

at com.spy2k3.core.business.processor.LoginProcessor.userValidation(LoginProcessor.java:79)

at com.spy2k3.core.business.processor.LoginProcessor.execute(LoginProcessor.java:30)

at com.spy2k3.core.business.processor.ProcessorImpl.process(ProcessorImpl.java:73)

at com.spy2k3.core.handler.request.RequestHandler.doService(RequestHandler.java:90)

at com.spy2k3.core.handler.AbstractHandler.doPost(AbstractHandler.java:25)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)

at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)

at java.lang.Thread.run(Thread.java:662)

Caused by: java.net.SocketException: Socket closed

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.read(SocketInputStream.java:129)

at org.postgresql.core.VisibleBufferedInputStream.readMore(VisibleBufferedInputStream.java:143)

at org.postgresql.core.VisibleBufferedInputStream.ensureBytes(VisibleBufferedInputStream.java:112)

at org.postgresql.core.VisibleBufferedInputStream.read(VisibleBufferedInputStream.java:71)

at org.postgresql.core.PGStream.ReceiveChar(PGStream.java:269)

at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1700)

at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)

… 37 more

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Org hibernate tool schema spi commandacceptanceexception error executing ddl
  • Org freedesktop dbus error noreply message recipient disconnected from message bus without replying
  • Org apache maven plugins ошибка
  • Orensot ошибка 28
  • Ore плита ошибка el

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии