-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Error Summary
The auth_test() call in fi_slack.py at line 708 is not wrapped in a try-except block, causing the bot to crash when encountering an invalid, expired, or revoked Slack token.
Stacktrace
The SlackApiError exception propagates up from the auth_test() call and crashes the bot when authentication fails.
Investigation Findings
Root Cause
File: flexus_client_kit/integrations/fi_slack.py
Line: 708
Function: join_channels()
Why: The auth_test() call on line 708 is not wrapped in a try-except block. When the Slack API returns an invalid_auth error (due to invalid/expired/revoked token), the SlackApiError exception propagates up and crashes the bot. This is inconsistent with the error handling pattern used for other Slack API calls in the same method (users_list, conversations_list), which are all wrapped in try-except blocks.
Git Blame
- Author: Kirill Starkov
- Commit: fa6ab32
- Date: 2025-08-21 15:23:31 +0300
- Message: init
Code Snippet
async def join_channels(self):
if not self.reactive_slack:
return
web_api_client: AsyncWebClient = self.reactive_slack.client
my_info = await web_api_client.auth_test() # <-- NO TRY-EXCEPT HERE
my_user_id = my_info["user_id"]
logger.info(f"Bot user ID: {my_user_id}")
try: # <-- Other API calls ARE wrapped
users_response = await web_api_client.users_list(limit=5000)
...
except SlackApiError as e:
logger.exception("Failed to list users")
self.problems_other.append(...)Occurrence Data
- First Seen: 2026-01-27T19:48:00Z
- Occurrence Count: 1
- Affected Pods: flexus-pod-bot-karen-20043-rx
- Affected Namespaces: isolated
- Build Info:
- flexus commit: 1c780beb
- ckit commit: ec1cf8f
Fix Suggestion
Wrap the auth_test() call (lines 708-710) in a try-except block to gracefully handle authentication failures. The bot should log the error to self.problems_other and continue or exit gracefully, similar to how other Slack API errors are handled. This will prevent the bot from crashing when the Slack token is invalid, expired, or revoked.
Related Files
flexus_simple_bots/karen/karen_bot.py
Secondary Issue
The configuration for this specific karen bot instance has an invalid/expired/revoked SLACK_BOT_TOKEN. While the code should handle this gracefully, the token itself needs to be regenerated or reconfigured in the bot's setup.
This issue was automatically created by Diplodocus based on error investigation ID: 697914e04baba41f22973d2a