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

v4.2.2 upgrade breaks AppSignal Logger #1349

Closed
JosephTico opened this issue Dec 16, 2024 · 4 comments · Fixed by #1351
Closed

v4.2.2 upgrade breaks AppSignal Logger #1349

JosephTico opened this issue Dec 16, 2024 · 4 comments · Fixed by #1351
Labels

Comments

@JosephTico
Copy link

This is potentially related to #1348, seems like there's a major bug right now in version 4.2.2 that is breaking multiple parts of Rails. In my case, I used the AppSignal logger in Sidekiq and with this update now Sidekiq workers are completely broken.


Describe the bug

wrong number of arguments (given 3, expected 1) at lib/appsignal/logger.rb:154 tagged |  
lib/active_support/broadcast_logger.rb:241 method_missing |  
lib/active_support/broadcast_logger.rb:243 block in method_missing |  
lib/active_support/broadcast_logger.rb:243 map |  
lib/active_support/broadcast_logger.rb:243 method_missing |  
lib/active_job/logging.rb:25 tag_logger |  
lib/active_job/logging.rb:18 perform_now |  
lib/active_job/execution.rb:29 block in execute |  
lib/active_support/callbacks.rb:121 block in run_callbacks |  
lib/active_job/railtie.rb:67 block (4 levels) in <class:Railtie> |  
lib/active_support/reloader.rb:77 block in wrap |  
lib/active_support/execution_wrapper.rb:88 wrap |  
lib/active_support/reloader.rb:74 wrap |  
lib/active_job/railtie.rb:66 block (3 levels) in <class:Railtie> |  
lib/active_support/callbacks.rb:130 instance_exec |  
lib/active_support/callbacks.rb:130 block in run_callbacks |  
lib/active_support/callbacks.rb:141 run_callbacks |  
lib/active_job/execution.rb:27 execute |  
lib/appsignal/hooks/active_job.rb:69 execute |  
lib/active_job/queue_adapters/sidekiq_adapter.rb:10 perform |  
lib/sidekiq/processor.rb:220 execute_job |  
lib/sidekiq/processor.rb:185 block (4 levels) in process |  
lib/sidekiq/middleware/chain.rb:180 traverse |  
lib/sidekiq/middleware/chain.rb:183 block in traverse |  
lib/sidekiq/worker_killer.rb:61 call |  
lib/sidekiq/middleware/chain.rb:182 traverse |  
lib/sidekiq/middleware/chain.rb:183 block in traverse |  
lib/sidekiq_unique_jobs/middleware.rb:36 call |  
lib/sidekiq/middleware/chain.rb:182 traverse |  
lib/sidekiq/middleware/chain.rb:183 block in traverse |  
lib/sidekiq-status/server_middleware.rb:42 call |  
lib/sidekiq/middleware/chain.rb:182 traverse |  
lib/sidekiq/middleware/chain.rb:183 block in traverse |  
lib/sidekiq/batch/middleware.rb:30 call |  
lib/sidekiq/middleware/chain.rb:182 traverse |  
lib/sidekiq/middleware/chain.rb:183 block in traverse |  
lib/sidekiq/job/interrupt_handler.rb:9 call |  
lib/sidekiq/middleware/chain.rb:182 traverse |  
lib/sidekiq/middleware/chain.rb:183 block in traverse |  
lib/sidekiq/metrics/tracking.rb:26 track |  
lib/sidekiq/metrics/tracking.rb:134 call |  
lib/sidekiq/middleware/chain.rb:182 traverse |  
lib/sidekiq/middleware/chain.rb:183 block in traverse |  
lib/appsignal/transaction.rb:579 instrument |  
lib/appsignal/helpers/instrumentation.rb:756 instrument |  
lib/appsignal/integrations/sidekiq.rb:70 call |  
lib/sidekiq/middleware/chain.rb:182 traverse |  
lib/sidekiq/middleware/chain.rb:173 invoke |  
lib/sidekiq/processor.rb:184 block (3 levels) in process |  
lib/sidekiq/processor.rb:145 block (6 levels) in dispatch |  
lib/sidekiq/job_retry.rb:118 local |  
lib/sidekiq/processor.rb:144 block (5 levels) in dispatch |  
lib/sidekiq/rails.rb:16 block in call |  
lib/active_support/reloader.rb:77 block in wrap |  
lib/active_support/execution_wrapper.rb:92 wrap |  
lib/active_support/reloader.rb:74 wrap |  
lib/sidekiq/rails.rb:15 call |  
lib/sidekiq/processor.rb:139 block (4 levels) in dispatch |  
lib/sidekiq/processor.rb:281 stats |  
lib/sidekiq/processor.rb:134 block (3 levels) in dispatch |  
lib/sidekiq/job_logger.rb:15 call |  
lib/sidekiq/processor.rb:133 block (2 levels) in dispatch |  
lib/sidekiq/job_retry.rb:85 global |  
lib/sidekiq/processor.rb:132 block in dispatch |  
lib/sidekiq/job_logger.rb:40 prepare |  
lib/sidekiq/processor.rb:131 dispatch |  
lib/sidekiq/processor.rb:183 block (2 levels) in process |  
lib/sidekiq/processor.rb:182 handle_interrupt |  
lib/sidekiq/processor.rb:182 block in process |  
lib/sidekiq/processor.rb:181 handle_interrupt |  
lib/sidekiq/processor.rb:181 process |  
lib/sidekiq/processor.rb:86 process_one |  
lib/sidekiq/processor.rb:76 run |  
lib/sidekiq/component.rb:10 watchdog |  
lib/sidekiq/component.rb:19 block in safe_thread

To Reproduce

Steps to reproduce the behavior:

  • Using AppSignal for Ruby gem version 4.2.2
  • Using Rails 7.1.5.1, Sidekiq 7.3.6
  • Relevant sidekiq.rb config:
    Sidekiq.configure_server do |config|	
        # Logging to Appsignal
        config.logger = ActiveSupport::BroadcastLogger.new(
          Sidekiq::Logger.new($stdout),
          Appsignal::Logger.new('sidekiq')
        )
      end
    
@JosephTico JosephTico added the bug label Dec 16, 2024
@unflxw
Copy link
Contributor

unflxw commented Dec 17, 2024

Hi @JosephTico!

Thank you for reporting this! Indeed, this is the same issue as #1348. We have just released AppSignal for Ruby 4.2.3, with a fix for this issue.

@unflxw unflxw closed this as completed Dec 17, 2024
@unflxw
Copy link
Contributor

unflxw commented Dec 17, 2024

Hi @JosephTico,

I believe my previous message was mistaken. This is not the same issue as #1348, and as such was not fixed by #1350, which was released in AppSignal for Ruby 4.2.3.

I have a fix for this issue at #1351, and we will release it shortly. In the meantime, consider downgrading to AppSignal for Ruby 4.2.1.

@unflxw
Copy link
Contributor

unflxw commented Dec 18, 2024

There will be a delay in releasing this fix, as there is a broader issue with using broadcast loggers alongside tagged logging (see #1352) and we'd like to provide a fix or workaround to it, rather than fixing this aspect of it only to trigger further breakage.

@unflxw
Copy link
Contributor

unflxw commented Dec 20, 2024

Hi @JosephTico @BeatyThomas,

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.

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.

2 participants