"The connection is broken and recovery is not possible" after MSSQL reboot

Hi all !
I use a jdbc input plugin to get MS SQL data. Everything works fine, but when my SQL server reboots for maintenance, the queries don't work anymore, and I have the following error:

[ERROR][logstash.inputs.jdbc ] Java::ComMicrosoftSqlserverJdbc::SQLServerException: The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.: sql query here

I have this message everytime the query is executed. The only way to retrieve my connection is to restart logstash service.
I tried several parameters, just as:

       use_column_value => true
       tracking_column => "id"
       tracking_column_type => "numeric"

clean_run => true

connection_retry_attempts => 0

and all of them in one configuration.

I don't know how to deal with this error, and I can't find a lot of mention of it. Do you have some solution?

I believe there are two levels of connection retries. One in the JDBC driver, which will retry once after 10 seconds. I think that "recovery is not possible" exception is returned if that fails. There is another level of retry within the jdbc integration (used by the input), which retries once after 500 milliseconds.

If your SQL server takes more than 10.5 seconds to reboot (which seems likely) then the input will not reconnect. Try increasing connection_retry_attempts_wait_time to 120 or something that will result in the retry happening after the DB server is back up.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.