Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better exception handling upon invalid temp log file name #44

Open
colinsurprenant opened this issue Aug 9, 2019 · 0 comments
Open

Comments

@colinsurprenant
Copy link
Contributor

Per #41 if an invalid temp file name is created using, for example, an invalid pattern in log_file_prefix then the resulting exception is very hard to decrypt.

    #<Errno::ENOENT: No such file or directory - 
    /tmp/logstash-gcs-504f0f1052346b639f01477069a72f1f76be227ff8e41870e5f7859b5be1/logs/%{+YYYY/MM/dd}_logstasher-785c699966-sg4c9_2019-08-05T19:00.part001.log.gz>, 
  :backtrace=>[
    "org/jruby/RubyIO.java:1236:in `sysopen'", 
    "org/jruby/RubyFile.java:367:in `initialize'", 
    "org/jruby/RubyIO.java:876:in `new'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.1-java/lib/logstash/outputs/gcs/temp_log_file.rb:29:in `initialize'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.1-java/lib/logstash/outputs/gcs/temp_log_file.rb:14:in `create'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.1-java/lib/logstash/outputs/gcs/log_rotate.rb:51:in `block in rotate_log!'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/concurrent-ruby-1.1.5/lib/concurrent/atomic/reentrant_read_write_lock.rb:147:in `with_write_lock'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.1-java/lib/logstash/outputs/gcs/log_rotate.rb:42:in `rotate_log!'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.1-java/lib/logstash/outputs/gcs/log_rotate.rb:19:in `initialize'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.1-java/lib/logstash/outputs/google_cloud_storage.rb:266:in `initialize_log_rotater'", 
    "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-output-google_cloud_storage-4.0.1-java/lib/logstash/outputs/google_cloud_storage.rb:164:in `register'", 
    "org/logstash/config/ir/compiler/OutputStrategyExt.java:106:in `register'", 
    "org/logstash/config/ir/compiler/AbstractOutputDelegatorExt.java:48:in `register'", 
    "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:192:in `block in register_plugins'", 
    "org/jruby/RubyArray.java:1792:in `each'", 
    "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:191:in `register_plugins'", 
    "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:462:in `maybe_setup_out_plugins'", 
    "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:204:in `start_workers'", 
    "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:146:in `run'", 
    "/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:105:in `block in start'"

We should improve the error reporting for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant