bug: Telegram CRM contact lookup 403
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 64/100
Research direction
Start at flexus_client_kit/integrations/fi_crm.py:87-90 in find_contact_by_platform_id and trace the call into ckit_erp.erp_table_data. Reproduce the Telegram private-message path with the logged 403, then verify the chosen handling prevents the exception from bubbling through Telegram processing.
Written by the indexing model from the issue text.
Description
Original Logs
20260402 06:42:24.232 bot_karen [INFO] FyTqvLzXC2 Telegram private by @Oleg Klimov: hi
20260402 06:42:24.262 btexe [ERROR] 🛑 FyTqvLzXC2 error in on_emessage('TELEGRAM') handler: TransportQueryError
{'message': '403: you have nothing, this operation requires R', 'locations': [{'line': 2, 'column': 3}], 'path': ['erp_table_data']}
Error Summary
Karen bot hits an unhandled GraphQL 403 when looking up a Telegram contact by platform id during every Telegram private message processing path.
Stacktrace
/app/flexus_client_kit/ckit_bot_exec.py -> unpark_collected_events
/app/flexus_client_kit/ckit_integrations_db.py -> _emessage_handler
/app/flexus_client_kit/integrations/fi_telegram.py -> handle_emessage
/app/flexus_simple_bots/karen/karen_bot.py -> telegram_activity_callback
/app/flexus_client_kit/integrations/fi_crm.py -> find_contact_by_platform_id
/app/flexus_client_kit/ckit_erp.py -> erp_table_data
Root Cause
- File:
flexus_client_kit/integrations/fi_crm.py:87-90 - Function:
find_contact_by_platform_id - Why: It queries
crm_contactviaerp_table_datausing the current bot HTTP context. In this deployment the bot only has insufficient ERP permissions, so the GraphQL call fails with 403 instead of returning no contact. The exception bubbles up through Telegram handling. - Git blame: @Oleg Klimov in 34ba22a (2026-03-31)
Code Snippet
async def find_contact_by_platform_id(http, ws_id: str, platform: str, identifier: str) -> Optional[str]:
contacts = await ckit_erp.erp_table_data(
http, "crm_contact", ws_id, erp_schema.CrmContact,
filters=f"contact_platform_ids->{platform}:=:{identifier}", limit=1,
)
return contacts[0].contact_id if contacts else None
Affected
- Pods:
flexus-pod-bot-karen-100020170-rx - Namespaces:
isolated - Occurrences: 1 observed, likely repeatable for Telegram private messages
- Dominant language
- Python
- Stars
- 6
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from smallcloudai/flexus-client-kit
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
smallcloudai/flexus-client-kit#366 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
smallcloudai/flexus-client-kit#327 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
smallcloudai/flexus-client-kit#307 · 7 comments ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
All issues in smallcloudai/flexus-client-kit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100