Giter Club home page Giter Club logo

Comments (3)

tagomoris avatar tagomoris commented on June 4, 2024

The stacktrace you showed is typically caused by the missing value for the specified key message of the <format> @type single_value </format> formatter.

I'm not sure why the other compressor can work well but snappy cannot, but the value conversion from nil could be the reason.
(Other compressors don't hit the problem about value conversion from nil?)

Are you sure that the record contains the message key and its value?
If so, can I see the value of the message key? (copy and stdout plugins should be helpful)

from fluent-plugin-webhdfs.

JaeGeunBang avatar JaeGeunBang commented on June 4, 2024

Thank you for the reply.

I changed the .conf as below. Remove <format> @type single_value </format> formatter and add <store> @type stdout </store> for debugging.

<source>
  @type kafka_group
  brokers localhost:9092
  consumer_group test
  topics TEST
  add_prefix fluentd
  add_suffix log
  format json
  start_from_beginning false
</source>

<match fluentd.TEST.log>
  @type copy
  <store>
    @type stdout
  </store>
  
  <store>
    @type webhdfs
    namenode localhost:50070

    path /user/test/%Y/%m/%d/%H/%M/test-%Y%m%d%H%M.log
    compress snappy

    <buffer>
      @type file
      path /data/td-agent
      flush_mode interval
      flush_interval 1s
    </buffer>
  </store>
</match>

As a result of the test, it was confirmed that the output is as below.

2020-05-29 13:22:30.416036274 +0900 fluentd.TEST.log: {"date":"2020-05-29_13:12","topic":"test1","count":"0"}
2020-05-29 13:22:36.416878675 +0900 fluentd.TEST.log: {"date":"2020-05-29_13:12","topic":"test1","count":"3"}
2020-05-29 13:22:50.439255700 +0900 fluentd.TEST.log: {"date":"2020-05-29_13:12","topic":"test2","count":"3"}
2020-05-29 13:22:50.439408264 +0900 fluentd.TEST.log: {"date":"2020-05-29_13:12","topic":"test2","count":"0"}
2020-05-29 13:22:54 +0900 [warn]: #0 failed to communicate hdfs cluster, path: /user/test/2020/05/29/13/21/test-202005291321.log.sz
2020-05-29 13:22:54 +0900 [warn]: #0 got unrecoverable error in primary and no secondary error_class=TypeError error="no implicit conversion from nil to integer"
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin/buffer/chunk.rb:180:in `copy_stream'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin/buffer/chunk.rb:180:in `block in write_to'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin/buffer/file_chunk.rb:171:in `open'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin/buffer/chunk.rb:179:in `write_to'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-webhdfs-1.2.4/lib/fluent/plugin/webhdfs_compressor_snappy.rb:20:in `compress'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-webhdfs-1.2.4/lib/fluent/plugin/out_webhdfs.rb:333:in `compress_context'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluent-plugin-webhdfs-1.2.4/lib/fluent/plugin/out_webhdfs.rb:388:in `write'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin/output.rb:1133:in `try_flush'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin/output.rb:1439:in `flush_thread_run'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin/output.rb:461:in `block (2 levels) in start'
  2020-05-29 13:22:54 +0900 [warn]: #0 /opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.10.2/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2020-05-29 13:22:54 +0900 [warn]: #0 bad chunk is moved to /tmp/fluent/backup/worker0/object_3f9075bed29c/5a6c1c8dcccdc1d38cbb85a0c4769670.log

When I change to a different format (gzip, bzip2, lzo_command), I can see that it is stored in hdfs successfully. But only Snappy does not work as above.

Screenshot from 2020-05-29 13-26-32

Screenshot from 2020-05-29 13-26-39

from fluent-plugin-webhdfs.

tagomoris avatar tagomoris commented on June 4, 2024

Thanks for the follow-ups! But unfortunately, I can't find the clear cause of the failure now.

from fluent-plugin-webhdfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.