Rongronggg9 / RSS-to-Telegram-Bot

A Telegram RSS bot that cares about your reading experience
https://t.me/RSStT_Bot
GNU Affero General Public License v3.0
1.49k stars 273 forks source link

docker error on some accounts #216

Closed jw-star closed 1 year ago

jw-star commented 1 year ago

docker

rsstt   | 2022-12-13-01:51:11:WARNING:telethon.client.users - Telegram is having internal issues NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
rsstt   | 2022-12-13-01:51:14:WARNING:telethon.client.users - Telegram is having internal issues NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
rsstt   | 2022-12-13-01:51:16:WARNING:telethon.client.users - Telegram is having internal issues NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
rsstt   | 2022-12-13-01:51:18:WARNING:RSStT - Set command error: 
rsstt   | Traceback (most recent call last):
rsstt   |   File "/app/src/__init__.py", line 249, in lazy
rsstt   |     await asyncio.gather(*set_bot_commands_tasks)
rsstt   |   File "/app/src/command/utils.py", line 657, in set_bot_commands
rsstt   |     await env.bot(
rsstt   |   File "/opt/venv/lib/python3.11/site-packages/telethon/client/users.py", line 30, in __call__
rsstt   |     return await self._call(self._sender, request, ordered=ordered)
rsstt   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rsstt   |   File "/opt/venv/lib/python3.11/site-packages/telethon/client/users.py", line 129, in _call
rsstt   |     raise last_error
rsstt   |   File "/opt/venv/lib/python3.11/site-packages/telethon/client/users.py", line 84, in _call
rsstt   |     result = await future
rsstt   |              ^^^^^^^^^^^^
rsstt   | telethon.errors.rpcerrorlist.NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
StingerTopGun commented 1 year ago

Same issue here, not used it before so unsure if my config is wrong:

$ dc logs -f
rsstt  | 2022-12-13-13:01:29:INFO:RSStT.env - Config folder: /app/config
rsstt  | 2022-12-13-13:01:31:INFO:RSStT - RSS-to-Telegram-Bot (v2.2.1-@master, build@202202T10:56:13+00:00) started!
rsstt  | MANAGER: <removed-for-github>
rsstt  | T_PROXY (for Telegram): not set
rsstt  | R_PROXY (for RSS): not set
rsstt  | DATABASE: sqlite
rsstt  | TELEGRAPH: Enable (5 accounts)
rsstt  | UVLOOP: Enable
rsstt  | MULTIUSER: Disable
rsstt  | 2022-12-13-13:01:31:INFO:RSStT.db - Successfully connected to the DB
rsstt  | 2022-12-13-13:01:31:WARNING:telethon.client.users - Telegram is having internal issues NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
rsstt  | 2022-12-13-13:01:33:WARNING:telethon.client.users - Telegram is having internal issues NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
rsstt  | 2022-12-13-13:01:35:WARNING:telethon.client.users - Telegram is having internal issues NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
rsstt  | 2022-12-13-13:01:37:WARNING:RSStT - Set command error: 
rsstt  | Traceback (most recent call last):
rsstt  |   File "/app/src/__init__.py", line 88, in pre
rsstt  |     await asyncio.gather(
rsstt  |   File "/app/src/command/utils.py", line 616, in set_bot_commands
rsstt  |     await env.bot(
rsstt  |   File "/opt/venv/lib/python3.10/site-packages/telethon/client/users.py", line 30, in __call__
rsstt  |     return await self._call(self._sender, request, ordered=ordered)
rsstt  |   File "/opt/venv/lib/python3.10/site-packages/telethon/client/users.py", line 129, in _call
rsstt  |     raise last_error
rsstt  |   File "/opt/venv/lib/python3.10/site-packages/telethon/client/users.py", line 84, in _call
rsstt  |     result = await future
rsstt  | telethon.errors.rpcerrorlist.NeedMemberInvalidError: The provided member is invalid or does not exist (for example a thumb size) (caused by SetBotCommandsRequest)
jw-star commented 1 year ago

It’s a very strange problem. I have no problem using one of the accounts. Is it possible that the bot’s session is set up?

jw-star commented 1 year ago

In fact, I feel that the use of session by bot is useless, at least in the robot I am currently using

Rongronggg9 commented 1 year ago

This does not seem to be a bug of the bot. The bot needs to set a special command menu for its MANAGER and the error was raised while doing this.

To set a special command menu for a user, the user must:

  1. has been chatted with the bot (private chat, instead of group/channel)
  2. does not ban the bot

So the error will occur if RSStT is deployed right after the bot is created without the MANAGER having a chat with it.

If this is not your case, check twice if you've configured MANAGER properly, it should be the user id (instead of the username) of your Telegram account (instead of a channel or group or so on). To verify if it is properly set, just check if you have permission to use the /test command.

If your case is still not listed here, I have no more idea. It is Telegram DC (or, the server side of Telegram) that rejects the request from RSStT. Maybe you could provide more information about your account.

@StingerTopGun Users are encouraged to deploy the dev branch instead of the master branch as the latter only gets updates when there is a new release.

@jw-star Bot session is not useless. If a session persists, the below operations, are speeded up:

  1. Login
  2. Username or user id resolution (if cache hit)

Also, a session must be created (no matter in memory or on disk) in order to log in and work properly if there is none, even if you don't need the advantages above. This is a limitation from upstream, or to be exact, Telethon.

If you decide to migrate to another bot but preserve your RSStT configuration and data, you will need to delete config/bot.session. This is the only disadvantage of storing the session on disk.

StingerTopGun commented 1 year ago

has been chatted with the bot (private chat, instead of group/channel)

That absolutely fixed my problem, i wasn't aware of that, thanks!

@StingerTopGun Users are encouraged to deploy the dev branch instead of the master branch as the latter only gets updates when there is a new release.

I see, changed it to dev branch, everything working perfectly now.