TCP output throws NPE with ssl


I am using TCP output with ssl certs and the logstash-6.3.1. All components are 6.3.1, as this is a relatively new install. The flow is using two logstash nodes that use input to tcp output on the sending side, then tcp input to elasticsearch on the receiving side.

The behavior I am seeing is that the sending logstash shows repeated errors in the logs, but I do not see errors on the receiving side. When I initially boot logstash to send the logs, nothing appears in elasticsearch. However when I quit the sending logstash, a couple log messages will appear in ES, with a timestamp of when the sending logstash was started!

I don't think there is an issue with the certs or networking, because the beats input with ssl is working just fine on a different port. Also, a very small amount of data does get sent.

It is possible this issue is caused by a bug in jruby which has been fixed in a more recent version.

Here is the output plugin config

output {
  tcp {
    port => 8750
    host => ""
    ssl_enable => true
    ssl_cacert => "/etc/logstash/ssl/ca.crt"
    ssl_key => "/etc/logstash/ssl/client.key"
    ssl_cert => "/etc/logstash/ssl/client.crt"
    ssl_verify => false

I see this warning in the logs of the sending logstash

[2018-07-20T15:46:22,823][WARN ][logstash.outputs.tcp     ] tcp output exception {:host=>"", :port=>8750, :exception=>java.lang.NullPointerException, :backtrace=>["org.jruby.ext.openssl.SSLSocket.callSite(", ... 

The backtrace array in that message breaks into:


I think this might be related to this bug, but I am not sure:

The NPE originates from the same line of code, although in my case, the initial handshake succeeds, but the NPEs begin to happen essentially immediately afterwards. If this bug is to blame, it would be in version jruby-openssl 0.10.0, and is fixed in version 0.10.1.

I do not know how to to test my theory any further or what to do to resolve the issue at this point.


I tried out some older versions of logstash. The only version which displays the error in the logs is 6.3.1. 6.3.0, 6.2.4, 6.2.0, and 6.1.0 do not show any warnings in their logs, but I only see them deliver 1 entry to elasticsearch, and again the entry does not show up until after the agent is shut down. Generally i wait a random interval under 3 minutes, and shut down and within 6 seconds, I see something new in elasticsearch.

The difference with 6.3.1 is that there is a warning in the logs, and while in all cases, nothing shows up until after logstash is shutdown, with 6.3.1, it delivers about 1 message per error message in the logs, which is on a retry loop about 8-10 seconds or so.

(system) #3

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