nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
871 stars 265 forks source link

[BUG] IO Error: Broken pipe #4976

Open alessandervs opened 2 years ago

alessandervs commented 2 years ago

I'm running version 3.9.1_b263 from Docker Container and for each 'polling' a ERROR log is generate. [2022-01-20 11:15:00,002] ERROR (com.mirth.connect.connectors.jdbc.DatabaseReceiverQuery:207): An error occurred while polling for messages, retrying after 10000 ms... java.sql.SQLRecoverableException: IO Error: Broken pipe at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:932) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:933) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1082) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3780) at oracle.jdbc.driver.T4CPreparedStatement.executeInternal(T4CPreparedStatement.java:1343) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3822) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1165) at com.mirth.connect.connectors.jdbc.DatabaseReceiverQuery.poll(DatabaseReceiverQuery.java:190) at com.mirth.connect.connectors.jdbc.DatabaseReceiver.poll(DatabaseReceiver.java:134) at com.mirth.connect.donkey.server.channel.PollConnectorJob.execute(PollConnectorJob.java:49) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)Caused by: java.io.IOException: Broken pipe at java.base/sun.nio.ch.FileDispatcherImpl.write0(Native Method) at java.base/sun.nio.ch.SocketDispatcher.write(Unknown Source) at java.base/sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source) at java.base/sun.nio.ch.IOUtil.write(Unknown Source) at java.base/sun.nio.ch.IOUtil.write(Unknown Source) at java.base/sun.nio.ch.SocketChannelImpl.write(Unknown Source) at oracle.net.nt.TimeoutSocketChannel.write(TimeoutSocketChannel.java:215) at oracle.net.ns.NIOPacket.writeToSocketChannel(NIOPacket.java:211) at oracle.net.ns.NIONSDataChannel.writeDataToSocketChannel(NIONSDataChannel.java:181) at oracle.net.ns.NIONSDataChannel.writeDataToSocketChannel(NIONSDataChannel.java:132) at oracle.jdbc.driver.T4CMAREngineNIO.prepareForReading(T4CMAREngineNIO.java:96) at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:534) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:485) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:226) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:59) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:910) ... 11 more

To Reproduce Setup: Database reader: oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@db_hostname:1521/db_name

Database writer: com.mysql.cj.jdbc.Driver jdbc:mysql://domain_name.com.br/db_name?enabledTLSProtocols=TLSv1.2

Screenshots image

image

image

Environment :

Workaround(s) Are there one or more workarounds for this issue currently? No

pacmano1 commented 2 years ago

The error is complaining about the source DB reader. Can you post the full SQL for the DB reader? I think that error is normally due to connectivity problems however.

jonbartels commented 2 years ago

I agree that this is a timeout or connectivity issue.

  1. How long does the reader query take to run from a regular DB console?
  2. Aggregate results is set to "no". How long does it take from the first message in a batch from one SQL SELECT to the message in the batch when it fails?
  3. Do you have a post-process SQL statement?
  4. Does the Oracle JDBC driver accept properties to set an explicit timeout? Add those properties and set a longer timeout.
  5. If your workflow supports it, turn on destination queuing so the DB reader can dump messages into the queue. Think about this carefully since it relates to the post-process SQL, once a message is queued on the destination the source will consider it "sent" and run the post-process SQL.
  6. If your workflow supports it, consider setting aggregate results to "yes". This will read all rows as ONE message instead of many messages. You can then loop through those and do DB Inserts in JS or split the large message apart and send it to another channel to insert to mysql
alessandervs commented 2 years ago

The error is complaining about the source DB reader. Can you post the full SQL for the DB reader? I think that error is normally due to connectivity problems however.

SELECT CD_CLASSIF_SETOR,DS_SETOR_ATENDIMENTO, NR_UNIDADES_SETOR, NR_UNIDADES_OCUPADAS, NR_UNIDADES_TEMPORARIAS, NR_UNID_OCUP, NR_UNIDADES_RESERVADAS, NR_UNIDADES_RESERVA, NR_UNIDADES_HIGIENIZACAO, NR_UNIDADES_LIVRES, NR_UNID_TEMP_OCUP, QT_UNIDADE_ACOMP, QT_UNIDADE_SAIDA_INTER, QT_UNIDADES_ISOLAMENTO, NR_UNIDADES_INTERDITADAS, QT_UNIDADES_ALTA, QT_UNIDADE_CHAMAD_MANUT, QT_UNIDADE_MANUTENCAO, QT_OCUPADAS, QT_LIVRES, QT_LIVRES_SEM_TEMP, NR_UNIDADES_NORMAIS, NR_UNID_TOT_TEMP, PR_OCUPACAO, PR_OCUPACAO_ACOMP, PR_OCUPACAO_TOTAL, TOTALXXX, PR_OLF, PR_OHR, QT_PAC_ISOLADO, NR_UNIDADES_TOT_INT, NR_SEQ_APRESENTACAO, QT_SETOR_FIXO_LIVRE, NR_UNID_AGUARD_HIGIEN FROM tasy.HMDCC_APP_TOTAL_OCUPACAO_V2

jonbartels commented 2 years ago

How many rows is that query returning?

MichaelLeeHobbs commented 2 years ago

You will also see this if the network is restarted on the host of the container ie systemctl restart network

cturczynskyj commented 2 years ago

Are you sure the Oracle database is accessible using the JDBC connection string and credentials you are using? For example, are you able to see the database tables and schema when you hit the "Select" button and get tables (you may need to put '*' in the search)?