-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
RTM connection fails in large org but works in small org #134
Comments
UPDATE: I pinged Slack's API help team about this and got the following response:
/cc @macobo |
Indeed, there's a very large payload coming back from the initial Then disable any client-side parsing of that data with |
There's a feature request on supplying a custom Faraday connection in #72. There's an unfinished pull request for adding a timeout option in #74. In the meantime you can probably test other connection options with some editing of https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/web/faraday/connection.rb or monkey-patching. |
This solves issues raised in slack-ruby/slack-ruby-client#134
This solves issues raised in slack-ruby/slack-ruby-client#134
This solves issues raised in slack-ruby/slack-ruby-client#134
Thanks @dblock for the suggestions - we tested with these settings, but ran into a similar issue (didn't try store_class though). Will try events API instead. Related to this issue: I think this should make |
Agreed @macobo, please contribute. |
Did anyone develop a short term solution to this? Seeing the same issue and the It did randomly work for me one time with the suggestions from @dblock with regard to reducing the size of the data coming back, about the same as the commit that @macobo referenced above. But will not work again. As far as I can tell, nothing changed between runs. UPDATE: May have been a corp network issue. Works when on regular network. |
Not familiar with how to do that, sorry. Certainly willing to assist if you can start me in the right direction. But I am starting to think that after setting simple_latest, no_unreads, and store_class that the issue may only be partially related to those. Right now, my connection works on a seemingly random interval. From the debug log I get this in all cases You probably understand the inner workings better than I do, but it seems that after the initial call to the Slack API, it returns a unique web socket to use for the rest of the communication. I am curious if the "randomness" of when my connection works and when it doesn't is caused by that web socket timing out or only being valid within a certain window? More testing needed, but it seems that it will work once, then fail for a while, and then work again a few minutes later. When it doesn't work, the error is still the same as noted above. |
Sadly I wasn't able to work on this as I don't have access to a large slack organization. @tmsteen How big is the organization you're using this gem for? |
5000+ but my intended audience within the org is much smaller. |
We also well facing the same issue setting {simple_latest: true, no_unreads:true} or store_class = nil makes no difference, is there any work around on this issue ? |
I think there's multiple factors that make debugging this hard:
One way to solve these issues is for someone with an admin in a larger account to either:
Number two is rather undesirable though due to the security implications for the account given access to. |
One data point I have notice , if using just simple client from the sample with large organization connects and established connection. The issue happens while using Slack::RealTime::Client require 'http' rc = JSON.parse HTTP.post("https://slack.com/api/rtm.start", params: { url=rc['url'] EM.run { ws.on :open do |event| ws.on :message do |event| ws.on :close do |event| |
is timeout expose anywhere in version 0.10.1? |
No @asheynkman. |
@dblock we have increased time out and its all work great. Let us know when you planing to push into release. |
Can you help finish #74 @asheynkman? Can you copy-paste some code increasing the timeout at least? |
@dblock need to add spec / README and CHANGELOG entries and will push it. |
Seems #74 was closed. @asheynkman did you just implement those same changes or did you increase timeout another way? My ability to connect to the RTM is still hit or miss. |
#74 was closed by its author, it needs to be "finished", please |
@asheynkman what |
@dblock we used 500000 for both |
I just tested #135 with a timeout and opentimeout set at 1000 just to be sure. seems to be working consistently now. Tested with both the Web and RTM clients. Edit: just saw the comment above. |
1000 should be more then enough , the units in seconds , so should be recommended value |
A 1000 seconds timeout seems like a generally bad idea, other than an "arbitrarily high number" :) What does everyone think here about changing the default. What would you do? |
i just tested with 180 sec , with account mix of channels and users around 12K , took like 2 min to download |
It's crazy that |
i don't think there are any other options unless slack redesigns their api's |
I'm just venting @asheynkman :) |
lol |
I've merged #135. To close this issue we need to increase the default timeout value for rtm_start only (not for all web API calls). |
Alright, check out #136, comment on! |
Slack added |
Hello,
I'm attempting to use a bot to connect Slack with Pagerduty: https://github.com/stripe-contrib/pagerbot
I've worked with the developer of the bot @macobo, and he suggested I file an issue here.
I've created a gist with the error logs from heroku. The first log shows the errors when running this in the large org. The second log shows the successful connection with a smaller org:
I added some comments at the bottom noting some differences, notably:
Could there be an issue with the large number of members in the org or the number of channels causing something to stall? Is there a huge payload coming back from the RTM API due to my large org?
Thanks for looking!
The text was updated successfully, but these errors were encountered: