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
HTTP input is failing during simple POST test with multiple JSON lines #50
Comments
hi, thanks for the report!
I guess we can try to prevent puma from doing this, but the alternative is checking if your |
This definitely seems to be a problem with trying to create a temp dir. I'm on Windows 10 laptop. To debug ruby, I added some output to the Dir::tmpdir function in the tmpdir.rb file: def Dir::tmpdir
if $SAFE > 0
tmp = @@systmpdir
else
# Search a directory which isn't world-writable first. In JRuby,
# FileUtils.remove_entry_secure(dir) crashes when a dir is under
# a world-writable directory because it tries to open directory.
# Opening directory is not allowed in Java.
tmp = nil
for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp', '.']
puts "Next dir: #{dir}"
next if !dir
dir = File.expand_path(dir)
puts "Expanded dir: #{dir}"
stat = File.stat(dir)
puts "stat = #{stat}"
puts "stat.directory? = #{stat.directory?}"
puts "stat.writable? = #{stat.writable?}"
#puts "stat.sticky? = #{stat.sticky?}"
puts "stat.world_writable? = #{stat.world_writable?}"
puts "------------------------------------------------------------"
if stat = File.stat(dir) and stat.directory? and stat.writable? and
(!(@@using_19 && stat.world_writable?) )#|| stat.sticky?)
tmp = dir
break
end
end
unless tmp
raise ArgumentError, "Unable to find a non world-writable directory for Dir::tmpdir. Consider setting ENV['TMPDIR'], ENV['TMP'] or ENV['TEMP'] to a non world-writable directory."
end
tmp
end
end This is the output I see on the console when I try to send a large payload to the http input:
There are two problems i've found:
Also if I hard-code the function to simply return the dir (with no other checks), then the HTTP input works for large payloads: tmp = File.expand_path("C:/Users/bvidovic/AppData/Local/Temp/")
return tmp |
@bradvido I believe this is due to jruby/jruby#3505, a jruby 1.7.23 bug stat makes For the next releases we're considering .25 which seems to fix both issues, but we need a bit of time to understand if nothing else fails. |
Thanks @jsvd I'll wait for the next release for a proper fix. |
I'm considering using this input, and I wanted to test it before committing to it.
Here's what I found;
Simple Java test:
This HTTP POSTs JSON lines (starting at 300, increasing by 1 until it fails) to the Logstash http input.
Logstash 2.3.2 Config:
Results from running test:
Log output from Logstash:
The text was updated successfully, but these errors were encountered: