check if file exists before performing operation on file (or handle error)
Closed this issue · 1 comments
in google_bigquery.rb it was already reported this was needed:
File.delete(filename) if File.exist?(filename)
but could you also perform File.exist before this?
if File.size(filename) > 0
I ran into this which stopped logstash (2.2.0) until I added the check.
Errno::ENOENT: No such file or directory - No such file or directory - /..
size at org/jruby/RubyFileTest.java:239
Hi @da3bobots this issue should be fixed with version 4.0.0 of the plugin. We're no longer storing/rotating files locally like we used to and instead are using BigQuery's streaming API to upload data as it comes in.
WARNING 4.0.0 has breaking changes so read the changelog before upgrading to understand how they'll affect you.
The plugin can be updated with the following command
bin/logstash-plugin update logstash-output-google_bigquery