python-slack-sdk icon indicating copy to clipboard operation
python-slack-sdk copied to clipboard

I am trying to post a message to slack along with a attachment i am getting error as The server responded with: {'ok': False, 'error': 'channel_not_found'}

Open harinath3489 opened this issue 2 years ago • 2 comments

I am trying to send an slack message along with attachment and I am getting below error raceback (most recent call last): File "/layers/google.python.pip/pip/lib/python3.10/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request() File "/layers/google.python.pip/pip/lib/python3.10/site-packages/flask/app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) File "/layers/google.python.pip/pip/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "/layers/google.python.pip/pip/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/init.py", line 174, in view_func function(event) File "/layers/google.python.pip/pip/lib/python3.10/site-packages/functions_framework/init.py", line 70, in wrapper return func(*args, **kwargs) File "/workspace/main.py", line 49, in subscribe slack_utils.send_slack_message(channel_id,[excel_filename]) File "/workspace/slack_utils.py", line 116, in send_slack_message client.chat_postMessage(channel=channel_id, text=message) File "/layers/google.python.pip/pip/lib/python3.10/site-packages/slack_sdk/web/client.py", line 2564, in chat_postMessage return self.api_call("chat.postMessage", json=kwargs) File "/layers/google.python.pip/pip/lib/python3.10/site-packages/slack_sdk/web/base_client.py", line 155, in api_call return self._sync_send(api_url=api_url, req_args=req_args) File "/layers/google.python.pip/pip/lib/python3.10/site-packages/slack_sdk/web/base_client.py", line 186, in _sync_send return self._urllib_api_call( File "/layers/google.python.pip/pip/lib/python3.10/site-packages/slack_sdk/web/base_client.py", line 317, in _urllib_api_call ).validate() File "/layers/google.python.pip/pip/lib/python3.10/site-packages/slack_sdk/web/slack_response.py", line 199, 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/chat.postMessage)

The server responded with: {'ok': False, 'error': 'channel_not_found'}

I am sure that my channelid is correct and the same code was working uptill yesterday.

any help is appreciated.

harinath3489 avatar Feb 15 '24 17:02 harinath3489

Hi, @harinath3489!

Thanks for submitting this question.

Have you verified that your app's bot is invited to the channels you are attempting to post messages in?

hello-ashleyintech avatar Feb 15 '24 17:02 hello-ashleyintech

Yes I have, it was all working fine till yesterday , today I made few changes ( different module) and tried running I am getting this error

harinath3489 avatar Feb 15 '24 17:02 harinath3489

👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.

github-actions[bot] avatar Mar 18 '24 00:03 github-actions[bot]

As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.

github-actions[bot] avatar Apr 01 '24 00:04 github-actions[bot]