smswithoutborders / smswithoutborders/RelaySMS-Publisher

Issue with Telegram sessions - happens for a variable session time settings

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
15
Forks
5
Avg merge
4m
Merged PRs (30d)
1

Description

Some messages published on Telegram face this issue causing them to not publish

Traceback (most recent call last):
  File "/publisher/pnba.py", line 136, in send_message
    asyncio.run(client.message(recipient=recipient, text=message))
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/publisher/telegram_client.py", line 341, in message
    raise error
  File "/publisher/telegram_client.py", line 335, in message
    await client.send_message(recipient, text)
  File "/usr/local/lib/python3.9/site-packages/telethon/client/messages.py", line 840, in send_message
    entity = await self.get_input_entity(entity)
  File "/usr/local/lib/python3.9/site-packages/telethon/client/users.py", line 440, in get_input_entity
    await self._get_entity_from_string(peer))
  File "/usr/local/lib/python3.9/site-packages/telethon/client/users.py", line 532, in _get_entity_from_string
    for user in (await self(
  File "/usr/local/lib/python3.9/site-packages/telethon/client/users.py", line 30, in __call__
    return await self._call(self._sender, request, ordered=ordered)
  File "/usr/local/lib/python3.9/site-packages/telethon/client/users.py", line 87, in _call
    result = await future
telethon.errors.rpcerrorlist.AuthKeyUnregisteredError: The key is not registered in the system (caused by GetContactsRequest)
2024-11-04 11:43:20,725 - grpc_publisher_service - ERROR - bad argument type for built-in operation
Traceback (most recent call last):
  File "/publisher/grpc_publisher_service.py", line 677, in PublishContent
    return response(
TypeError: bad argument type for built-in operation```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the failure through publisher/pnba.py at send_message and publisher/telegram_client.py at message, then inspect the PublishContent path in publisher/grpc_publisher_service.py. Reproduce the issue with different session-time settings and determine how the AuthKeyUnregisteredError relates to the later TypeError. Done means affected Telegram messages publish successfully without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.