logstash-plugins / logstash-output-google_cloud_storage

Apache License 2.0
9 stars 26 forks source link

Plugin doesn't start on logstash 7.1.1 - TypeError #38

Closed KrzysztofZalasa closed 5 years ago

KrzysztofZalasa commented 5 years ago

Way to reproduce

  1. Install fresh version of logstash 7.1.1 as zip file, Debian 9
  2. Install plugin using bin/logstash-plugin install logstash-output-google_cloud_storage
  3. Start logstash using very simple config
    input { stdin { } } 
    output { 
    stdout {} 
    google_cloud_storage {
        bucket => "kzalasa-xxxxx-backup"
        json_key_file => "/home/kzalasa/kzalasa-xxxxx-xxxxxx.json"
        temp_directory => "/tmp/logstash"
        log_file_prefix => "xxxx_log"
        flush_interval_secs => 2
        uploader_interval_secs => 5
        max_file_size_kbytes => 10
        output_format => "plain"
        date_pattern => "%Y-%m-%dT%H:00"    
        gzip => false            
        gzip_content_encoding => false
        upload_synchronous => false   
        include_hostname => false     
    }
    }

I received following error:

[2019-06-14T13:44:30,388][ERROR][logstash.javapipeline    ] Pipeline aborted due to error {:pipeline_id=>"main", :exception=>#<TypeError: can't convert nil into Integer>, :backtrace=>["org/jruby/RubyString.java:1249:in `%'", "/hom
e/kzalasa/logstash-ticket/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.0-java/lib/logstash/outputs/gcs/path_factory.rb:83:in `template_variables'", "/home/kzalasa/logstash-ticket/logstash-
7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.0-java/lib/logstash/outputs/gcs/path_factory.rb:89:in `next_base'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstas
h-output-google_cloud_storage-4.0.0-java/lib/logstash/outputs/gcs/path_factory.rb:67:in `starting_part'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.0-java
/lib/logstash/outputs/gcs/path_factory.rb:27:in `initialize'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.0-java/lib/logstash/outputs/gcs/path_factory.rb:1
14:in `build_path_factory'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.0-java/lib/logstash/outputs/gcs/path_factory.rb:102:in `build'", "/home/kzalasa/log
stash-ticket/logstash-7.1.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.0-java/lib/logstash/outputs/google_cloud_storage.rb:219:in `initialize_path_factory'", "/home/kzalasa/logstash-ticket/logstash-7.1
.1/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.0-java/lib/logstash/outputs/google_cloud_storage.rb:163:in `register'", "org/logstash/config/ir/compiler/OutputStrategyExt.java:106:in `register'", "org/lo
gstash/config/ir/compiler/AbstractOutputDelegatorExt.java:48:in `register'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:191:in `block in register_plugins'", "org/jruby/RubyArray.java:
1792:in `each'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:190:in `register_plugins'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:445:i
n `maybe_setup_out_plugins'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:203:in `start_workers'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/logstash-core/lib/logstash/java_pipelin
e.rb:145:in `run'", "/home/kzalasa/logstash-ticket/logstash-7.1.1/logstash-core/lib/logstash/java_pipeline.rb:104:in `block in start'"], :thread=>"#<Thread:0x3305e54f run>"}

In file lib/logstash/outputs/gcs/path_factory.rb is a cyclic dependency:

colinsurprenant commented 5 years ago

This was fixed per #39, closing.