fluent / fluentd

Fluentd: Unified Logging Layer (project under CNCF)
https://www.fluentd.org
Apache License 2.0
12.86k stars 1.34k forks source link

D:/opt/calyptia-fluentd/lib/ruby/3.2.0/rubygems.rb:1342:in `rescue in <top (required)>': U+795E to ASCII-8BIT in conversion from UTF-16LE to UTF-8 to ASCII-8BIT (Encoding::UndefinedConversionError) #4550

Closed jackcomtw closed 2 months ago

jackcomtw commented 3 months ago

Help! I encountered a problem at work. Please refer to this link: https://github.com/fluent/fluentd/issues/4414

You mentioned a method; please refer to this link: https://github.com/fluent/fluent-package-builder/issues/616#issuecomment-1940324078

I don't understand what you mean. I installed calyptia-fluentd on a Chinese version of Windows. After installation, the directory c:\opt\td-agent\msys64\usr\bin\msys-2.0.dll you mentioned does not exist, so I cannot follow your method. Thank you.


Windows 11 run fluentd error: D:/opt/calyptia-fluentd/lib/ruby/3.2.0/rubygems.rb:1342:in `rescue in <top (required)>': U+795E to ASCII-8BIT in conversion from UTF-16LE to UTF-8 to ASCII-8BIT (Encoding::UndefinedConversionError)

Loading the D:/opt/calyptia-fluentd/lib/ruby/3.2.0/rubygems/defaults/operating_system.rb file caused an error. This file is owned by your OS, not by rubygems upstream. Please find out which OS package this file belongs to and follow the guidelines from your OS to report the problem and ask for help.

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/rubygems.rb:1328:in `<top (required)>'

    from <internal:gem_prelude>:2:in `require'

   from <internal:gem_prelude>:2:in `<internal:gem_prelude>'

D:/opt/calyptia-fluentd/lib/ruby/3.2.0/win32/registry.rb:910:in `encode': U+795E to ASCII-8BIT in conversion from UTF-16LE to UTF-8 to ASCII-8BIT (Encoding::UndefinedConversionError)

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/win32/registry.rb:910:in `export_string'

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/win32/registry.rb:611:in `each_key'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/msys2_installation.rb:71:in `block (2 levels) in iterate_msys_paths'

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/win32/registry.rb:435:in `open'

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/win32/registry.rb:542:in `open'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/msys2_installation.rb:70:in `block in iterate_msys_paths'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/msys2_installation.rb:68:in `each'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/msys2_installation.rb:68:in `iterate_msys_paths'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/msys2_installation.rb:102:in `msys_path'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/msys2_installation.rb:115:in `mingw_bin_path'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/msys2_installation.rb:125:in `enable_dll_search_paths'

    from D:/opt/calyptia-fluentd/lib/ruby/site_ruby/3.2.0/ruby_installer/runtime/singleton.rb:27:in `enable_dll_search_paths'

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/rubygems/defaults/operating_system.rb:24:in `<top (required)>'

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/rubygems.rb:1332:in `require'

    from D:/opt/calyptia-fluentd/lib/ruby/3.2.0/rubygems.rb:1332:in `<top (required)>'

    from <internal:gem_prelude>:2:in `require'

    from <internal:gem_prelude>:2:in `<internal:gem_prelude>'

2024-07-03 15:24:54 +0800 [error]: Worker 0 exited unexpectedly with status 1

jackcomtw commented 3 months ago

Please take this issue seriously. I need to resolve this problem quickly

--- command

fluentd -c D:\opt\calyptia-fluentd\etc\calyptia-fluentd\calyptia-fluentd.conf

--- version

fluentd 1.16.5

` log_level debug

@type tail @log_level debug path D:/log/logfile.log pos_file D:/pos_file/logfile.log.pos tag input_forward encoding UTF-8 from_encoding UTF-8

@type json

@type elasticsearch host 10.1.14.174 port 9200 logstash_format false index_name my-index type_name _doc

`

daipom commented 3 months ago

https://github.com/fluent/fluent-package-builder is for fluent-package and td-agent (old version of fluent-package).

You use calyptia-fluentd. It is another Fluentd package.

daipom commented 3 months ago

Sorry for I'm not familiar to calyptia-fluentd, but a similar solution should be possible. Also, this issue has been fixed in Ruby 3.2.4.

jackcomtw commented 3 months ago

Thank you. I am currently using Calyptia-Fluentd.

ashie commented 2 months ago

Probably you can resolve this issue by creating an empty file c:\opt\calyptia-fluentd\msys64\usr\bin\msys-2.0.dll insted of c:\opt\td-agent\msys64\usr\bin\msys-2.0.dll you mentioned.