{:error=>#<NoMethodError: undefined method `truncate' for #<IOWriter:0x3e9b038 @io=#<Zlib::GzipWriter:0x164b00d>>


#1

I'm using docker.elastic.co/logstash/logstash:6.2.4 and while running bellow pipeline configuration, I get the following:

output {
	file {
		path => "/tmp/data.json.gz"
		write_behavior => overwrite
		gzip => true
	}
}

following is last message that logstash produced:

[2018-05-17T20:00:03,025][INFO ][logstash.outputs.file ] Opening file {:path=>"/tmp/data.json.gz"}

pipeline never terminates and even though ./tmp/data.json.gz is not zero bytes (file has some data in it), output file comes out corrupted:

# gzip --test data.json.gz 

gzip: data.json.gz: unexpected end of file
# 

Please advise.


#2

LOG_LEVEL=debug:

[2018-05-17T18:00:03,045][FATAL][logstash.runner ] An unexpected error occurred! {:error=>#<NoMethodError: undefined method `truncate' for #<IOWriter:0x3e9b038 @io=#Zlib::GzipWriter:0x164b00d>

logstash:

Did you mean? trust>, :backtrace=>["org/jruby/RubyBasicObject.java:1657:inmethod_missing'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-file-4.2.3/lib/logstash/outputs/file.rb:320:in method_missing'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-file-4.2.3/lib/logstash/outputs/file.rb:137:inblock in multi_receive_encoded'", "org/jruby/RubyHash.java:1343:in each'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-file-4.2.3/lib/logstash/outputs/file.rb:134:inblock in multi_receive_encoded'", "org/jruby/ext/thread/Mutex.java:148:in synchronize'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-file-4.2.3/lib/logstash/outputs/file.rb:133:inmulti_receive_encoded'", "/usr/share/logstash/logstash-core/lib/logstash/outputs/base.rb:90:in multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator_strategies/shared.rb:13:inmulti_receive'", "/usr/share/logstash/logstash-core/lib/logstash/output_delegator.rb:49:in multi_receive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:477:inblock in output_batch'", "org/jruby/RubyHash.java:1343:in each'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:476:inoutput_batch'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:428:in worker_loop'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:386:inblock in start_workers'"]}`

&

[2018-05-18T04:15:31,354][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: org.jruby.exceptions.RaiseException: (SystemExit) exit


#3

this behavior can be reproduced by changing write_behavior from default append to overwrite.

Please advise.


(Shaunak Kashyap) #4

Hi @alexus, thanks for this post and the ping on IRC. Generally we report bugs in the corresponding GitHub repositories. So if you have a GitHub account, please do that going forward.

For this one, I've created a bug in the right repository for you: https://github.com/logstash-plugins/logstash-output-file/issues/66


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.