POST 405方法未找到 - Slack在集成聊天机器人时出现的错误

问题描述 投票:0回答:1

当我把我的rasa聊天机器人和slack整合在一起的时候,我得到了某种405方法未找到的错误。请给我一些提示。

\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\policies\keras_policy.py:265: FutureWarning: 'KerasPolicy' is deprecated and will be removed in version 2.0. Use 'TEDPolicy' instead. current_epoch=meta["epochs"], 2020-04-27 02:59:51 INFO rasa.core.policies.ensemble - MappingPolicy not included in policy ensemble. Default intents 'restart and back will not trigger actions 'action_restart' and 'action_back'. Exception occurred while handling uri: 'http://e8045282.ngrok.io/' Traceback (most recent call last): File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\sanic\app.py", line 940, in handle_request handler, args, kwargs, uri, name = self.router.get(request) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\sanic\router.py", line 411, in get return self._get(request.path, request.method, "") File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\sanic\router.py", line 452, in _get raise method_not_supported sanic.exceptions.MethodNotSupported: Method POST not allowed for URL / 2020-04-27 03:13:47 WARNING rasa.core.channels.slack - Received retry #1 request from slack due to http_timeout. 2020-04-27 03:13:49 ERROR rasa.core.channels.slack - Exception when trying to handle message.The request to the Slack API failed. The server responded with: {'ok': False, 'error': 'internal_error'} 2020-04-27 03:13:49 ERROR rasa.core.channels.slack - The request to the Slack API failed. The server responded with: {'ok': False, 'error': 'internal_error'} Traceback (most recent call last): File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\channels\slack.py", line 312, in process_message await on_new_message(user_msg) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\channels\channel.py", line 83, in handler await app.agent.handle_message(*args, **kwargs) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\agent.py", line 486, in handle_message return await processor.handle_message(message) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\processor.py", line 107, in handle_message await self._predict_and_execute_next_action(message.output_channel, tracker) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\processor.py", line 538, in _predict_and_execute_next_action action, tracker, output_channel, self.nlg, policy, confidence File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\processor.py", line 651, in _run_action await self._send_bot_messages(events, tracker, output_channel) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\processor.py", line 580, in _send_bot_messages await output_channel.send_response(tracker.sender_id, e.message()) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\channels\channel.py", line 186, in send_response await self.send_text_message(recipient_id, message.pop("text"), **message) File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\rasa\core\channels\slack.py", line 39, in send_text_message channel=recipient, as_user=True, text=message_part, type="mrkdwn", File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\slack\web\base_client.py", line 226, in _send return SlackResponse(**{**data, **res}).validate() File "c:\users\shubham\anaconda3\envs\resturantchatbot\lib\site-packages\slack\web\slack_response.py", line 176, in validate raise e.SlackApiError(message=msg, response=self) slack.errors.SlackApiError: The request to the Slack API failed. The server responded with: {'ok': False, 'error': 'internal_error'}

这是我在运行ngrok与slack整合时得到的错误。 Slack错误:

HTTP Requests ------------- POST /webhooks/slack/webhook 201 Created POST /webhooks/slack/webhook 200 OK POST /webhooks/slack/webhook 200 OK POST / 405 Method Not Allowed

python post slack-api rasa-nlu rasa
1个回答
0
投票

我也面临同样的问题。它说''(home)上不允许发布。不知道为什么slack要在''(home)上发布事件请求,它应该在'webhooksslackwebhook'上发布,所以当我用postman发布webhook URL和示例信息时(https:/api.slack.comeventsmessage)很顺利。

enter image description here

问题为你解决了。

谢谢你,Vivek

© www.soinside.com 2019 - 2024. All rights reserved.