logstash-plugins / logstash-input-google_pubsub

Logstash input for pulling events from Google Pub/Sub service
Apache License 2.0
19 stars 33 forks source link

Exception - java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument #37

Closed pvaldria closed 6 years ago

pvaldria commented 6 years ago

I am getting an error when i try to use logstash ang Google pub/sub input plugin. Its not clear based on the exception/error how I can fix it. Can you please help.

gcp-pubsub-logstash.conf

# The # character at the beginning of a line indicates a comment. Use
# comments to describe your configuration.
input {
    google_pubsub {
        project_id => "pinkesh-autocomplete-202716"
        topic => "product-ingestion-topic"
        subscription => "mysubs"
        json_key_file => "/home/pinkesh_valdria/gce_default_service_account.json"
    }
}
output { stdout { codec => rubydebug } }

Command I am running:

sudo logstash -f gcp-pubsub-logstash.conf --debug

Exception is on last line, it first days "pulling messages from subs" and then follow it by "closing". (the first few lines below).

[2018-05-16T06:29:23,897][INFO ][logstash.pipeline        ] Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x5a0c9b36 run>"}
[2018-05-16T06:29:24,030][DEBUG][logstash.inputs.googlepubsub] Pulling messages from sub 'projects/pinkesh-autocomplete-202716/subscriptions/mysubs'
[2018-05-16T06:29:24,139][INFO ][logstash.agent           ] Pipelines running {:count=>1, :pipelines=>["main"]}
[2018-05-16T06:29:24,251][DEBUG][logstash.inputs.googlepubsub] Closing {:plugin=>"LogStash::Inputs::GooglePubSub"}
[2018-05-16T06:29:24,364][DEBUG][logstash.pipeline        ] Pushing flush onto pipeline {:pipeline_id=>"main", :thread=>"#<Thread:0x5a0c9b36 sleep>"}
[2018-05-16T06:29:24,375][DEBUG][logstash.pipeline        ] Shutting down filter/output workers {:pipeline_id=>"main", :thread=>"#<Thread:0x5a0c9b36 run>"}
[2018-05-16T06:29:24,378][DEBUG][logstash.pipeline        ] Setting shutdown {:pipeline_id=>"main", :thread=>"#<Thread:0x5a0c9b36 run>"}
[2018-05-16T06:29:24,383][DEBUG][logstash.pipeline        ] Shutdown waiting for worker thread {:pipeline_id=>"main", :thread=>"#<Thread:0x4efc2b8a@[main]>worker0 run>"}
[2018-05-16T06:29:24,443][DEBUG][logstash.outputs.stdout  ] Closing {:plugin=>"LogStash::Outputs::Stdout"}
[2018-05-16T06:29:24,470][INFO ][logstash.pipeline        ] Pipeline has terminated {:pipeline_id=>"main", :thread=>"#<Thread:0x5a0c9b36 run>"}
[2018-05-16T06:29:24,574][ERROR][org.logstash.Logstash    ] java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;J)V

More details here: https://discuss.elastic.co/t/logstash-google-pub-sub-results-in-error-java-lang-nosuchmethoderror-com-google-common-base-preconditions-checkargument-zljava-lang-string/132001

pvaldria commented 6 years ago

I am using it on GCE instance. The Topic was manually created and currently it has messages (json format) and also the subscription (mysubs) was also manually created in Google cloud console, before running the above command.

josephlewis42 commented 6 years ago

@pvaldria There's an open issue for this right now you can follow here: #34 more details are in a PR #36

If you can, I think reverting to Logstash 6.2.3 should fix the issue for now until we figure out a more permanent solution.

pvaldria commented 6 years ago

downgrading to 6.2.3 fixes the issue - as a workaround.