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

TCP DNS cannot be used on WSL #3046

Closed
gezero opened this issue Nov 11, 2021 · 6 comments
Closed

TCP DNS cannot be used on WSL #3046

gezero opened this issue Nov 11, 2021 · 6 comments
Assignees
Labels
bug Something isn't working P4 Low (ex: Node doesn't start up when the configuration file has unexpected "end-of-line" character)

Comments

@gezero
Copy link
Contributor

gezero commented Nov 11, 2021

Description

As an WSL user, I want to use DSNResolving so that I can get besu peers faster.

Acceptance Criteria

  • when starting besu from WSL I want the DNSResolver feature to work.

Steps to Reproduce (Bug)

  1. run besu on WSL

Expected behavior: [What you expect to happen]
Peers get quickly found because the DNSResolver helps finding those

Actual behavior: [What actually happens]
The DNSResolver throws an exception and does not find any peers

2021-11-11 11:49:29.139+00:00 | Timer-0 | WARN  | DNSResolver | I/O exception contacting remote DNS server /172.20.64.1:53
java.net.SocketTimeoutException
        at org.xbill.DNS.Resolver.send(Resolver.java:159)
        at org.apache.tuweni.discovery.DNSResolver.resolveRecordRaw(DNSResolver.kt:150)
        at org.apache.tuweni.discovery.DNSResolver.resolveRecord(DNSResolver.kt:73)
        at org.apache.tuweni.discovery.DNSResolver.visitTree(DNSResolver.kt:115)
        at org.apache.tuweni.discovery.DNSResolver.visitTree(DNSResolver.kt:106)
        at org.apache.tuweni.discovery.DNSResolver.collectAll(DNSResolver.kt:95)
        at org.apache.tuweni.discovery.DNSTimerTask.run(DNSDaemon.kt:79)
        at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
        at java.base/java.util.TimerThread.run(Timer.java:506)

Frequency: [What percentage of the time does it occur?]
Always broken on my machine. I had to manually switch to a different DNS to workaround the issue.

Versions (Add all that apply)

  • Java version: [openjdk version "11.0.11" 2021-04-20]
  • OS Name & Version: [Ubuntu 20.04 LTS as WSL on Windows 10]

Additional Information

When looking at the code it seems that the underlying implementation is using TCP to communicate with the DNS. TCP is not allowed in WSL by default it seems like. consider the following:

dig @172.20.64.1 google.com

; <<>> DiG 9.16.1-Ubuntu <<>> @172.20.64.1 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12665
;; flags: qr rd ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; WARNING: recursion requested but not available

;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             0       IN      A       142.250.200.46

;; Query time: 0 msec
;; SERVER: 172.20.64.1#53(172.20.64.1)
;; WHEN: Thu Nov 11 17:41:37 GMT 2021
;; MSG SIZE  rcvd: 54

but

dig +tcp @172.20.64.1 google.com
;; Connection to 172.20.64.1#53(172.20.64.1) for google.com failed: timed out.
;; Connection to 172.20.64.1#53(172.20.64.1) for google.com failed: timed out.

; <<>> DiG 9.16.1-Ubuntu <<>> +tcp @172.20.64.1 google.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

;; Connection to 172.20.64.1#53(172.20.64.1) for google.com failed: timed out.

On the other hand:

dig +tcp @8.8.8.8 google.com

; <<>> DiG 9.16.1-Ubuntu <<>> +tcp @8.8.8.8 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21209
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             36      IN      A       216.58.212.206

;; Query time: 10 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Nov 11 17:42:50 GMT 2021
;; MSG SIZE  rcvd: 55
@MadelineMurray MadelineMurray added bug Something isn't working P4 Low (ex: Node doesn't start up when the configuration file has unexpected "end-of-line" character) labels Nov 12, 2021
@MadelineMurray
Copy link
Contributor

If not likely to be fixed in short/medium term, we should document that this platform is not fully supported for Besu and recommend not using it.

@MadelineMurray
Copy link
Contributor

@gezero - what are you thoughts on documenting this as something that's not supported?

@gezero
Copy link
Contributor Author

gezero commented Nov 15, 2021

I was hoping I will figure out how to enable TCP DNS lookup on WSL and document that. I didn't so I think I will open an issue on WSL. There is a workaround of manually settings a working DNS server. There is also a command line option in working as part of PR 3057 that will allow to specify DNS server to use. So maybe those two options could be added as a suggestion.

@gezero
Copy link
Contributor Author

gezero commented Nov 15, 2021

I have created new issue for WSL microsoft/WSL#7698. Maybe they will just explain my problems with some easy fix.

@gezero
Copy link
Contributor Author

gezero commented Nov 16, 2021

I was wondering where to put some relevant information into the documentation and I am not so sure. I was looking for sections that would say something about OS considerations or known issues but I failed to find something. Maybe a new page should be created with list of supported OS/architectures or maybe we could mention there something like - We are trying to support as many systems as possible but there might be some issues that you might face when using some niche system like WSL to run besu (besu is runnable on windows so there should not be a need to run it on WSL maybe)

@gezero
Copy link
Contributor Author

gezero commented Nov 18, 2021

I have added a note to the https://wiki.hyperledger.org/display/BESU/Building+from+source that might bring people back to this issue. for more details.

The problem is not in besu, so I will close this issue for now.

@gezero gezero closed this as completed Nov 18, 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 P4 Low (ex: Node doesn't start up when the configuration file has unexpected "end-of-line" character)
Projects
None yet
Development

No branches or pull requests

2 participants