簡體   English   中英

logstash gcp pubsub 輸入插件:“NoSuchMethodError: 'void com.google.common.util.concurrent.Futures.addCallback”

[英]logstash gcp pubsub input plugin: "NoSuchMethodError: 'void com.google.common.util.concurrent.Futures.addCallback"

我正在嘗試使用最基本的設置運行這個插件:

input {
    google_pubsub {
        # Your GCP project id (name)
        project_id => "cosmic-keep-148903"

        # The topic name below is currently hard-coded in the plugin. You
        # must first create this topic by hand and ensure you are exporting
        # logging to this pubsub topic.
        topic => "slm"

        # The subscription name is customizeable. The plugin will attempt to
        # create the subscription (but use the hard-coded topic name above).
        subscription => "slm-sub"

        # If you are running logstash within GCE, it will use
        # Application Default Credentials and use GCE's metadata
        # service to fetch tokens.  However, if you are running logstash
        # outside of GCE, you will need to specify the service account's
        # JSON key file below.
        json_key_file => "/path/to/pkey.json"

        # Should the plugin attempt to create the subscription on startup?
        # This is not recommended for security reasons but may be useful in
        # some cases.
        #create_subscription => false
    }
}
output { stdout { codec => rubydebug } }

並看到此錯誤:

RUBY.inputworker(/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:410)
RUBY.start_input(/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:401)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:318)
java.lang.Thread.run(java/lang/Thread.java:829)
[ERROR] 2022-08-18 02:38:46.111 [Thread-105] googlepubsub - Expected the service InnerService [FAILED] to be RUNNING, but the service has FAILED
Aug 18, 2022 2:38:46 AM com.google.common.util.concurrent.ListenerCallQueue$PerListenerQueue run
SEVERE: Exception while executing callback: com.google.api.core.AbstractApiService$1@f048817 failed({from = STARTING, cause = java.lang.IllegalStateException: Expected the service InnerService [FAILED] to be RUNNING, but the service has FAILED})
java.lang.IllegalStateException: Expected the service InnerService [FAILED] to be RUNNING, but the service has FAILED
    at com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381)
    at com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305)
    at com.google.api.core.AbstractApiService.awaitRunning(AbstractApiService.java:96)
    at com.google.cloud.pubsub.v1.Subscriber.startConnections(Subscriber.java:390)
    at com.google.cloud.pubsub.v1.Subscriber.startStreamingConnections(Subscriber.java:355)
    at com.google.cloud.pubsub.v1.Subscriber.access$200(Subscriber.java:93)
    at com.google.cloud.pubsub.v1.Subscriber$3.run(Subscriber.java:299)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NoSuchMethodError: 'void com.google.common.util.concurrent.Futures.addCallback(com.google.common.util.concurrent.ListenableFuture, com.google.common.util.concurrent.FutureCallback)'
    at com.google.cloud.pubsub.v1.StreamingSubscriberConnection.initialize(StreamingSubscriberConnection.java:218)
    at com.google.cloud.pubsub.v1.StreamingSubscriberConnection.doStart(StreamingSubscriberConnection.java:110)
    at com.google.api.core.AbstractApiService$InnerService.doStart(AbstractApiService.java:148)
    at com.google.common.util.concurrent.AbstractService.startAsync(AbstractService.java:251)
    at com.google.api.core.AbstractApiService.startAsync(AbstractApiService.java:120)
    at com.google.cloud.pubsub.v1.Subscriber.startConnections(Subscriber.java:387)
    ... 4 more

任何指導表示贊賞。

您可能在 Logstash 的 GCP Pub/Sub 插件中遇到了一個錯誤: https://github.com/logstash-plugins/logstash-input-google_pubsub/issues/57

此插件 (v1.2.1) 的最新工作版本 Logstash 是 8.1.3

您也可以嘗試 Filebeat,它適用於我使用 GCP Pub/Sub 的情況,並且在資源上更容易。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM