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

ActiveSupport::Logger.broadcast method is dropped #188

Closed
kalashnikovisme opened this issue Sep 27, 2023 · 8 comments
Closed

ActiveSupport::Logger.broadcast method is dropped #188

kalashnikovisme opened this issue Sep 27, 2023 · 8 comments

Comments

@kalashnikovisme
Copy link

kalashnikovisme commented Sep 27, 2023

Ruby version:
Ruby 3.2.2

Rails version:
7.1.0.rc1

anycable gem version:
1.4.2

anycable-rails gem version:
1.4.0

grpc gem version:
1.58.0-x86_64-linux

What did you do?

Tried to run my application with new Rails 7.1.0.rc1

What did you expect to happen?

Everything should work as before Rails upgrade.

What actually happened?

Got this error

ecwidai-anycable-1  | undefined method `broadcast' for ActiveSupport::Logger:Class
ecwidai-anycable-1  | /usr/local/bundle/gems/anycable-rails-1.4.0/lib/anycable/rails/railtie.rb:31:in `block (2 levels) in <class:Railtie>'
ecwidai-anycable-1  | /usr/local/bundle/gems/anycable-core-1.4.1/lib/anycable/cli.rb:175:in `each'
ecwidai-anycable-1  | /usr/local/bundle/gems/anycable-core-1.4.1/lib/anycable/cli.rb:175:in `configure_server!'
ecwidai-anycable-1  | /usr/local/bundle/gems/anycable-core-1.4.1/lib/anycable/cli.rb:52:in `run'
ecwidai-anycable-1  | /usr/local/bundle/gems/anycable-core-1.4.1/bin/anycable:7:in `<top (required)>'
ecwidai-anycable-1  | /usr/local/bundle/bin/anycable:25:in `load'
ecwidai-anycable-1  | /usr/local/bundle/bin/anycable:25:in `<top (required)>'

According to this commit in Rails repo, ActiveSupport::Logger.broadcast method is dropped.

Sidekiq has the same issue. So, it was fixed here.

I've implemented something like this in my fork. Look at this. Looks like everything works. I'm testing it right now.

Didn't submit a PR cause I don't know how you manage Rails versions differences 🙂

@palkan
Copy link
Member

palkan commented Sep 28, 2023

Thanks!

Fixed and released in 1.4.1

@MBM1607
Copy link

MBM1607 commented Dec 8, 2023

@palkan I am experiencing the same error even though I am using the latest version.

Ruby version: 3.2.2
Rails version: 7.1.2
anycable Gem Version: 1.4.3
anycable-rails Gem Version: 1.4.2

@palkan
Copy link
Member

palkan commented Dec 8, 2023

Hey @MBM1607

Could you please share a stack trace?

@MBM1607
Copy link

MBM1607 commented Dec 8, 2023

Yes, sure. Sorry, I should have included it with the original message.

Error

anycable | undefined method `broadcast' for ActiveSupport::Logger:Class
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/anycable-rails-core-1.4.2/lib/anycable/rails/railtie.rb:37:in `block (2 levels) in <class:Railtie>'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/anycable-core-1.4.3/lib/anycable/cli.rb:175:in `each'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/anycable-core-1.4.3/lib/anycable/cli.rb:175:in `configure_server!'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/anycable-core-1.4.3/lib/anycable/cli.rb:52:in `run'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/anycable-core-1.4.3/bin/anycable:7:in `<top (required)>'
anycable | /home/muhammad/.rbenv/versions/3.2.2/bin/anycable:25:in `load'
anycable | /home/muhammad/.rbenv/versions/3.2.2/bin/anycable:25:in `<top (required)>'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:58:in `load'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:58:in `kernel_load'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:23:in `run'
anycable | /home/muhammad/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bundler-2.4.22/lib/bundler/cli.rb:492:in `exec'

@palkan
Copy link
Member

palkan commented Dec 12, 2023

@MBM1607 Thanks! How do you configure your logger? I guess, you're not using the default one. I pushed a fix to master, could you please check it?

@MBM1607
Copy link

MBM1607 commented Dec 12, 2023

@palkan The logger is the default one, but I am using overmind to run several processes at once, which is why the stack trace looks different.

Let me try with your latest fix, I will get back to you.

@MBM1607
Copy link

MBM1607 commented Dec 13, 2023

@palkan It is working flawlessly with the latest fix.

@palkan
Copy link
Member

palkan commented Dec 13, 2023

Thanks! Released in 1.4.3

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

No branches or pull requests

3 participants