Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Impossible to auth #65

Open
HT808s opened this issue Feb 6, 2021 · 25 comments
Open

[BUG]: Impossible to auth #65

HT808s opened this issue Feb 6, 2021 · 25 comments
Assignees
Labels
bug Something isn't working

Comments

@HT808s
Copy link

HT808s commented Feb 6, 2021

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 HT808s added the bug Something isn't working label Feb 6, 2021
@quenbyako
Copy link
Member

@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 quenbyako self-assigned this Feb 7, 2021
@quenbyako quenbyako added the help wanted Extra attention is needed label Feb 7, 2021
@mwei0210
Copy link

Getting the same error code, following..

@quenbyako
Copy link
Member

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
Copy link
Member

@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?

@mwei0210
Copy link

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

@quenbyako
Copy link
Member

@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?

@mwei0210
Copy link

mwei0210 commented Feb 16, 2021

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
LonamiWebs/Telethon#7

@quenbyako
Copy link
Member

@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.

@mwei0210
Copy link

deleting session didn't seem to work as well

@quenbyako
Copy link
Member

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

@quenbyako quenbyako changed the title [BUG]: Impossible to auth [BUG]: Impossible to auth (NEED HELP) Feb 18, 2021
@quenbyako quenbyako pinned this issue Feb 18, 2021
@mwei0210
Copy link

Nope. thanks for being helpful 😃

@aleibovici
Copy link

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

@quenbyako
Copy link
Member

@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 quenbyako changed the title [BUG]: Impossible to auth (NEED HELP) [BUG]: Impossible to auth Mar 7, 2021
@quenbyako quenbyako removed the help wanted Extra attention is needed label Mar 7, 2021
@quenbyako quenbyako unpinned this issue Mar 7, 2021
@xxxsen
Copy link

xxxsen commented Apr 5, 2021

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

@quenbyako
Copy link
Member

@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 😔

@xxxsen
Copy link

xxxsen commented Apr 6, 2021

@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

@quenbyako
Copy link
Member

@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 quenbyako reopened this Apr 6, 2021
@D3vl0per
Copy link

D3vl0per commented Apr 7, 2021

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

@ssiyad
Copy link

ssiyad commented Apr 28, 2021

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 ?

@khjde1207
Copy link

khjde1207 commented Jun 18, 2021

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

delete +

no. Not solved.

@quenbyako
Copy link
Member

@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

@khjde1207
Copy link

khjde1207 commented Jun 19, 2021

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

@yibana
Copy link

yibana commented Jul 9, 2021

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
Copy link

yibana commented Jul 9, 2021

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

@Kliton
Copy link

Kliton commented Oct 7, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants