mtproto icon indicating copy to clipboard operation
mtproto copied to clipboard

[BUG]: Impossible to auth

Open HT808s opened this issue 4 years ago • 25 comments

Description

I've tried the auth example with my own appID and hash The call of client.AuthSendCode gets stuck/blocked somehow.

When I check the error channel, I've got

decoding received data: Server response error:  (code 4294966892)"

Failed snippet

https://play.golang.org/p/WCtLC1fS8hw

Expected behavior

I expect to receive a Telegram code in order to authenticate

Additional context

I run go version go1.14.3 darwin/amd64

HT808s avatar Feb 06 '21 13:02 HT808s

@HT808s Thanks for feedback!

This error is REALLY strange, looks like code can converted and flipped to -404 value, but... Well, i don't know what can we do with this info...

I'll let you know if found any useful data to you

quenbyako avatar Feb 07 '21 13:02 quenbyako

Getting the same error code, following..

mwei0210 avatar Feb 11 '21 15:02 mwei0210

We need to ask telegram developers. I digged in very deeply into the official documentation, there is not a single one description of what the -404 error means. User not found? Is the phone not registred? App not found? Nothing is clear at all. We REALLY need to send a request to the telegram developers for some kind of support, because many things are too unclear that I even get scared.

quenbyako avatar Feb 11 '21 16:02 quenbyako

@HT808s @mwei0210 did you gus checked twice that telegram app id and app hash are valid? does examples works with tdlib credentials? Maybe this can be major problem?

quenbyako avatar Feb 11 '21 16:02 quenbyako

yeah correct app id and hash, tested with tdlib credentials, same result...

mwei0210 avatar Feb 13 '21 09:02 mwei0210

@mwei0210 can you login into your account without 2fa password and without registration?

maybe -404 means that you need to signup with this phone number?

quenbyako avatar Feb 13 '21 12:02 quenbyako

i guess not..

panic: Panicking because of error: sending AccountInitTakeoutSession: The key is not registered in the system (code 401)

not sure if this is related https://github.com/LonamiWebs/Telethon/issues/7

mwei0210 avatar Feb 16 '21 08:02 mwei0210

@mwei0210 try to recreate session (just delete session file, and try to reauth). After that, leave here feedback please, maybe it can help. If yes, i think that main problem in this issue is outdated session.

Also, maybe it's better to handle this error (like AUTH_KEY_UNREGISTERED error, but i think that we just need to say user that session is corrupted). Or maybe not. But in any case, need to deal with this issue. looks too strange for me.

quenbyako avatar Feb 16 '21 13:02 quenbyako

deleting session didn't seem to work as well

mwei0210 avatar Feb 18 '21 11:02 mwei0210

@mwei0210 ok, i'm sorry for this trouble, i'll try to contact with tg developers as fast as i can.

quenbyako avatar Feb 18 '21 13:02 quenbyako

Nope. thanks for being helpful 😃

mwei0210 avatar Feb 18 '21 13:02 mwei0210

Did you ever figure out how to solve the issue? I'm having the exact same problem.

aleibovici avatar Mar 03 '21 08:03 aleibovici

@aleibovici @mwei0210 @HT808s Looks like only utilities for example has bug (mtproto client created session.json file and dry.FileExists constantly says that session was registred.

Fixed in a3b8484 commit

Note that this bug referenced for examples only, looks like custom clients will never have this bug

quenbyako avatar Mar 07 '21 16:03 quenbyako

@quenbyako hi, I still have the same problem with the latest commit(216789b95a5d644ebbdd1acb7eb46ff61647960a). is there any way to solve it?

xxxsen avatar Apr 05 '21 09:04 xxxsen

@xxxsen make sure, that you've updated your go mod (in project directory type go mod tidy). If this doesn't help, paste please somewhere (better in go playground) your code, which doesn't work 😉

Currently, without failed code, i don't know how to help you, unfortunately 😔

quenbyako avatar Apr 05 '21 11:04 quenbyako

@quenbyako

go mod tidy make no help

here is my code, it just copy from auth example and change auth info as myself.

https://play.golang.org/p/mH-5svHFD-R

error message I got

panic:  (code 4294966892)

goroutine 14 [running]:
github.com/xelaj/mtproto.check(...)
	/home/sen/go/pkg/mod/github.com/xelaj/[email protected]/utils.go:50
github.com/xelaj/mtproto.(*MTProto).startReadingResponses.func1(0xc0000e0b40, 0x790258, 0xc000288040)
	/home/sen/go/pkg/mod/github.com/xelaj/[email protected]/mtproto.go:265 +0x256
created by github.com/xelaj/mtproto.(*MTProto).startReadingResponses
	/home/sen/go/pkg/mod/github.com/xelaj/[email protected]/mtproto.go:246 +0x70
Process exiting with code: 2 signal: false

xxxsen avatar Apr 06 '21 03:04 xxxsen

@xxxsen i'll dig up to this issue, and come back to you, looks pretty strange (i can't reproduce it, but it does look too realistic)

quenbyako avatar Apr 06 '21 11:04 quenbyako

Yep, I got same problem, same mtproto ErrResponseCode 4294966892. The minor difference is the dotenv what I use to load the credentials.

D3vl0per avatar Apr 07 '21 11:04 D3vl0per

github.com/xelaj/mtproto v1.0.0

I was able to resolve this by changing serverHost to my DC's IP (DC5: 91.108.56.151:443). This makes me think if this is anyway related to DC addresses and #22 ?

ssiyad avatar Apr 28 '21 14:04 ssiyad

solved it It's a phone number input problem. phoneNumber = "+8210xxxxxxxx" change phoneNumber = "8210xxxxxxxx"

delete +

no. Not solved.

khjde1207 avatar Jun 18 '21 14:06 khjde1207

@khjde1207 looks like it could be resolution to this issue...

@HT808s @mwei0210 @aleibovici @xxxsen @D3vl0per @ssiyad could you please confirm that this issue can be fixed by correction of input phone number? If yes, i'll add number verification before sending request, it's not too hard

quenbyako avatar Jun 18 '21 22:06 quenbyako

Sorry, deleting the + doesn't solve it. I'm getting the error again. Debugging though. It is very difficult to find the cause.

khjde1207 avatar Jun 19 '21 11:06 khjde1207

I know the cause of the problem, but I don't know how to solve it. The session needs to be recreated after DC redirection, but I don't know how to clean it up!

image

yibana avatar Jul 09 '21 10:07 yibana

I know the cause of the problem, but I don't know how to solve it. The session needs to be recreated after DC redirection, but I don't know how to clean it up!

image

Resolved. After replacing the DC server, you need to call InvokeWithLayer to update the server configuration

yibana avatar Jul 09 '21 12:07 yibana

I know the cause of the problem, but I don't know how to solve it. The session needs to be recreated after DC redirection, but I don't know how to clean it up! image

Resolved. After replacing the DC server, you need to call InvokeWithLayer to update the server configuration

There is a pull request with the fix?

Kliton avatar Oct 07 '21 10:10 Kliton