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

Cannot install on Rails 7.1 - Google::Protobuf error #202

Closed
noctivityinc opened this issue Aug 17, 2024 · 5 comments
Closed

Cannot install on Rails 7.1 - Google::Protobuf error #202

noctivityinc opened this issue Aug 17, 2024 · 5 comments

Comments

@noctivityinc
Copy link

Tell us about your environment

ruby "3.3.4"
gem "rails", "> 7.1.3", ">= 7.1.3.4"
gem "anycable-rails", "
> 1.4"

What did you do?

All I did was install anycable-rails and then tried to run setup.

What did you expect to happen?

It would work and not crash my app

What actually happened?

11:30 AM ~/Projects/wecora/seven (ac2) => rails g anycable:setup
/Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/anycable-core-1.4.3/lib/anycable/protos/rpc_pb.rb:8:in `<main>': undefined method `build' for an instance of Google::Protobuf::DescriptorPool (NoMethodError)

Google::Protobuf::DescriptorPool.generated_pool.build do
                                               ^^^^^^
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/zeitwerk-2.6.17/lib/zeitwerk/kernel.rb:34:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/anycable-core-1.4.3/lib/anycable/rpc.rb:3:in `<main>'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/zeitwerk-2.6.17/lib/zeitwerk/kernel.rb:34:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/anycable-core-1.4.3/lib/anycable.rb:16:in `<main>'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/zeitwerk-2.6.17/lib/zeitwerk/kernel.rb:34:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/anycable-rails-core-1.4.4/lib/anycable/rails.rb:3:in `<main>'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/zeitwerk-2.6.17/lib/zeitwerk/kernel.rb:34:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/anycable-rails-core-1.4.4/lib/anycable-rails.rb:3:in `<main>'
        from <internal:/Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from <internal:/Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/site_ruby/3.3.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/zeitwerk-2.6.17/lib/zeitwerk/kernel.rb:34:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bundler-2.5.11/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bundler-2.5.11/lib/bundler/runtime.rb:55:in `each'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bundler-2.5.11/lib/bundler/runtime.rb:55:in `block in require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bundler-2.5.11/lib/bundler/runtime.rb:44:in `each'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bundler-2.5.11/lib/bundler/runtime.rb:44:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bundler-2.5.11/lib/bundler.rb:207:in `require'
        from /Users/jlippiner/Projects/wecora/seven/config/application.rb:7:in `<main>'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/command/actions.rb:15:in `require_application!'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/command/actions.rb:19:in `boot_application!'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/commands/generate/generate_command.rb:21:in `perform'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/thor-1.3.1/lib/thor/command.rb:28:in `run'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/thor-1.3.1/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/command/base.rb:178:in `invoke_command'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/thor-1.3.1/lib/thor.rb:527:in `dispatch'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/command/base.rb:73:in `perform'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/command.rb:71:in `block in invoke'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/command.rb:149:in `with_argv'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/command.rb:69:in `invoke'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/railties-7.1.3.4/lib/rails/commands.rb:18:in `<main>'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `require'
        from /Users/jlippiner/.rvm/rubies/ruby-3.3.4/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
        from /Users/jlippiner/.rvm/gems/ruby-3.3.4@wecora-7/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from bin/rails:4:in `<main>'
@palkan
Copy link
Member

palkan commented Aug 19, 2024

Looks like you've upgraded the google-protobuf gem; v4 is currently not supported; adding gem "google-protobuf", "~> 3.25" should fix the issue.

Or upgrade anycable-core (and anycable) to 1.4.4 (the protobuf version requirement has been fixed there).

@palkan palkan closed this as completed Aug 19, 2024
@noctivityinc
Copy link
Author

noctivityinc commented Aug 19, 2024 via email

@palkan
Copy link
Member

palkan commented Aug 19, 2024

anycable-rails depends on anycable-core

In your case, running bundle update anycable (or bundle update anycable-core) should do the trick; no need to add it explicitly to the Gemfile

@noctivityinc
Copy link
Author

@palkan Ok that worked with 1.5.1 but now I get this:

anycable | ⛔️ WARNING: AnyCable RPC pool size (30) is greater than DB pool size (5)

Without any information about which database or HOW to adjust the pool sizes for either AC or the DB. Any docs here?

@palkan
Copy link
Member

palkan commented Sep 3, 2024

Without any information about which database or HOW to adjust the pool sizes for either AC or the DB.

This message says that your Active Record pool size is 5 (the default), which is less than the AnyCable gRPC worker pool size (also the default, 30). To avoid competition for DB connections, it's better to keep the in sync.

Any docs here?

https://docs.anycable.io/edge/ruby/configuration?id=concurrency-settings

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

2 participants