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

First time setup, unable to load: "Slack rate limit exceeded, retry after 3s" #167

Closed
craigotis opened this issue Nov 9, 2018 · 16 comments
Assignees
Labels

Comments

@craigotis
Copy link

I just installed slack-term for the first time on my system using a legacy token. However, upon launching it sits at the LOADING screen for 3-4 second, then drops back to the shell with:

2018/11/09 16:31:49 Slack rate limit exceeded, retry after 2s

My hunch is that the first-time setup is exhausting the API rate limit? But I'm not sure if it's ever going to actually finish:

craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:31:57 Slack rate limit exceeded, retry after 3s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:32:01 Slack rate limit exceeded, retry after 3s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:32:05 Slack rate limit exceeded, retry after 3s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:32:21 Slack rate limit exceeded, retry after 3s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:32:46 Slack rate limit exceeded, retry after 2s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:34:05 Slack rate limit exceeded, retry after 2s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:43:00 Slack rate limit exceeded, retry after 3s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:48:44 Slack rate limit exceeded, retry after 3s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:49:46 Slack rate limit exceeded, retry after 3s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:50:56 Slack rate limit exceeded, retry after 2s
craig@Craigs-MBP-2:~$ slack-term
2018/11/09 16:52:23 Slack rate limit exceeded, retry after 1s

Is this a known issue? Something on my end? Is it stuck in a loop somewhere? I can try to Wireshark this if necessary but was hoping for an easier fix.

@jpbruinsslot jpbruinsslot self-assigned this Nov 10, 2018
@jpbruinsslot jpbruinsslot added this to the v0.4.2 milestone Nov 10, 2018
@jpbruinsslot
Copy link
Owner

Hmm, it could be that slack-term needs to retrieve a lot of channels and it exceeds the rate limit. Could you perhaps share to what kind of workspace you're connecting, how many channels, users, etc.

@craigotis
Copy link
Author

craigotis commented Nov 10, 2018

It's likely workspace size-related. There are hundreds of channels (maybe even 1-2k) and hundreds of users.

Other clients I've tried (https://github.com/evanyeung/terminal-slack) are able to load without issue - they just don't seem nearly as mature as slack-term and as a result don't really fit the bill. (And terminal-slack is also using legacy tokens.)

@jpbruinsslot
Copy link
Owner

Yeah, it is likely because of the number of channels/users. Slack-term needs to gather those by issuing several API calls as well figure out the presence of each individual user. In your case it will likely issue too many API calls.

terminal-slack likely uses the 'old' channels.list (https://api.slack.com/methods/channels.list). In the past slack-term also used this, and it returned the complete list per type of channel in one go. Now, it is using conversations.list (#150, https://api.slack.com/methods/conversations.list).

I'll have a look if it helps to increase the pagination number for requesting channels from the API.

jpbruinsslot added a commit that referenced this issue Nov 10, 2018
jpbruinsslot added a commit that referenced this issue Nov 10, 2018
@craigotis
Copy link
Author

I was able to make the following change and load successfully (as I don't use public channels very often, normally I keep them muted):

diff --git a/service/slack.go b/service/slack.go
index 9e82d90..52c6f9a 100644
--- a/service/slack.go
+++ b/service/slack.go
@@ -77,7 +77,6 @@ func (s *SlackService) GetChannels() ([]components.ChannelItem, error) {
                        ExcludeArchived: "true",
                        Limit:           10,
                        Types: []string{
-                               "public_channel",
                                "private_channel",
                                "im",
                                "mpim",
@@ -99,7 +98,6 @@ func (s *SlackService) GetChannels() ([]components.ChannelItem, error) {
                                ExcludeArchived: "true",
                                Limit:           10,
                                Types: []string{
-                                       "public_channel",
                                        "private_channel",
                                        "im",
                                        "mpim",

So I think you're definitely right about the public channel/conversation retrieval being the culprit.

Now that I can load successfully, you can probably consider this a low priority, but definitely a nice-to-have, as workspaces only get larger and larger. 😄

@jpbruinsslot
Copy link
Owner

Cool! Thanks for the heads up. I've pushed a commit on master which increased the pagination limit, and I'm continuing to create a solution for the user presence part, that doesn't make slack-term to wait too long to resolve all the user presence status at startup, and that is able to adhere to the API rate limit.

@abacao
Copy link

abacao commented Nov 19, 2018

I'm also having this issue.

jpbruinsslot added a commit that referenced this issue Dec 25, 2018
@tieoneease
Copy link

I'm still getting this, but my company's workspace probably contains too many channels.

@abacao
Copy link

abacao commented Jan 29, 2019

@tieoneease Build the "threads" branch and it seems to be working

@ghost
Copy link

ghost commented Jan 30, 2019

@abacao Unfortunately, I'm having this issue in the threads branch as well

@abacao
Copy link

abacao commented Jan 30, 2019

@ted-fc it's working for me, are you sure you have built the correct branch? Are you sure you are running that exact version?

@ghost
Copy link

ghost commented Jan 30, 2019

I was at the head of threads branch. Is there a specific commit you're referring to?

@punkdata
Copy link

I'm also having this issue. I can confirm that the Slack workspace I'm connecting to has many channels. I'm running version v0.4.1

Any updates on fixes for this?

@felippemr
Copy link

I'm using the latest binary available for OSX and still get the rate-limiting problem. What should I do?

@ddurdle
Copy link

ddurdle commented Sep 19, 2019

I have the same issue too, on the latest. I have no idea if this even works as I've never got past the LOADING screen. My workspace only has 4 channels.

@offlinehoster
Copy link

I just installed the slack-term....got it started for exactly one time....it took a while....and I was logged on...after quitting ad restarting the app I got multiple

2019/10/24 06:16:19 Slack rate limit exceeded, retry after 1s

messages. And it does not start any more.

We're running a private slack workspace with many channels, I mean a lot of channels "over 400" and I'm joined to about 50 Channels....

@jackzzj
Copy link

jackzzj commented Nov 10, 2021

Still getting this, is this solved ?

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

No branches or pull requests

9 participants