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

URL decoding issue with link-local addresses #1126

Open
xialvjun opened this issue Jan 21, 2024 · 9 comments
Open

URL decoding issue with link-local addresses #1126

xialvjun opened this issue Jan 21, 2024 · 9 comments
Labels
bug This shouldn't happen external dependency Related to an external library, i.e. Water

Comments

@xialvjun
Copy link

I must say Windows8 is much much better than 10 and 11.

PS C:\Program Files\Yggdrasil> .\yggdrasilctl.exe getself
Build name:             yggdrasil
Build version:          0.5.4
IPv6 address:           202:f049:a4a5:831c:5df5:ad50:24b9:1265
IPv6 subnet:            302:f049:a4a5:831c::/64
Routing table size:     1
Public key:             21f6cb6b4f9c74414a55fb68ddb34505817ef3f4599975711539475813fe50b0
PS C:\Program Files\Yggdrasil> .\yggdrasilctl.exe getpeers
2024/01/22 03:59:03 Can't open config file from default location C:\Program Files\Yggdrasil\yggdrasil.conf
2024/01/22 03:59:03 Falling back to platform default tcp://localhost:9001
2024/01/22 03:59:03 Connecting to TCP socket localhost:9001
2024/01/22 03:59:03 Connected
2024/01/22 03:59:03 Sending request: getpeers
2024/01/22 03:59:03 Request sent
2024/01/22 03:59:03 Fatal error: parse "tls://[fe80::6ac7:faa3:6f10:585f%25%E4%BB%A5%E5%A4%AA%E7%BD%91]": invalid URL es
cape "%E4"
PS C:\Program Files\Yggdrasil> cat ..\..\ProgramData\Yggdrasil\yggdrasil.log
2024/01/22 03:45:22 Build name: yggdrasil
2024/01/22 03:45:22 Build version: 0.5.4
2024/01/22 03:45:22 Your public key is 21f6cb6b4f9c74414a55fb68ddb34505817ef3f4599975711539475813fe50b0
2024/01/22 03:45:22 Your IPv6 address is 202:f049:a4a5:831c:5df5:ad50:24b9:1265
2024/01/22 03:45:22 Your IPv6 subnet is 302:f049:a4a5:831c::/64
2024/01/22 03:45:22 TCP admin socket listening on 127.0.0.1:9001
2024/01/22 03:45:22 TLS listener started on [fe80::8520:621c:cd6e:7c6b%浠ュお缃慮:54919
2024/01/22 03:54:32 Build name: yggdrasil
2024/01/22 03:54:32 Build version: 0.5.4
2024/01/22 03:54:32 Your public key is 21f6cb6b4f9c74414a55fb68ddb34505817ef3f4599975711539475813fe50b0
2024/01/22 03:54:32 Your IPv6 address is 202:f049:a4a5:831c:5df5:ad50:24b9:1265
2024/01/22 03:54:32 Your IPv6 subnet is 302:f049:a4a5:831c::/64
2024/01/22 03:54:32 TCP admin socket listening on 127.0.0.1:9001
2024/01/22 03:54:32 TLS listener started on [fe80::8520:621c:cd6e:7c6b%浠ュお缃慮:55138
PS C:\Program Files\Yggdrasil>

The C:\ProgramData\Yggdrasil\yggdrasil.conf is just generated without any modification.

@majestrate
Copy link
Contributor

looks like an issue with locale

@xialvjun
Copy link
Author

It seems have nothing to do with Win8.

I reinstalled Win10 and get same error..... Don't know why T-T

@xialvjun
Copy link
Author

xialvjun commented Jan 25, 2024

I think I have found the BUG

My CPU lscpu got Byte Order: Little Endian

@majestrate @neilalexander

@xialvjun xialvjun changed the title Windows8 Can't open config file from default location [BUG] Windows8 Can't open config file from default location Jan 25, 2024
@xialvjun xialvjun changed the title [BUG] Windows8 Can't open config file from default location [BUG] can't open config file from default location Jan 25, 2024
@neilalexander
Copy link
Member

The problem isn't your processor endianness. The problem appears to be because your network adapter is called 以太网 and Windows tries to put that into the link-local address, which the URL parser trips over.

I would guess that if you rename your 以太网 network interface to Ethernet (or something in Latin script) in Control Panel that the problem goes away?

@neilalexander
Copy link
Member

Problem demonstrated here: https://go.dev/play/p/TRVFjToeE4Y

In short, this looks like a problem in the upstream Go standard library and probably affects various non-Latin scripts.

@xialvjun
Copy link
Author

Thanks,after I renamed 以太网 to Ethernet, yggdrasilctl getpeers doesn't get error. But I still can not ping to it.

The Error PC:

C:\Program Files\Yggdrasil>.\yggdrasilctl.exe getself
Build name:             yggdrasil
Build version:          0.5.4
IPv6 address:           202:fbda:60ec:af56:d21b:f23d:a406:ebaa
IPv6 subnet:            302:fbda:60ec:af56::/64
Routing table size:     15
Public key:             2084b3e26a1525bc81b84b7f228aaf18a8f322aae5e212b8ba8b2005ae0df57a

C:\Program Files\Yggdrasil>.\yggdrasilctl.exe getpeers
                    URI                         State   Dir                  IP Address                 Uptime   RX      TX     Pr      Last Error
tls://[fe80::e02d:40d4:e65b:dde6%25Ethernet]    Down    Out                        0s       0kb     0kb    0       0s ago:
tls://[fe80::6ac7:faa3:6f10:585f%25Ethernet]    Down    Out                        0s       0kb     0kb    0       0s ago:
tls://66.112.220.133:54321                      Up      Out     200:32ba:8921:bc85:a227:b4fd:aaec:b44   30m56s  19kb     8kb    0       -
tls://sin.yuetau.net:6643                       Up      Out     200:b858:3f39:af76:83ae:bb1:ebb2:604e   30m56s  17kb    10kb    0       -
tls://yggno.de:18227                            Up      Out     202:a2a5:dead:ded:9a54:4ab5:6aa7:1645   30m56s  16kb     7kb    0       -
tls://39.100.71.204:54321                       Up      Out     200:5a9:90d0:ca7:cda7:60b6:b372:ed71    30m53s   8kb    11kb    0       -

The OK PC:

PS C:\Program Files\Yggdrasil> .\yggdrasilctl.exe getself
Build name:             yggdrasil
Build version:          0.5.4
IPv6 address:           201:9057:cd38:f9e3:a095:4537:c403:1525
IPv6 subnet:            301:9057:cd38:f9e3::/64
Routing table size:     15
Public key:             5bea0cb1c18717daaeb20eff3ab68f7dba82263510506020feb89cc74559739a

PS C:\Program Files\Yggdrasil> .\yggdrasilctl.exe getpeers
           URI                  State   Dir                  IP Address                  Uptime          RX      TX    Pr       Last Error
tls://39.100.71.204:54321       Up      Out     200:5a9:90d0:ca7:cda7:60b6:b372:ed71    7h21m49s        575kb   536kb  0        -
tls://66.112.220.133:54321      Up      Out     200:32ba:8921:bc85:a227:b4fd:aaec:b44   7h21m49s        33mb    727kb  0        -
tls://yggno.de:18227            Up      Out     202:a2a5:dead:ded:9a54:4ab5:6aa7:1645   3h17m24s        91kb    43kb   0        -
tls://sin.yuetau.net:6643       Up      Out     200:b858:3f39:af76:83ae:bb1:ebb2:604e   1h25m12s        48kb    27kb   0        -

PS C:\Program Files\Yggdrasil> ping 202:fbda:60ec:af56:d21b:f23d:a406:ebaa # ping the error pc yggdrasil-ip
Pinging 202:fbda:60ec:af56:d21b:f23d:a406:ebaa with 32 bytes of data:
Request timed out.

Both ErrorPC and OkPC are connecting to the same peers, OkPC should can ping to ErrorPC.

Notes the OkPC's conf file is generated by 0.4.7, I didn't change it when update to 0.5.4. ErrorPC's conf file is generated by 0.5.4 with just added same peers.

@neilalexander
Copy link
Member

Try yggdrasilctl.exe getSessions during/after pinging. If you see a session for the address you're trying to reach, but aren't getting ping responses, then it's probably a firewall on the host dropping the pings.

@Vort
Copy link

Vort commented Jan 27, 2024

But I still can not ping to it.

Can you ping other nodes in the Yggdrasil network?
Like 200:b858:3f39:af76:83ae:bb1:ebb2:604e from your output.

@xialvjun
Copy link
Author

@neilalexander Thank you very much. I did find it in yggdrasilctl getSessions. And after I turning off the ErrorPC's firewall, everything works.Thank you all.

@neilalexander neilalexander changed the title [BUG] can't open config file from default location URL decoding issue with link-local addresses Jan 27, 2024
@neilalexander neilalexander added bug This shouldn't happen external dependency Related to an external library, i.e. Water labels Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This shouldn't happen external dependency Related to an external library, i.e. Water
Projects
None yet
Development

No branches or pull requests

4 participants