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

protected method `close' called for #<Slack::RealTime::Concurrency::Eventmachine::Socket> #101

Closed
MeFisto94 opened this issue Aug 11, 2016 · 7 comments

Comments

@MeFisto94
Copy link

Hey Guys,
So I'm running a slack-ruby-bot Instance which crashes after a few days with the follwing log:

D, [2016-08-08T20:27:45.581413 #31690] DEBUG -- Slack::RealTime::Concurrency::Eventmachine::Client#parse: ?
D, [2016-08-08T20:28:15.350145 #31690] DEBUG -- Slack::RealTime::Concurrency::Eventmachine::Client#write: ??Jb?.|[?%
D, [2016-08-08T20:28:15.450797 #31690] DEBUG -- Slack::RealTime::Concurrency::Eventmachine::Client#parse: ?26969
D, [2016-08-08T20:28:15.550543 #31690] DEBUG -- Slack::RealTime::Concurrency::Eventmachine::Client#parse: ?
D, [2016-08-08T20:28:27.101091 #31690] DEBUG -- Slack::RealTime::Concurrency::Eventmachine::Client#parse: ?{}
D, [2016-08-08T20:28:27.101370 #31690] DEBUG -- SlackRubyBot::Client#run_loop: Faye::WebSocket::API::MessageEvent, {}
D, [2016-08-08T20:28:27.186170 #31690] DEBUG -- SlackRubyBot::Client#run_loop: Faye::WebSocket::API::CloseEvent
I, [2016-08-08T20:28:27.187221 #31690]  INFO -- : post https://slack.com/api/rtm.start
D, [2016-08-08T20:28:27.187309 #31690] DEBUG -- request: Accept: "application/json; charset=utf-8"
User-Agent: "Slack Ruby Client/0.7.5"
Content-Type: "application/x-www-form-urlencoded"
I, [2016-08-08T20:28:28.255121 #31690]  INFO -- Status: 200
D, [2016-08-08T20:28:28.255293 #31690] DEBUG -- response: content-type: "application/json; charset=utf-8"
transfer-encoding: "chunked"
connection: "close"
access-control-allow-origin: "*"
cache-control: "private, no-cache, no-store, must-revalidate"
content-security-policy: "referrer no-referrer;"
date: "Mon, 08 Aug 2016 18:28:27 GMT"
expires: "Mon, 26 Jul 1997 05:00:00 GMT"
pragma: "no-cache"
server: "Apache"
strict-transport-security: "max-age=31536000; includeSubDomains; preload"
vary: "Accept-Encoding"
x-accepted-oauth-scopes: "rtm:stream,client"
x-content-type-options: "nosniff"
x-oauth-scopes: "identify,read,post,client,apps"
x-slack-backend: "z"
x-slack-req-id: "08e494fa-6f26-4478-b043-b48adfcf281a"
x-xss-protection: "0"
x-cache: "Miss from cloudfront"
via: "1.1 f165ce34daf8c0da182681179e863c24.cloudfront.net (CloudFront)"
x-amz-cf-id: "nvTrzO6sUwGqt0lAozyRMCZtTATHlbNy-5kSa87jZ8277spSWUsCdQ=="
D, [2016-08-08T20:28:28.355957 #31690] DEBUG -- Slack::RealTime::Concurrency::Eventmachine::Socket#connect!: Slack::RealTime::Concurrency::Eventmachine::Client
E, [2016-08-08T20:28:28.356483 #31690] ERROR -- : protected method `close' called for #<Slack::RealTime::Concurrency::Eventmachine::Socket:0x00000001969d70> (NoMethodError)
/var/lib/gems/1.9.1/gems/slack-ruby-client-0.7.5/lib/slack/real_time/client.rb:144:in `block in close'
/var/lib/gems/1.9.1/gems/slack-ruby-client-0.7.5/lib/slack/real_time/client.rb:143:in `each'
/var/lib/gems/1.9.1/gems/slack-ruby-client-0.7.5/lib/slack/real_time/client.rb:143:in `close'
/var/lib/gems/1.9.1/gems/slack-ruby-client-0.7.5/lib/slack/real_time/client.rb:99:in `block (2 levels) in run_loop'
/var/lib/gems/1.9.1/gems/websocket-driver-0.6.4/lib/websocket/driver/event_emitter.rb:39:in `call'
/var/lib/gems/1.9.1/gems/websocket-driver-0.6.4/lib/websocket/driver/event_emitter.rb:39:in `block in emit'
/var/lib/gems/1.9.1/gems/websocket-driver-0.6.4/lib/websocket/driver/event_emitter.rb:38:in `each'
/var/lib/gems/1.9.1/gems/websocket-driver-0.6.4/lib/websocket/driver/event_emitter.rb:38:in `emit'
/var/lib/gems/1.9.1/gems/faye-websocket-0.10.4/lib/faye/websocket/api/event_target.rb:44:in `dispatch_event'
/var/lib/gems/1.9.1/gems/faye-websocket-0.10.4/lib/faye/websocket/api.rb:143:in `finalize_close'
/var/lib/gems/1.9.1/gems/faye-websocket-0.10.4/lib/faye/websocket/client.rb:75:in `unbind'
/var/lib/gems/1.9.1/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:1483:in `event_callback'
/var/lib/gems/1.9.1/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run_machine'
/var/lib/gems/1.9.1/gems/eventmachine-1.2.0.1/lib/eventmachine.rb:194:in `run'
/var/lib/gems/1.9.1/gems/slack-ruby-client-0.7.5/lib/slack/real_time/concurrency/eventmachine.rb:48:in `block in ensure_reactor_running'

With the follwing gems/versions:

builder (3.2.2)
bundler (1.12.5, 1.12.4, 1.12.3, 1.11.2)
concurrent-ruby (1.0.2)
eventmachine (1.2.0.1)
faraday (0.9.2, 0.9.0, 0.8.8)
faraday_middleware (0.10.0, 0.9.2, 0.9.1, 0.9.0)
faraday_middleware-parse_oj (0.3.0)
faye-websocket (0.10.4, 0.10.3)
giphy (3.0.0, 2.0.2)
slack-ruby-bot (0.8.2, 0.8.0, 0.7.0)
slack-ruby-client (0.7.6, 0.7.5, 0.7.3, 0.7.0)
websocket (1.2.3, 1.2.2)
websocket-driver (0.6.4, 0.6.3)
websocket-extensions (0.1.2)

(Some Gems omitted).
Any help appreciated 😄

@dblock
Copy link
Collaborator

dblock commented Aug 11, 2016

That just looks like a bug with EventMachine, as the RealTime client calls close. It needs a spec and, likely a trivial fix. For Celluloid the close method is public, and for EventMachine it's inherited and is private. Please feel free to contribute, I will eventually fix this either way, but can't promise it fast.

@MeFisto94
Copy link
Author

I'm currently too busy to do and also not really experienced with ruby so I'll gladly wait :)

@dblock
Copy link
Collaborator

dblock commented Aug 19, 2016

Fixed in https://github.com/dblock/slack-ruby-client/pull/102, please do try it from HEAD @MeFisto94 let me know if that worked?

@MeFisto94
Copy link
Author

I'll try but it takes some time until it appears again.
Unfortunately I was unable to get the latest version using bundler, which might be related to my old debian still being on ruby 1.9.1

Fetching git://github.com/dblock/slack-ruby-client.git
There was a RuntimeError while loading slack-ruby-client.gemspec: 
can't modify frozen String from
  /var/lib/gems/1.9.1/bundler/gems/slack-ruby-client-7665e857fe04/slack-ruby-client.gemspec:8:in `block in <main>'

@dblock
Copy link
Collaborator

dblock commented Aug 20, 2016

Generally, you definitely want to update Ruby to 2.3.x and bundler along with it. This is just the first error, there will be a lot more.

@dblock
Copy link
Collaborator

dblock commented Aug 29, 2016

This was released in 0.7.7.

@MeFisto94
Copy link
Author

Just wanted to give feedback. I managed to update Ruby and didn't experience a crash since then (10 days), so it indeed seems solved.

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

No branches or pull requests

2 participants