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

NoMethodError(private method 'handle_open'...) #7

Open
joelmoss opened this issue Jan 6, 2025 · 6 comments
Open

NoMethodError(private method 'handle_open'...) #7

joelmoss opened this issue Jan 6, 2025 · 6 comments
Labels
question Further information is requested

Comments

@joelmoss
Copy link

joelmoss commented Jan 6, 2025

This occurs each time it tries to connect...

Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)
There was an exception - NoMethodError(private method 'handle_open' called for an instance of ApplicationCable::Connection)
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/server/socket.rb:124:in 'ActionCable::Server::Socket#handle_open'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/server/worker.rb:60:in 'block in ActionCable::Server::Worker#invoke'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:121:in 'block in ActiveSupport::Callbacks#run_callbacks'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/tagged_logging.rb:138:in 'block in ActiveSupport::TaggedLogging#tagged'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/tagged_logging.rb:38:in 'ActiveSupport::TaggedLogging::Formatter#tagged'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/tagged_logging.rb:138:in 'ActiveSupport::TaggedLogging#tagged'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/broadcast_logger.rb:241:in 'ActiveSupport::BroadcastLogger#method_missing'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/server/tagged_logger_proxy.rb:28:in 'ActionCable::Server::TaggedLoggerProxy#tag'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/server/worker/active_record_connection_management.rb:18:in 'ActionCable::Server::Worker::ActiveRecordConnectionManagement#with_database_connections'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:130:in 'block in ActiveSupport::Callbacks#run_callbacks'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/engine.rb:81:in 'block (4 levels) in <class:Engine>'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/execution_wrapper.rb:91:in 'ActiveSupport::ExecutionWrapper.wrap'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/engine.rb:76:in 'block (3 levels) in <class:Engine>'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:130:in 'BasicObject#instance_exec'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:130:in 'block in ActiveSupport::Callbacks#run_callbacks'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/activesupport-7.2.2.1/lib/active_support/callbacks.rb:141:in 'ActiveSupport::Callbacks#run_callbacks'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/server/worker.rb:43:in 'ActionCable::Server::Worker#work'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/server/worker.rb:59:in 'ActionCable::Server::Worker#invoke'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/actioncable-next-0.1.1/lib/action_cable/server/worker.rb:54:in 'block in ActionCable::Server::Worker#async_invoke'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:359:in 'Concurrent::RubyThreadPoolExecutor::Worker#run_task'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:350:in 'block (3 levels) in Concurrent::RubyThreadPoolExecutor::Worker#create_worker'
<internal:kernel>:168:in 'Kernel#loop'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:341:in 'block (2 levels) in Concurrent::RubyThreadPoolExecutor::Worker#create_worker'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in 'Kernel#catch'
/Users/joelmoss/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby/concurrent/executor/ruby_thread_pool_executor.rb:340:in 'block in Concurrent::RubyThreadPoolExecutor::Worker#create_worker'
@palkan
Copy link
Member

palkan commented Jan 7, 2025

Interesting. The #handle_open method in the base class is public:

Don't you override the #handle_open in your ApplicationCable::Connection class? What's the output of ApplicationCable::Connection.instance_method(:handle_open).source_location?

@palkan palkan added the question Further information is requested label Jan 7, 2025
@joelmoss
Copy link
Author

joelmoss commented Jan 7, 2025

Ok, so it's sentry-rails at https://github.com/getsentry/sentry-ruby/blob/master/sentry-rails/lib/sentry/rails/action_cable.rb which is private. But I also notice that the original handle_open method in Rails is also private https://github.com/rails/rails/blob/main/actioncable/lib/action_cable/connection/base.rb#L199

@palkan
Copy link
Member

palkan commented Jan 7, 2025

the original handle_open method in Rails is also private

Yeah, but that's the point of this re-architecture to redefine the boundaries.

I pushed a workaround; could you please installing from main and check if it fixed the issue?

@joelmoss
Copy link
Author

joelmoss commented Jan 7, 2025

Yeah, but that's the point of this re-architecture to redefine the boundaries.

Of course 👍

Tried from main, but still same error, and source_location is still sentry-rails.

@palkan
Copy link
Member

palkan commented Jan 9, 2025

Okay, I pushed another fix; this time, works for me locally.

@joelmoss
Copy link
Author

joelmoss commented Jan 9, 2025

Amazing! That works perfectly! Thanks 🙏

Any word on if and when we can expect this to be part of Rails proper?

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

No branches or pull requests

2 participants