You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Reproducible in:
slackclient version: 2.6.2
python version: 3.7
OS version(s): Linux, Mac OSX
Steps to reproduce:
Make a call to a Slack python endpoint
Occasionally receive a JSONDecodeError
Expected result:
Expect a SlackApiError instead of JSONDecodeError
Actual result:
File "/venv/lib/python3.7/site-packages/slack/web/client.py" line 1710 in team_info
File "/venv/lib/python3.7/site-packages/slack/web/base_client.py" line 200 in api_call
File "/venv/lib/python3.7/site-packages/slack/web/base_client.py" line 333 in _sync_send
File "/venv/lib/python3.7/site-packages/slack/web/base_client.py" line 437 in _urllib_api_call
`response_body_data: dict = json.loads(response["body"])`
File "/usr/local/lib/python3.7/json/\_\_init\_\_.py" line 348 in loads
File "/usr/local/lib/python3.7/json/decoder.py" line 337 in decode
File "/usr/local/lib/python3.7/json/decoder.py" line 355 in raw_decode
`raise JSONDecodeError("Expecting value", s, err.value) from None`
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Response from server:
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /api/team.info was not found on this server.</p>\n</body></html>\n"
The text was updated successfully, but these errors were encountered:
jeffbuswell
changed the title
JSONDecodeError in TeamInfo endpoint
Occasional JSONDecodeError
Jun 5, 2020
@jeffbuswell Thanks for taking the time to report this.
I tried to reproduce this issue by calling team_info 50+ times on my end (macOS + slackclient 2.6.2) but I was not able to see the same situation.
Regarding the occasional errors with such an unexpected HTML response, how often did you face the issue?
Also, just in case, could you try adding the following lines of code at the beginning of your code? Enabling debug logs may provide some useful information for you.
This seems to happen with all endpoints, not just teams, and only very occasionally. Probably a bug with the actual slack api itself, not the python client, but would be nice if the client handled it gracefully.
Description
Describe your issue here.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Reproducible in:
Steps to reproduce:
Expected result:
Expect a
SlackApiError
instead ofJSONDecodeError
Actual result:
Response from server:
The text was updated successfully, but these errors were encountered: