Logstash does not stop after error connect to database

I have a problem with Logstash. The problem is that Logstash does not stop working, when it has problem with connect to database. I use a input plugin and i have correct configuration (according to documentation), I mean the key:
connection_retry_attempts=>1
Please see full logs:

>  Plugin: <LogStash::Inputs::Jdbc jdbc_driver_library=>"/app/sql/mssql-jdbc-6.2.2.jre8.jar", jdbc_driver_class=>"com.microsoft.sqlserver.jdbc.SQLServerDriver", jdbc_connection_string=>"jdbc:sqlserver://xxxxxxxxxx:1433;database=xxxxxx;user=xxxxxx;password=xxxxxxvxxxxxx;encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;", jdbc_user=>"xxxxx", jdbc_password=><password>, jdbc_fetch_size=>10000, lowercase_column_names=>false, statement_filepath=>"/app/logstash/logstash/../data_import_configs/sql/dm_contacts.sql", add_field=>\{"[@metadata][type]"=>"jdbc_contact_data"}, jdbc_pool_timeout=>120, jdbc_validate_connection=>true, id=>"jdbc_contact_data", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_8f2d43aa-b065-475c-b136-e3f46e4fa136", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validation_timeout=>3600, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>\{"sql_last_value"=>2018-10-18 23:00:43 UTC}, last_run_metadata_path=>"/home/app/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true>
>  Error: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Cannot open server 'xxxxxx' requested by the login. Client with IP address 'xx.xx.xx.xx' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. ClientConnectionId:2621bf8b-e257-4641-a25c-bfaf32161d59
> [2018-10-19T13:07:32,973][WARN ][logstash.inputs.jdbc ] Exception when executing JDBC query \{:exception=>#<Sequel::DatabaseConnectionError: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Cannot open server 'xxxxxx' requested by the login. Client with IP address 'xx.xx.xx.xx' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. ClientConnectionId:e5eb00d1-1d25-4922-906d-9999ffd3bfe5>}
> [2018-10-19T13:07:32,974][WARN ][logstash.inputs.jdbc ] Attempt reconnection.
> [2018-10-19T13:07:33,161][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.
>  Plugin: <LogStash::Inputs::Jdbc jdbc_driver_library=>"/app/sql/mssql-jdbc-6.2.2.jre8.jar", jdbc_driver_class=>"com.microsoft.sqlserver.jdbc.SQLServerDriver", jdbc_connection_string=>"jdbc:sqlserver://xxxxxxxxxx:1433;database=xxxxxx;user=xxxxxx;password=xxxxxxvxxxxxx;encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=30;", jdbc_user=>"xxxxx", jdbc_password=><password>, jdbc_fetch_size=>10000, lowercase_column_names=>false, statement_filepath=>"/app/logstash/logstash/../data_import_configs/sql/dm_structure.sql", add_field=>\{"[@metadata][type]"=>"jdbc_dm_structure"}, jdbc_pool_timeout=>120, jdbc_validate_connection=>true, id=>"jdbc_dm_structure", enable_metric=>true, codec=><LogStash::Codecs::Plain id=>"plain_39271aba-07f6-4658-8f2f-32ff4a23bf88", enable_metric=>true, charset=>"UTF-8">, jdbc_paging_enabled=>false, jdbc_page_size=>100000, jdbc_validation_timeout=>3600, sql_log_level=>"info", connection_retry_attempts=>1, connection_retry_attempts_wait_time=>0.5, parameters=>\{"sql_last_value"=>2018-10-18 23:00:43 UTC}, last_run_metadata_path=>"/home/app/.logstash_jdbc_last_run", use_column_value=>false, tracking_column_type=>"numeric", clean_run=>false, record_last_run=>true>
>  Error: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Cannot open server 'xxxxxx' requested by the login. Client with IP address 'xx.xx.xx.xx' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. ClientConnectionId:67137bf7-af9c-4f96-8001-79a935b1819e
> [2018-10-19T13:07:34,093][WARN ][logstash.inputs.jdbc ] Exception when executing JDBC query \{:exception=>#<Sequel::DatabaseConnectionError: Java::ComMicrosoftSqlserverJdbc::SQLServerException: Cannot open server 'xxxxxx' requested by the login. Client with IP address 'xx.xx.xx.xx' is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp_set_firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. ClientConnectionId:e3d66af1-79be-465b-9a27-3afd2d2af826>}
> [2018-10-19T13:07:34,093][WARN ][logstash.inputs.jdbc ] Attempt reconnection.
> [2018-10-19T13:07:34,259][ERROR][logstash.pipeline ] A plugin had an unrecoverable error. Will restart this plugin.

the problem is that logstash can work and log errors all the time for a few days ...
How can I fix this?

Any idea?

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