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]: Recreation Connection fails with IPv6 parsing error #86

Closed
MJDrgn opened this issue Jun 4, 2021 · 2 comments
Closed

[BUG]: Recreation Connection fails with IPv6 parsing error #86

MJDrgn opened this issue Jun 4, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@MJDrgn
Copy link

MJDrgn commented Jun 4, 2021

Description

When running in WSL2 (Ubuntu 20.04), upon first request (in my case AuthSendCode) a reconnection is attempted to an invalid address. I'm not exactly sure why that IP is invalid, or where it comes from - presumably it's a telegram DC?

panic: failed AuthSendCode: sending AuthSendCode: recreating connection: can't connect: setup connection: resolving tcp: address 2001:0b28:f23d:f003:0000:0000:0000:000a: too many colons in address

The exact same code works on Windows past this point.
It appears this may be related to the system just having v6 in general - although not sure why it doesn't occur on Windows.

Failed snippet

	config := telegram.ClientConfig{
		SessionFile: sessFile,
		ServerHost: "149.154.167.50:443",
		PublicKeysFile: publicKeys,
		AppID: snip,
		AppHash: "snip",
		InitWarnChannel: true,
	}
	client, err := telegram.NewClient(config)
	signedIn, err := client.IsSessionRegistred()
	setCode, err := client.AuthSendCode(
		phone, int32(config.AppID), config.AppHash, &telegram.CodeSettings{},
	)

Expected behavior

AuthSendCode completes without error

Additional context

@MJDrgn MJDrgn added the bug Something isn't working label Jun 4, 2021
@MJDrgn
Copy link
Author

MJDrgn commented Jun 4, 2021

Minor addition: I have now reproduced this on Windows as well, although only once and it seems intermittent as I haven't got it again even re-running the same code.

@MJDrgn
Copy link
Author

MJDrgn commented Jun 5, 2021

This is a duplicate of #82

@MJDrgn MJDrgn closed this as completed Jun 5, 2021
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

No branches or pull requests

1 participant