tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
7.07k stars 1.44k forks source link

BindKey failed: [Error : 400 : ENCRYPTED_MESSAGE_INVALID] #1802

Closed aghasi closed 2 years ago

aghasi commented 2 years ago

I got this error continuously: [ 1][t36][1640587825.643347024][Session.cpp:314][#109][!Session:1:main] BindKey failed: [Error : 400 : ENCRYPTED_MESSAGE_INVALID]

What is the problem?

levlam commented 2 years ago

This just happens some time and doesn't affect app's behavior.

Do you use TDLib from Python?

aghasi commented 2 years ago

yes. i'mg using TDLib from python3. two questions:

  1. This error appears too many time. Can i disable only this error?
  2. I was running multiple number. Can i detect which one cause this?
levlam commented 2 years ago
  1. This error is harmless by itself. If you experience a crash after it, then it is caused by an FFi call to the on_log_message_callback callback. The reason of the crash is unknown yet. Could you update to the latest TDLib, including changes in example/python/tdjson_example.py and check whether it still crashes?

  2. You need more verbose log for that, but it would be useless. This error can be receiveв by any account.

aghasi commented 2 years ago

it does not crash. I only hate this error in my logs because it appears every 2 seconds!

Can i disable logging of this error without affecting other logs?

levlam commented 2 years ago

@aghasi No, this logging can't be disabled. Why don't you redirect the log to a file?

aghasi commented 2 years ago

@aghasi No, this logging can't be disabled. Why don't you redirect the log to a file?

because i want to see other logs in console. Is it possible to redirect TDLib logs to file? i don't mean redirection of Linux because it redirect all logs instead of TDLib logs.

levlam commented 2 years ago

Use the setLogStream method to set up TDLib log destination.

aghasi commented 2 years ago

Use the setLogStream method to set up TDLib log destination.

unfortunately setLogStream affect logging module of python!!! (logging is a python module for logging)

levlam commented 2 years ago

Did you pass logStreamFile.redirect_stderr == false?

aghasi commented 2 years ago

No. my request is

{
    "@type": "setLogStream",
    "log_stream": {
        "@type": "logStreamFile",
        "path": r"/var/log/1.log",
        "max_file_size": 10485760,
        "redirect_stderr": True
    }
}
levlam commented 2 years ago

You asked TDLib to redirect stderr to the TDLib's log.

aghasi commented 2 years ago

You asked TDLib to redirect stderr to the TDLib's log.

But it redirects both stderr and stdout

levlam commented 2 years ago

No, it does nothing with stdout.

k0t0fey commented 1 year ago

In my case, such an error, which was logged without stopping, means that the account was banned.