question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Random timeout errors when calling views_publish

See original GitHub issue

Description

Recently started seeing random timeout errors while calling views_publish on webclient. Everything was fine until a few days ago. I checked with the slack support team as I suspected something to do with the API, they were not able to replicate the same with the API and suggested that I raise the issue here as I was using the python client.

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I’ve read and understood the Contributing guidelines and have done my best effort to follow them.
  • I’ve read and agree to the Code of Conduct.
  • I’ve searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version: slackclient==2.5.0 python version: python 3.7 OS version(s): Ubuntu

Steps to reproduce:

  1. Call this views_publish on a json with about ~30 blocks close to 10 times at least one of them fails with a timeout. Sample code
import slack
bot_oauth_token = ''  # Add valid bot_token
client = slack.WebClient(token=bot_oauth_token)
j = {}  # A valid slack user_id and view with type as home and blocks.
client.views_publish(**j)

Expected result:

No request should fail with a timeout

Actual result:

Timeout exception, stack trace below

  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/slack/web/client.py", line 1741, in views_publish
    return self.api_call("views.publish", json=kwargs)
  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/slack/web/base_client.py", line 171, in api_call
    return self._event_loop.run_until_complete(future)
  File "/usr/lib/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/slack/web/base_client.py", line 214, in _send
    http_verb=http_verb, api_url=api_url, req_args=req_args
  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/slack/web/base_client.py", line 244, in _request
    async with session.request(http_verb, api_url, **req_args) as res:
  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/aiohttp/client.py", line 504, in _request
    await resp.start(conn)
  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 860, in start
    self._continue = None
  File "/home/ankit/.virtualenvs/son-of-anton/lib/python3.6/site-packages/aiohttp/helpers.py", line 596, in __exit__
    raise asyncio.TimeoutError from None
concurrent.futures._base.TimeoutError
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f872a502828>

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
iamaroracommented, Jul 28, 2020

Thanks for the quick response. I upgraded the slackclient on my local and ran my snippet 10 times and got no timeout. 😃 I’m upgrading the version on my production and will keep an eye out there as well, should get to know the results of that within a day as I was getting frequent timeouts there as well. Will post here once resolved. Thanks!

0reactions
seratchcommented, Aug 20, 2020

Thanks for confirming this! I believe we can safely close this issue now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Random timeout errors when calling views_publish · Issue #763
Recently started seeing random timeout errors while calling views_publish on webclient. Everything was fine until a few days ago.
Read more >
views.publish method - Slack API
The method was passed an argument whose name falls outside the bounds of accepted or expected values. This includes very long names and...
Read more >
slack_sdk.web.client API documentation
Default is 'https://www.slack.com/api/'; timeout : int: The maximum number of seconds the client will wait to connect and receive a response from Slack....
Read more >
Timeouts on API Calls - Companies House Developer Forum
I am using nodejs to make the api calls and the exact error message ... requests are made successfully in between random time...
Read more >
python-slackclient Documentation - Read the Docs
The OAuth token you use to call the Slack API has access to the data on the workspace where it is ... from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found