Skip to content
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

'console' gem v1.25 causes LoadError #4487

Closed
daipom opened this issue May 7, 2024 · 2 comments · Fixed by #4492
Closed

'console' gem v1.25 causes LoadError #4487

daipom opened this issue May 7, 2024 · 2 comments · Fixed by #4492
Labels
bug Something isn't working

Comments

@daipom
Copy link
Contributor

daipom commented May 7, 2024

Describe the bug

https://github.com/socketry/console v1.25 series was released on 2024-05-03.

It causes CI failure (Ruby ver >= 3.1): https://github.com/fluent/fluentd/actions/runs/8978822806/job/24659864778?pr=4486

cannot load such file -- console/terminal/logger (LoadError)`
...
from /.../lib/fluent/log/console_adapter.rb:17:in `<top (required)>'

require 'console/terminal/logger'
module Fluent
class Log
# Async gem which is used by http_server helper switched logger mechanism to
# Console gem which isn't complatible with Ruby's standard Logger (since
# v1.17). This class adapts it to Fluentd's logger mechanism.
class ConsoleAdapter < Console::Terminal::Logger

This is caused by the following path change (lib/console/terminal/logger.rb -> lib/console/output/terminal.rb):

We need to consider how to handle this new console gem ver.

To Reproduce

git clone git@github.com:fluent/fluentd.git
cd fluentd
bundle
bundle exec rake test

Expected behavior

Tests are executed without errors.

Your Environment

- Fluentd version: 1.17.0
- Operating system: Ubuntu 20.04.6 LTS (Focal Fossa)
- Kernel version: 5.15.0-105-generic

Your Configuration

None

Your Error Log

/home/daipom/.rbenv/versions/3.2.2/bin/ruby -w -I"lib:test" -Eascii-8bit:ascii-8bit /home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/command/test_binlog_reader.rb" "test/command/test_ca_generate.rb" "test/command/test_cap_ctl.rb" "test/command/test_cat.rb" "test/command/test_ctl.rb" "test/command/test_fluentd.rb" "test/command/test_plugin_config_formatter.rb" "test/command/test_plugin_generator.rb" "test/compat/test_calls_super.rb" "test/compat/test_parser.rb" "test/config/test_config_parser.rb" "test/config/test_configurable.rb" "test/config/test_configure_proxy.rb" "test/config/test_dsl.rb" "test/config/test_element.rb" "test/config/test_literal_parser.rb" "test/config/test_plugin_configuration.rb" "test/config/test_section.rb" "test/config/test_system_config.rb" "test/config/test_types.rb" "test/counter/test_client.rb" "test/counter/test_error.rb" "test/counter/test_mutex_hash.rb" "test/counter/test_server.rb" "test/counter/test_store.rb" "test/counter/test_validator.rb" "test/log/test_console_adapter.rb" "test/plugin/in_tail/test_fifo.rb" "test/plugin/in_tail/test_io_handler.rb" "test/plugin/in_tail/test_position_file.rb" "test/plugin/out_forward/test_ack_handler.rb" "test/plugin/out_forward/test_connection_manager.rb" "test/plugin/out_forward/test_handshake_protocol.rb" "test/plugin/out_forward/test_load_balancer.rb" "test/plugin/out_forward/test_socket_cache.rb" "test/plugin/test_bare_output.rb" "test/plugin/test_base.rb" "test/plugin/test_buf_file.rb" "test/plugin/test_buf_file_single.rb" "test/plugin/test_buf_memory.rb" "test/plugin/test_buffer.rb" "test/plugin/test_buffer_chunk.rb" "test/plugin/test_buffer_file_chunk.rb" "test/plugin/test_buffer_file_single_chunk.rb" "test/plugin/test_buffer_memory_chunk.rb" "test/plugin/test_compressable.rb" "test/plugin/test_file_util.rb" "test/plugin/test_filter.rb" "test/plugin/test_filter_grep.rb" "test/plugin/test_filter_parser.rb" "test/plugin/test_filter_record_transformer.rb" "test/plugin/test_filter_stdout.rb" "test/plugin/test_formatter_csv.rb" "test/plugin/test_formatter_hash.rb" "test/plugin/test_formatter_json.rb" "test/plugin/test_formatter_ltsv.rb" "test/plugin/test_formatter_msgpack.rb" "test/plugin/test_formatter_out_file.rb" "test/plugin/test_formatter_single_value.rb" "test/plugin/test_formatter_tsv.rb" "test/plugin/test_in_debug_agent.rb" "test/plugin/test_in_exec.rb" "test/plugin/test_in_forward.rb" "test/plugin/test_in_gc_stat.rb" "test/plugin/test_in_http.rb" "test/plugin/test_in_monitor_agent.rb" "test/plugin/test_in_object_space.rb" "test/plugin/test_in_sample.rb" "test/plugin/test_in_syslog.rb" "test/plugin/test_in_tail.rb" "test/plugin/test_in_tcp.rb" "test/plugin/test_in_udp.rb" "test/plugin/test_in_unix.rb" "test/plugin/test_input.rb" "test/plugin/test_metadata.rb" "test/plugin/test_metrics.rb" "test/plugin/test_metrics_local.rb" "test/plugin/test_multi_output.rb" "test/plugin/test_out_copy.rb" "test/plugin/test_out_exec.rb" "test/plugin/test_out_exec_filter.rb" "test/plugin/test_out_file.rb" "test/plugin/test_out_forward.rb" "test/plugin/test_out_http.rb" "test/plugin/test_out_null.rb" "test/plugin/test_out_relabel.rb" "test/plugin/test_out_roundrobin.rb" "test/plugin/test_out_secondary_file.rb" "test/plugin/test_out_stdout.rb" "test/plugin/test_out_stream.rb" "test/plugin/test_output.rb" "test/plugin/test_output_as_buffered.rb" "test/plugin/test_output_as_buffered_backup.rb" "test/plugin/test_output_as_buffered_compress.rb" "test/plugin/test_output_as_buffered_overflow.rb" "test/plugin/test_output_as_buffered_retries.rb" "test/plugin/test_output_as_buffered_secondary.rb" "test/plugin/test_output_as_standard.rb" "test/plugin/test_owned_by.rb" "test/plugin/test_parser.rb" "test/plugin/test_parser_apache.rb" "test/plugin/test_parser_apache2.rb" "test/plugin/test_parser_apache_error.rb" "test/plugin/test_parser_csv.rb" "test/plugin/test_parser_json.rb" "test/plugin/test_parser_labeled_tsv.rb" "test/plugin/test_parser_msgpack.rb" "test/plugin/test_parser_multiline.rb" "test/plugin/test_parser_nginx.rb" "test/plugin/test_parser_none.rb" "test/plugin/test_parser_regexp.rb" "test/plugin/test_parser_syslog.rb" "test/plugin/test_parser_tsv.rb" "test/plugin/test_sd_file.rb" "test/plugin/test_sd_srv.rb" "test/plugin/test_storage.rb" "test/plugin/test_storage_local.rb" "test/plugin/test_string_util.rb" "test/plugin_helper/http_server/test_app.rb" "test/plugin_helper/http_server/test_route.rb" "test/plugin_helper/service_discovery/test_manager.rb" "test/plugin_helper/service_discovery/test_round_robin_balancer.rb" "test/plugin_helper/test_cert_option.rb" "test/plugin_helper/test_child_process.rb" "test/plugin_helper/test_compat_parameters.rb" "test/plugin_helper/test_event_emitter.rb" "test/plugin_helper/test_event_loop.rb" "test/plugin_helper/test_extract.rb" "test/plugin_helper/test_formatter.rb" "test/plugin_helper/test_http_server_helper.rb" "test/plugin_helper/test_inject.rb" "test/plugin_helper/test_metrics.rb" "test/plugin_helper/test_parser.rb" "test/plugin_helper/test_record_accessor.rb" "test/plugin_helper/test_retry_state.rb" "test/plugin_helper/test_server.rb" "test/plugin_helper/test_service_discovery.rb" "test/plugin_helper/test_socket.rb" "test/plugin_helper/test_storage.rb" "test/plugin_helper/test_thread.rb" "test/plugin_helper/test_timer.rb" "test/test_capability.rb" "test/test_clock.rb" "test/test_config.rb" "test/test_configdsl.rb" "test/test_daemonizer.rb" "test/test_engine.rb" "test/test_event.rb" "test/test_event_router.rb" "test/test_event_time.rb" "test/test_file_wrapper.rb" "test/test_filter.rb" "test/test_fluent_log_event_router.rb" "test/test_formatter.rb" "test/test_input.rb" "test/test_log.rb" "test/test_match.rb" "test/test_mixin.rb" "test/test_msgpack_factory.rb" "test/test_oj_options.rb" "test/test_output.rb" "test/test_plugin.rb" "test/test_plugin_classes.rb" "test/test_plugin_helper.rb" "test/test_plugin_id.rb" "test/test_process.rb" "test/test_root_agent.rb" "test/test_static_config_analysis.rb" "test/test_supervisor.rb" "test/test_test_drivers.rb" "test/test_time_formatter.rb" "test/test_time_parser.rb" "test/test_tls.rb" "test/test_unique_id.rb" "test/test_variable_store.rb" 
/home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cool.io-1.8.0/lib/iobuffer_ext.so: warning: method redefined; discarding old initialize
/home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cool.io-1.8.0/lib/iobuffer_ext.so: warning: method redefined; discarding old clear
/home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cool.io-1.8.0/lib/iobuffer_ext.so: warning: method redefined; discarding old size
/home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cool.io-1.8.0/lib/iobuffer_ext.so: warning: method redefined; discarding old empty?
/home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cool.io-1.8.0/lib/iobuffer_ext.so: warning: method redefined; discarding old write
/home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/cool.io-1.8.0/lib/iobuffer_ext.so: warning: method redefined; discarding old read
Fiber#storage has borked keys and is being monkey-patched.
/home/daipom/work/fluentd/tmp/fluentd.tmp/lib/fluent/plugin_helper.rb:46: warning: method redefined; discarding old inherited
/home/daipom/work/fluentd/tmp/fluentd.tmp/lib/fluent/plugin_helper.rb:46: warning: previous definition of inherited was here
/home/daipom/work/fluentd/tmp/fluentd.tmp/lib/fluent/command/plugin_config_formatter.rb:190: warning: assigned but unused variable - required
/home/daipom/work/fluentd/tmp/fluentd.tmp/lib/fluent/command/plugin_config_formatter.rb:191: warning: assigned but unused variable - multi
/home/daipom/work/fluentd/tmp/fluentd.tmp/lib/fluent/command/plugin_config_formatter.rb:192: warning: assigned but unused variable - alias_name
<internal:/home/daipom/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require': cannot load such file -- console/terminal/logger (LoadError)
	from <internal:/home/daipom/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from /home/daipom/work/fluentd/tmp/fluentd.tmp/lib/fluent/log/console_adapter.rb:17:in `<top (required)>'
	from <internal:/home/daipom/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from <internal:/home/daipom/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from /home/daipom/work/fluentd/tmp/fluentd.tmp/test/log/test_console_adapter.rb:4:in `<top (required)>'
	from <internal:/home/daipom/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from <internal:/home/daipom/.rbenv/versions/3.2.2/lib/ruby/site_ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from /home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:21:in `block in <main>'
	from /home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `select'
	from /home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb:6:in `<main>'
rake aborted!
Command failed with status (1): [ruby -w -I"lib:test" -Eascii-8bit:ascii-8bit /home/daipom/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.2.1/lib/rake/rake_test_loader.rb "test/command/test_binlog_reader.rb" "test/command/test_ca_generate.rb" "test/command/test_cap_ctl.rb" "test/command/test_cat.rb" "test/command/test_ctl.rb" "test/command/test_fluentd.rb" "test/command/test_plugin_config_formatter.rb" "test/command/test_plugin_generator.rb" "test/compat/test_calls_super.rb" "test/compat/test_parser.rb" "test/config/test_config_parser.rb" "test/config/test_configurable.rb" "test/config/test_configure_proxy.rb" "test/config/test_dsl.rb" "test/config/test_element.rb" "test/config/test_literal_parser.rb" "test/config/test_plugin_configuration.rb" "test/config/test_section.rb" "test/config/test_system_config.rb" "test/config/test_types.rb" "test/counter/test_client.rb" "test/counter/test_error.rb" "test/counter/test_mutex_hash.rb" "test/counter/test_server.rb" "test/counter/test_store.rb" "test/counter/test_validator.rb" "test/log/test_console_adapter.rb" "test/plugin/in_tail/test_fifo.rb" "test/plugin/in_tail/test_io_handler.rb" "test/plugin/in_tail/test_position_file.rb" "test/plugin/out_forward/test_ack_handler.rb" "test/plugin/out_forward/test_connection_manager.rb" "test/plugin/out_forward/test_handshake_protocol.rb" "test/plugin/out_forward/test_load_balancer.rb" "test/plugin/out_forward/test_socket_cache.rb" "test/plugin/test_bare_output.rb" "test/plugin/test_base.rb" "test/plugin/test_buf_file.rb" "test/plugin/test_buf_file_single.rb" "test/plugin/test_buf_memory.rb" "test/plugin/test_buffer.rb" "test/plugin/test_buffer_chunk.rb" "test/plugin/test_buffer_file_chunk.rb" "test/plugin/test_buffer_file_single_chunk.rb" "test/plugin/test_buffer_memory_chunk.rb" "test/plugin/test_compressable.rb" "test/plugin/test_file_util.rb" "test/plugin/test_filter.rb" "test/plugin/test_filter_grep.rb" "test/plugin/test_filter_parser.rb" "test/plugin/test_filter_record_transformer.rb" "test/plugin/test_filter_stdout.rb" "test/plugin/test_formatter_csv.rb" "test/plugin/test_formatter_hash.rb" "test/plugin/test_formatter_json.rb" "test/plugin/test_formatter_ltsv.rb" "test/plugin/test_formatter_msgpack.rb" "test/plugin/test_formatter_out_file.rb" "test/plugin/test_formatter_single_value.rb" "test/plugin/test_formatter_tsv.rb" "test/plugin/test_in_debug_agent.rb" "test/plugin/test_in_exec.rb" "test/plugin/test_in_forward.rb" "test/plugin/test_in_gc_stat.rb" "test/plugin/test_in_http.rb" "test/plugin/test_in_monitor_agent.rb" "test/plugin/test_in_object_space.rb" "test/plugin/test_in_sample.rb" "test/plugin/test_in_syslog.rb" "test/plugin/test_in_tail.rb" "test/plugin/test_in_tcp.rb" "test/plugin/test_in_udp.rb" "test/plugin/test_in_unix.rb" "test/plugin/test_input.rb" "test/plugin/test_metadata.rb" "test/plugin/test_metrics.rb" "test/plugin/test_metrics_local.rb" "test/plugin/test_multi_output.rb" "test/plugin/test_out_copy.rb" "test/plugin/test_out_exec.rb" "test/plugin/test_out_exec_filter.rb" "test/plugin/test_out_file.rb" "test/plugin/test_out_forward.rb" "test/plugin/test_out_http.rb" "test/plugin/test_out_null.rb" "test/plugin/test_out_relabel.rb" "test/plugin/test_out_roundrobin.rb" "test/plugin/test_out_secondary_file.rb" "test/plugin/test_out_stdout.rb" "test/plugin/test_out_stream.rb" "test/plugin/test_output.rb" "test/plugin/test_output_as_buffered.rb" "test/plugin/test_output_as_buffered_backup.rb" "test/plugin/test_output_as_buffered_compress.rb" "test/plugin/test_output_as_buffered_overflow.rb" "test/plugin/test_output_as_buffered_retries.rb" "test/plugin/test_output_as_buffered_secondary.rb" "test/plugin/test_output_as_standard.rb" "test/plugin/test_owned_by.rb" "test/plugin/test_parser.rb" "test/plugin/test_parser_apache.rb" "test/plugin/test_parser_apache2.rb" "test/plugin/test_parser_apache_error.rb" "test/plugin/test_parser_csv.rb" "test/plugin/test_parser_json.rb" "test/plugin/test_parser_labeled_tsv.rb" "test/plugin/test_parser_msgpack.rb" "test/plugin/test_parser_multiline.rb" "test/plugin/test_parser_nginx.rb" "test/plugin/test_parser_none.rb" "test/plugin/test_parser_regexp.rb" "test/plugin/test_parser_syslog.rb" "test/plugin/test_parser_tsv.rb" "test/plugin/test_sd_file.rb" "test/plugin/test_sd_srv.rb" "test/plugin/test_storage.rb" "test/plugin/test_storage_local.rb" "test/plugin/test_string_util.rb" "test/plugin_helper/http_server/test_app.rb" "test/plugin_helper/http_server/test_route.rb" "test/plugin_helper/service_discovery/test_manager.rb" "test/plugin_helper/service_discovery/test_round_robin_balancer.rb" "test/plugin_helper/test_cert_option.rb" "test/plugin_helper/test_child_process.rb" "test/plugin_helper/test_compat_parameters.rb" "test/plugin_helper/test_event_emitter.rb" "test/plugin_helper/test_event_loop.rb" "test/plugin_helper/test_extract.rb" "test/plugin_helper/test_formatter.rb" "test/plugin_helper/test_http_server_helper.rb" "test/plugin_helper/test_inject.rb" "test/plugin_helper/test_metrics.rb" "test/plugin_helper/test_parser.rb" "test/plugin_helper/test_record_accessor.rb" "test/plugin_helper/test_retry_state.rb" "test/plugin_helper/test_server.rb" "test/plugin_helper/test_service_discovery.rb" "test/plugin_helper/test_socket.rb" "test/plugin_helper/test_storage.rb" "test/plugin_helper/test_thread.rb" "test/plugin_helper/test_timer.rb" "test/test_capability.rb" "test/test_clock.rb" "test/test_config.rb" "test/test_configdsl.rb" "test/test_daemonizer.rb" "test/test_engine.rb" "test/test_event.rb" "test/test_event_router.rb" "test/test_event_time.rb" "test/test_file_wrapper.rb" "test/test_filter.rb" "test/test_fluent_log_event_router.rb" "test/test_formatter.rb" "test/test_input.rb" "test/test_log.rb" "test/test_match.rb" "test/test_mixin.rb" "test/test_msgpack_factory.rb" "test/test_oj_options.rb" "test/test_output.rb" "test/test_plugin.rb" "test/test_plugin_classes.rb" "test/test_plugin_helper.rb" "test/test_plugin_id.rb" "test/test_process.rb" "test/test_root_agent.rb" "test/test_static_config_analysis.rb" "test/test_supervisor.rb" "test/test_test_drivers.rb" "test/test_time_formatter.rb" "test/test_time_parser.rb" "test/test_tls.rb" "test/test_unique_id.rb" "test/test_variable_store.rb" ]
/home/daipom/.rbenv/versions/3.2.2/bin/bundle:25:in `load'
/home/daipom/.rbenv/versions/3.2.2/bin/bundle:25:in `<main>'
Tasks: TOP => test => base_test
(See full trace by running task with --trace)

Additional context

No response

@daipom daipom added bug Something isn't working and removed waiting-for-triage labels May 7, 2024
@daipom daipom changed the title 'console' gem v1.25 caueses LoadError 'console' gem v1.25 causes LoadError May 7, 2024
@daipom
Copy link
Contributor Author

daipom commented May 7, 2024

@daipom
Copy link
Contributor Author

daipom commented May 7, 2024

There would be two options:

  • A: Fix the require path for console v1.25
  • B: Stay using console v1.24

daipom added a commit that referenced this issue May 22, 2024
console gem v1.25 causes LoadError because it has changed some
namepaths (#4487).
v1.25 has been supported on the master branch at
b15cda4, but on v1.16, we should
keep v1.24 to prioritize stability.

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
daipom added a commit that referenced this issue May 22, 2024
console gem v1.25 causes LoadError because it has changed some
namepaths (#4487).
v1.25 has been supported on the master branch at
b15cda4, but on v1.16, we should
keep v1.24 to prioritize stability.

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant