python-slack-sdk: files_upload API - timeout response by server regardless of timeout value passed to web client
Hi, I have this little snippet of code that used to work for me until recently:
slackClient=slack_sdk.WebClient(token=slackToken, timeout=300)
upload = slackClient.files_upload(file=file, filename=file)
now I am suddenly getting this response:
slack_sdk.errors.SlackApiError: Received a response in a non-JSON format: stream timeout The server responded with: {'status': 408, 'headers': {'x-edge-backend': 'envoy-www', 'content-length': '14', 'content-type': 'text/plain', 'x-slack-edge-shared-secret-outcome': 'no-match', 'date': 'Tue, 18 Jan 2022 08:12:58 GMT', 'server': 'envoy', 'via': 'envoy-edge-fra-f6ad', 'connection': 'close'}, 'body': 'stream timeout'}
it seems like the client or server are not considering the timeout parameter that is passed to the WebClient, this response returns exactly 30 seconds after the request initiated, as well as when testing it with a smaller file that takes less than 30 seconds to upload everything works fine
since no changes were made to the code, and the slack_sdk was not updated, I am assuming it is related to a server issue? can any one shed some more information regarding this issue?
using python slack-sdk version 3.13.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (4 by maintainers)
We are facing the same problem.
When uploading a 40 MB file, an error ‘stream timeout’ appears and increasing the timeout does not help.
The funny thing is, the file appears in the slack channel.
Hello! How you guys could break your the one API version? We are facing exactly the same problem with the file upload. We tried to rollback to the previous API version but there is no API versioning at all. What you should do in my opinion: – fix the file upload ASAP – implement the API versioning and do not break the current API version because millions of users have to watch how you test your new API implementation on the production stand.
You are a respectful company, please keep the level on not below your “honor” waterline. 💪🏼
Hi @seratch here’s the full log using curl
curl -v https://slack.com/api/files.upload -F token=access-token -F channels= "#ios-ajay-test1" -F file=@file_path