fbradyirl / webex_bot

Python package for a Webex Bot based on websockets.
MIT License
68 stars 44 forks source link

webexteamssdk.exceptions.ApiError: [400] Bad Request - Unable to retrieve content #27

Closed rodhpadilla closed 2 years ago

rodhpadilla commented 2 years ago

Description

Bot was working fine during the week but suddenly start sending the next error: Any idea about what could be causing this?


2022-04-29 02:12:48  [INFO]  [webex_bot.webex_bot.webex_bot.process_raw_command]:212 New user_command: test
2022-04-29 02:12:48  [INFO]  [webex_bot.webex_bot.webex_bot.process_raw_command]:213 is_card_callback_command: False
2022-04-29 02:12:48  [WARNING]  [webex_bot.webex_bot.webex_bot.process_raw_command]:232 Did not find command for test. Default to help card.
2022-04-29 02:13:33  [ERROR]  [base_events.asyncio.default_exception_handler]:1707 Future exception was never retrieved
future: <Future finished exception=<ApiError [400] Bad Request>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/webex_bot/websockets/webex_websocket_client.py", line 63, in _process_incoming_websocket_message
    self.on_message(teams_message=webex_message, activity=activity)
  File "/usr/local/lib/python3.8/site-packages/webex_bot/webex_bot.py", line 203, in process_incoming_message
    self.process_raw_command(raw_message, teams_message, user_email, activity)
  File "/usr/local/lib/python3.8/site-packages/webex_bot/webex_bot.py", line 278, in process_raw_command
    return self.do_reply(reply, room_id, user_email, reply_one_to_one, is_one_on_one_space)
  File "/usr/local/lib/python3.8/site-packages/webex_bot/webex_bot.py", line 287, in do_reply
    self.teams.messages.create(**reply)
  File "/usr/local/lib/python3.8/site-packages/webexteamssdk/api/messages.py", line 282, in create
    json_data = self._session.post(API_ENDPOINT, json=post_data)
  File "/usr/local/lib/python3.8/site-packages/webexteamssdk/restsession.py", line 487, in post
    response = self.request("POST", url, erc, json=json, data=data,
  File "/usr/local/lib/python3.8/site-packages/webexteamssdk/restsession.py", line 345, in request
    check_response_code(response, erc)
  File "/usr/local/lib/python3.8/site-packages/webexteamssdk/utils.py", line 222, in check_response_code
    raise ApiError(response)
webexteamssdk.exceptions.ApiError: [400] Bad Request - Unable to retrieve content. [Tracking ID: ROUTER_626B4971-A5B2-01BB-4FC9-AC12DC074FC9]
gconklin commented 2 years ago

Webex Bot version: 0.2.22

there was a similar issue with older versions; webex bot is up to 0.3.1, now. I'd also make sure webexteamssdk is also current.

rodhpadilla commented 2 years ago

Yesterday during the troubleshoting I tried to upgrade to 0.3.1 but I got the same error A couple of hours later start working again. Im not sure if it could be related to mi ISP or something.
Im closing the issue since there is nothing to do now. I'll keep an eye on this. thanks @gconklin !