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

Fails under Rails 7.1 : logger.rb:18:in `to_s': wrong number of arguments #633

Closed
mtparet opened this issue Oct 12, 2023 · 7 comments
Closed
Labels

Comments

@mtparet
Copy link

mtparet commented Oct 12, 2023

Expected behavior

Run without error.

Actual behavior

Raise error

Failure Logs

$ rails s
=> Booting Puma
=> Rails 7.1.0 application starting in development 
=> Run `bin/rails server --help` for more startup options
Exiting
/home/.rvm/gems/ruby-3.2.0/gems/forest_liana-8.0.13/config/initializers/logger.rb:18:in `to_s': wrong number of arguments (given 1, expected 0) (ArgumentError)
	from /home/.rvm/gems/ruby-3.2.0/gems/forest_liana-8.0.13/config/initializers/logger.rb:18:in `block in log'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/logger.rb:743:in `format_message'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/logger.rb:666:in `add'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/logger.rb:707:in `error'
	from /home/.rvm/gems/ruby-3.2.0/gems/forest_liana-8.0.13/lib/forest_liana/bootstrapper.rb:32:in `initialize'
	from /home/.rvm/gems/ruby-3.2.0/gems/forest_liana-8.0.13/lib/forest_liana/engine.rb:106:in `new'
	from /home/.rvm/gems/ruby-3.2.0/gems/forest_liana-8.0.13/lib/forest_liana/engine.rb:106:in `block in <class:Engine>'
	from /home/.rvm/gems/ruby-3.2.0/gems/activesupport-7.1.0/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
	from /home/.rvm/gems/ruby-3.2.0/gems/activesupport-7.1.0/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
	from /home/.rvm/gems/ruby-3.2.0/gems/activesupport-7.1.0/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
	from /home/.rvm/gems/ruby-3.2.0/gems/activesupport-7.1.0/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
	from /home/.rvm/gems/ruby-3.2.0/gems/activesupport-7.1.0/lib/active_support/lazy_load_hooks.rb:77:in `each'
	from /home/.rvm/gems/ruby-3.2.0/gems/activesupport-7.1.0/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/application/finisher.rb:93:in `block in <module:Finisher>'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/initializable.rb:32:in `instance_exec'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/initializable.rb:32:in `run'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/initializable.rb:61:in `block in run_initializers'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:228:in `block in tsort_each'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:431:in `each_strongly_connected_component_from'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:349:in `block in each_strongly_connected_component'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:347:in `each'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:347:in `call'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:347:in `each_strongly_connected_component'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:226:in `tsort_each'
	from /home/.rvm/rubies/ruby-3.2.0/lib/ruby/3.2.0/tsort.rb:205:in `tsort_each'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/initializable.rb:60:in `run_initializers'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/application.rb:423:in `initialize!'
	from /home/app/config/environment.rb:5:in `<main>'
	from config.ru:3:in `require_relative'
	from config.ru:3:in `block in <main>'
	from /home/.rvm/gems/ruby-3.2.0/gems/rack-3.0.8/lib/rack/builder.rb:103:in `eval'
	from /home/.rvm/gems/ruby-3.2.0/gems/rack-3.0.8/lib/rack/builder.rb:103:in `new_from_string'
	from /home/.rvm/gems/ruby-3.2.0/gems/rack-3.0.8/lib/rack/builder.rb:94:in `load_file'
	from /home/.rvm/gems/ruby-3.2.0/gems/rack-3.0.8/lib/rack/builder.rb:64:in `parse_file'
	from /home/.rvm/gems/ruby-3.2.0/gems/rackup-2.1.0/lib/rackup/server.rb:354:in `build_app_and_options_from_config'
	from /home/.rvm/gems/ruby-3.2.0/gems/rackup-2.1.0/lib/rackup/server.rb:263:in `app'
	from /home/.rvm/gems/ruby-3.2.0/gems/rackup-2.1.0/lib/rackup/server.rb:424:in `wrapped_app'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/commands/server/server_command.rb:76:in `log_to_stdout'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/commands/server/server_command.rb:36:in `start'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/commands/server/server_command.rb:145:in `block in perform'
	from <internal:kernel>:90:in `tap'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/commands/server/server_command.rb:136:in `perform'
	from /home/.rvm/gems/ruby-3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
	from /home/.rvm/gems/ruby-3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/command/base.rb:178:in `invoke_command'
	from /home/.rvm/gems/ruby-3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/command/base.rb:73:in `perform'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/command.rb:71:in `block in invoke'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/command.rb:149:in `with_argv'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/command.rb:69:in `invoke'
	from /home/.rvm/gems/ruby-3.2.0/gems/railties-7.1.0/lib/rails/commands.rb:18:in `<main>'
	from /home/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /home/.rvm/gems/ruby-3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from bin/rails:4:in `<main>'

Context

Bare metal Rails app

  • Package Version: 8.0.13
  • Rails Version: 7.1
  • Database Dialect:
  • Database Version:
@marinados
Copy link

indeed, could you please check this out?

@matthv
Copy link
Member

matthv commented Oct 13, 2023

Sorry for my late message

The issue seems to come from the logger which does not display the datetime parameter to string.
(https://github.com/ForestAdmin/forest-rails/blob/main/config/initializers/logger.rb#L18)

I think there must be another error hidden by this one.
Have you by any chance customised the ForestLiana.logger because I can't reproduce the issue on my end.

Could you also give me more information about your project (database, ruby version)?

@matthv
Copy link
Member

matthv commented Oct 13, 2023

Can you also see if rails dev:cache is enabled.

@matthv
Copy link
Member

matthv commented Oct 13, 2023

I have just made a fix on the branch: "fix/logger-display-datetime".
This fixes the issue of displaying the datetime.

We are going to merge it next week.

On the other hand, I have managed to reproduce the error, which comes from the cache not being enabled on the development environment.

@marinados
Copy link

just tried, it's working well, thanks for your reactivity @matthv !

@matthv matthv closed this as completed in e356b83 Oct 16, 2023
forest-bot added a commit that referenced this issue Oct 16, 2023
## [8.0.14](v8.0.13...v8.0.14) (2023-10-16)

### Bug Fixes

* **logger:** format of the datetime ([#634](#634)) ([e356b83](e356b83)), closes [#633](#633)
@forest-bot
Copy link
Member

🎉 This issue has been resolved in version 8.0.14 🎉

The release is available on:

Your semantic-release bot 📦🚀

@mtparet
Copy link
Author

mtparet commented Oct 16, 2023

Thank you !

HiroshiWatanabe1011 added a commit to HiroshiWatanabe1011/Forest-Rails that referenced this issue Jun 3, 2024
## [8.0.14](ForestAdmin/forest-rails@v8.0.13...v8.0.14) (2023-10-16)

### Bug Fixes

* **logger:** format of the datetime ([#634](ForestAdmin/forest-rails#634)) ([e356b83](ForestAdmin/forest-rails@e356b83)), closes [#633](ForestAdmin/forest-rails#633)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants