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

4.2.1 -> 4.2.2 Upgrade breaks Puma startup #1348

Closed
tadasant opened this issue Dec 16, 2024 · 6 comments · Fixed by #1350
Closed

4.2.1 -> 4.2.2 Upgrade breaks Puma startup #1348

tadasant opened this issue Dec 16, 2024 · 6 comments · Fixed by #1350
Labels

Comments

@tadasant
Copy link

tadasant commented Dec 16, 2024

Describe the bug

I noticed this when our CI/CD started breaking on a PR that is solely an upgrade from 4.2.1 to 4.2.2.

Here's the stacktrace when trying to load a page:

Puma caught this error: wrong number of arguments (given 0, expected 1) (ArgumentError)
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/appsignal-4.2.2/lib/appsignal/logger.rb:162:in `push_tags'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/activesupport-8.0.0.1/lib/active_support/broadcast_logger.rb:243:in `block in method_missing'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/activesupport-8.0.0.1/lib/active_support/broadcast_logger.rb:243:in `map'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/activesupport-8.0.0.1/lib/active_support/broadcast_logger.rb:243:in `method_missing'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.1/lib/rails/rack/logger.rb:24:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/remote_ip.rb:96:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/request_id.rb:34:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rack-3.1.8/lib/rack/method_override.rb:28:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rack-3.1.8/lib/rack/runtime.rb:24:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/activesupport-8.0.0.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/server_timing.rb:61:in `block in call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/server_timing.rb:26:in `collect_events'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/server_timing.rb:60:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/executor.rb:16:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/static.rb:27:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rack-3.1.8/lib/rack/sendfile.rb:114:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/actionpack-8.0.0.1/lib/action_dispatch/middleware/host_authorization.rb:143:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/rack-3.1.8/lib/rack/events.rb:116:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.1/lib/rails/engine.rb:535:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/configuration.rb:279:in `call'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/request.rb:99:in `block in handle_request'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/thread_pool.rb:389:in `with_force_shutdown'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/request.rb:98:in `handle_request'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/server.rb:468:in `process_client'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/server.rb:249:in `block in run'
/Users/admin/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/thread_pool.rb:166:in `block in spawn_thread'

To Reproduce

Steps to reproduce the behavior:

  • Use puma 6.5.0 with Rails 8.0.0.1
  • My logging initializer is:
appsignal_logger = Appsignal::Logger.new("rails")
Rails.logger.broadcast_to(appsignal_logger)

Let me know if you need more details.

@tombruijn
Copy link
Member

Hi @tadasant, I made a fix for this in #1350
Please downgrade for now and update when our next with this fix is out :)

@unflxw unflxw closed this as completed in 8f37307 Dec 17, 2024
unflxw added a commit to appsignal/test-setups that referenced this issue Dec 17, 2024
Copy the logging initialisers for Rails and Sidekiq from the
`ruby/rails7-sidekiq` test setup into the `ruby/rails8-sidekiq`
test setup.

In the future, this might help us detect issues like
appsignal/appsignal-ruby#1348 before they impact our customers.
@unflxw
Copy link
Contributor

unflxw commented Dec 17, 2024

Hi @tadasant, thank you for reporting this issue. We have just released AppSignal for Ruby 4.2.3, with a fix for this issue.

@jeffbax
Copy link

jeffbax commented Dec 17, 2024

Hey folks, I am still seeing this error as Puma boots with 4.2.3 -- with this stack

Puma caught this error: wrong number of arguments (given 0, expected 1) (ArgumentError)
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/appsignal-4.2.3/lib/appsignal/logger.rb:154:in `tagged'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.1.5.1/lib/active_support/broadcast_logger.rb:243:in `block in method_missing'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.1.5.1/lib/active_support/broadcast_logger.rb:243:in `map'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.1.5.1/lib/active_support/broadcast_logger.rb:243:in `method_missing'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/railties-7.1.5.1/lib/rails/rack/logger.rb:24:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/remote_ip.rb:92:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/rack-timeout-0.6.3/lib/rack/timeout/core.rb:111:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/request_store-1.7.0/lib/request_store/middleware.rb:19:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/request_id.rb:28:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/rack-2.2.10/lib/rack/method_override.rb:24:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/rack-2.2.10/lib/rack/runtime.rb:22:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/activesupport-7.1.5.1/lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/server_timing.rb:59:in `block in call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/server_timing.rb:24:in `collect_events'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/server_timing.rb:58:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/executor.rb:14:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/static.rb:25:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/rack-2.2.10/lib/rack/sendfile.rb:110:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/actionpack-7.1.5.1/lib/action_dispatch/middleware/host_authorization.rb:141:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/rack-2.2.10/lib/rack/events.rb:112:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/utf8-cleaner-1.0.0/lib/utf8-cleaner/middleware.rb:21:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/shakapacker-8.0.2/lib/shakapacker/dev_server_proxy.rb:25:in `perform_request'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/rack-proxy-0.7.7/lib/rack/proxy.rb:87:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/railties-7.1.5.1/lib/rails/engine.rb:536:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/configuration.rb:279:in `call'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/request.rb:99:in `block in handle_request'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/thread_pool.rb:389:in `with_force_shutdown'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/request.rb:98:in `handle_request'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/server.rb:468:in `process_client'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/server.rb:249:in `block in run'
.rbenv/versions/3.3.6/lib/ruby/gems/3.3.0/gems/puma-6.5.0/lib/puma/thread_pool.rb:166:in `block in spawn_thread'
  • Appsignal @ 4.2.3
  • Rails @ 7.1.5.1
  • Puma @ 6.5.0
  • Rack @ 2.2.10

My Appsignal logger is configured similarly to OP (except for an additional independent one for LogRage)

@unflxw
Copy link
Contributor

unflxw commented Dec 17, 2024

Hi @jeffbax, thank you for reporting this. The issue in your backtrace is actually that at #1349. There will be a fix for it shortly; in the meantime, consider downgrading to AppSignal for Ruby 4.2.1.

@unflxw
Copy link
Contributor

unflxw commented Dec 20, 2024

Hi @jeffbax @tadasant,

We've now released AppSignal for Ruby 4.3.0, which fixes this issue, as well as other issues adjacent to it. We recommend upgrading to it.

If you use ActiveSupport::BroadcastLogger (the #broadcast_to method in Rails.logger) to send logs to several loggers, see our Rails logging documentation for our recommended alternative.

@tadasant
Copy link
Author

Thanks! Confirming that my upgrade from 4.2.1 -> 4.3.1 went smoothly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants