sclack icon indicating copy to clipboard operation
sclack copied to clipboard

Error on startup in mount_sidebar

Open roveo opened this issue 6 years ago • 10 comments

Here's the error:

Task exception was never retrieved
future: <Task finished coro=<App.component_did_mount() done, defined at app.py:97> exception=KeyError('groups',)>
Traceback (most recent call last):
  File "app.py", line 100, in component_did_mount
    yield from self.mount_sidebar(executor)
  File "app.py", line 109, in mount_sidebar
    loop.run_in_executor(executor, self.store.load_users)
  File "/Users/roveo/.pyenv/versions/3.6.6/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/roveo/sclack/sclack/store.py", line 99, in load_groups
    self.state.groups = self.slack.api_call('mpim.list')['groups']
KeyError: 'groups'

roveo avatar Aug 08 '18 06:08 roveo

It seems like the Slack API has denied the request. This happens often when the same endpoint is requested too many times (Slack API has rating limits). I'll be working on a retry-attempt for requests to handle this kind of issue without breaking the things. Thanks!

haskellcamargo avatar Aug 08 '18 12:08 haskellcamargo

I am also getting an error on startup, maybe it is related.

Traceback (most recent call last):
  File "./app.py", line 560, in <module>
    app.start()
  File "./app.py", line 62, in start
    self.urwid_loop.run()
  File "/usr/local/lib/python3.7/site-packages/urwid/main_loop.py", line 286, in run
    self._run()
  File "/usr/local/lib/python3.7/site-packages/urwid/main_loop.py", line 384, in _run
    self.event_loop.run()
  File "./app.py", line 28, in run
    self._loop.run_forever()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 523, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1722, in _run_once
    event_list = self._selector.select(timeout)
  File "/usr/local/lib/python3.7/selectors.py", line 468, in select
    fd_event_list = self._selector.poll(timeout, max_ev)

MarcosEich avatar Aug 08 '18 16:08 MarcosEich

Same for me but with a different message:

image

niltonvasques avatar Aug 10 '18 02:08 niltonvasques

for me also not working. same message.

behconsci avatar Aug 10 '18 15:08 behconsci

ok it says, we need to give these scopes:

image

behconsci avatar Aug 10 '18 16:08 behconsci

I will make a PR for this with better error messages

behconsci avatar Aug 10 '18 16:08 behconsci

Also having issues on startup:

'channels'
File "./app.py", line 126, in component_did_mount
 yield from self.mount_sidebar(executor)
File "./app.py", line 135, in mount_sidebar
loop.run_in_executor(executor, self.store.load_users)
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/Users/coryshaw/Documents/Code/sclack/sclack/store.py", line 86, in load_channels)['channels']

coryshaw1 avatar Aug 15 '18 15:08 coryshaw1

does not it make sense to just ask for all permissions in front? these error messages come because of missing permissions

On Wed, Aug 15, 2018 at 5:19 PM Cory Shaw [email protected] wrote:

Also having issues on startup:

'channels' File "./app.py", line 126, in component_did_mount yield from self.mount_sidebar(executor) File "./app.py", line 135, in mount_sidebar loop.run_in_executor(executor, self.store.load_users) File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/Users/coryshaw/Documents/Code/sclack/sclack/store.py", line 86, in load_channels)['channels']

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haskellcamargo/sclack/issues/21#issuecomment-413230955, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ4OMy_a2DWRpX63ac7AZK1cXWjSJS2Hks5uRDvmgaJpZM4VzVJk .

behconsci avatar Aug 15 '18 15:08 behconsci

Was able to output the response from the Slack API:

{'ok': False, 'error': 'not_allowed_token_type', ...}

I'm using tokens generated here: https://api.slack.com/custom-integrations/legacy-tokens

And my .sclack file looks like:

{
    "workspaces": {
        "default": "xoxp-xxxx-xxxx-xxxx",
        "another": "xoxp-xxxx-xxxx-xxxx"
    }
}

Do some Slack workspaces have the ability to disable legacy tokens?

coryshaw1 avatar Aug 15 '18 15:08 coryshaw1

you need to create apps then you get the tokens

On Wed, Aug 15, 2018 at 5:34 PM Cory Shaw [email protected] wrote:

Was able to output the response from the Slack API:

{'ok': False, 'error': 'not_allowed_token_type', ...}

I'm using tokens generated here: https://api.slack.com/custom-integrations/legacy-tokens

And my .sclack file looks like:

{ "workspaces": { "default": "xoxp-xxxx-xxxx-xxxx", "another": "xoxp-xxxx-xxxx-xxxx" } }

Do some Slack workspaces have the ability to disable legacy tokens?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/haskellcamargo/sclack/issues/21#issuecomment-413236077, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ4OMyS_UVvihqMEGbPaK2tnsC9UCYwIks5uRD-MgaJpZM4VzVJk .

behconsci avatar Aug 15 '18 15:08 behconsci