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 triying to upload a file to a slack chat. This is a complete log
2022-07-18 17:13:51,398 ERROR errbot.backends.slackv3 Upload of archivos-R107-H02.tar.gz to coordinación-entregas failed.
Traceback (most recent call last):
File "/errbot-dir/backend/err-backend-slackv3/slackv3.py", line 752, in _slack_upload
resp = self.slack_web.files_upload(
File "/usr/lib/python3.9/site-packages/slack_sdk/web/client.py", line 2975, in files_upload
return self.api_call("files.upload", files={"file": file}, data=kwargs)
File "/usr/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 156, in api_call
return self._sync_send(api_url=api_url, req_args=req_args)
File "/usr/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 187, in _sync_send
return self._urllib_api_call(
File "/usr/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 309, in _urllib_api_call
return SlackResponse(
File "/usr/lib/python3.9/site-packages/slack_sdk/web/slack_response.py", line 189, in validate
raise e.SlackApiError(message=msg, response=self)
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/files.upload)
The server responded with: {'ok': False, 'error': 'invalid_channel', 'channel': '<#GCP4E5A1G|coordinación-entregas>'}
The text was updated successfully, but these errors were encountered:
The issue seems to be that to.channelid contains <#C12345|channel-name> instead of just C12345 that Slack expects. In my case the fix is changing stream.identifier.channelid to stream.identifier.id in _slack_upload
def_slack_upload(self, stream: Stream) ->None:
""" Performs an upload defined in a stream :param stream: Stream object :return: None """try:
stream.accept()
resp=self.slack_web.files_upload(
channels=stream.identifier.id, filename=stream.name, file=stream
)
ifresp.get("ok"):
stream.success()
else:
stream.error()
exceptException:
log.exception(f"Upload of {stream.name} to {stream.identifier.channelname} failed.")
i triying to upload a file to a slack chat. This is a complete log
The text was updated successfully, but these errors were encountered: