Skip to content

Error when deleting temporary gzip files #136

Open
@ghost

Description

The s3 output uploader throws an error after uploading when it tries to delete the temporary file. This only happens if encoding is set to gzip.

Here is an example error message (full stack below):
15:15:51.050 [S3 output uploader, file: s3_temp/457c907d-f8a0-4885-9e3e-0bc0fb12dcab/json_test_s3/ls.s3.007ad655-d7a9-4480-909b-e9226208aeb6.2017-04-13T15.15.part0.txt.gz] ERROR logstash.outputs.s3 - An error occured in the on_complete uploader {:exception=>Errno::EACCES, :message=>"Permission denied - s3_temp/457c907d-f8a0-4885-9e3e-0bc0fb12dcab/json_test_s3/ls.s3.007ad655-d7a9-4480-909b-e9226208aeb6.2017-04-13T15.15.part0.txt.gz"

Other notes:

  • The upload succeeds (I see the files in the S3 bucket)
  • The delete works fine if encoding is set to the default (none).
  • It fails regardless if temporary_directory is set to the default or to a local directory (in the example above, it's set to a local 's3_temp' directory)
  • From the file explorer, I can't open the file nor delete it until I kill the logstash process. If I copy it and unzip, it contains valid data inside.
  • OS: Windows 10

If I can provide more info, please let me know.

Full Error:
15:15:51.050 [S3 output uploader, file: s3_temp/457c907d-f8a0-4885-9e3e-0bc0fb12dcab/json_test_s3/ls.s3.007ad655-d7a9-4480-909b-e9226208aeb6.2017-04-13T15.15.part0.txt.gz] ERROR logstash.outputs.s3 - An error occured in the on_complete uploader {:exception=>Errno::EACCES, :message=>"Permission denied - s3_temp/457c907d-f8a0-4885-9e3e-0bc0fb12dcab/json_test_s3/ls.s3.007ad655-d7a9-4480-909b-e9226208aeb6.2017-04-13T15.15.part0.txt.gz", :path=>"s3_temp/457c907d-f8a0-4885-9e3e-0bc0fb12dcab/json_test_s3/ls.s3.007ad655-d7a9-4480-909b-e9226208aeb6.2017-04-13T15.15.part0.txt.gz", :backtrace=>["org/jruby/RubyFile.java:1129:in unlink'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1416:in remove_file'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1421:in platform_support'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1415:in remove_file'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1404:in remove'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:780:in remove_entry'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1454:in postorder_traverse'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1454:in postorder_traverse'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1458:in postorder_traverse'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1453:in postorder_traverse'", "org/jruby/RubyArray.java:1613:in each'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1452:in postorder_traverse'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1453:in postorder_traverse'", "org/jruby/RubyArray.java:1613:in each'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:1452:in postorder_traverse'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:778:in remove_entry'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:713:in remove_entry_secure'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:633:in rm_r'", "org/jruby/RubyArray.java:1613:in each'", "C:/elk/logstash-5.3.0/vendor/jruby/lib/ruby/1.9/fileutils.rb:631:in rm_r'", "C:/elk/logstash-5.3.0/vendor/bundle/jruby/1.9/gems/logstash-output-s3-4.0.6/lib/logstash/outputs/s3/temporary_file.rb:54:in delete!'", "C:/elk/logstash-5.3.0/vendor/bundle/jruby/1.9/gems/logstash-output-s3-4.0.6/lib/logstash/outputs/s3.rb:361:in clean_temporary_file'", "org/jruby/RubyMethod.java:120:in call'", "C:/elk/logstash-5.3.0/vendor/bundle/jruby/1.9/gems/logstash-output-s3-4.0.6/lib/logstash/outputs/s3/uploader.rb:49:in upload'", "C:/elk/logstash-5.3.0/vendor/bundle/jruby/1.9/gems/logstash-output-s3-4.0.6/lib/logstash/outputs/s3/uploader.rb:29:in upload_async'", "org/jruby/RubyProc.java:281:in call'", "C:/elk/logstash-5.3.0/vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/executor/java_executor_service.rb:94:in run'", "Concurrent$$JavaExecutorService$$Job_1733552327.gen:13:in run'"]}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions