Trusted Recursive Resolver not working after notebook resume from hibernate
Categories
(Core :: Networking: DNS, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox84 | --- | fixed |
People
(Reporter: xm8zlhxrf, Assigned: valentin)
References
(Blocks 1 open bug)
Details
(Whiteboard: [necko-triaged][trr][mode 3])
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
I had a self hosting DOH server and configure firefox to use TRR.
Having DNS problem in resolving hostnames after the notebook hibernate and resume. The problem would occurs occasionally after I used the notebook for a period without hibernate and resume.
For the DOH server side, I had tried nginx over rust-doh and PowerDNS dnsdist (embedded webserver is H2O).
Actual results:
Cannot access any website by hostname. Access by IP works.
Expected results:
It should work after the notebook resume.
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Hi Patrick,
Could you help to capture the HTTP log after resuming? Please see https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging.
Thanks.
Hi Kershaw,
Got the HTTP log after resuming, it's in here;
https://drive.google.com/file/d/1A3J29zc4JBX6mpv5re0YPkCw8Jx6qO3F/view?usp=sharing
BTW, on another occasion, just found out that the debug file of the HTTP logging may include hostname(s) of a closed private browsing sessions.
Thanks.
For comment #2
I forget to load the CA of the DOH server. Looks like I need to capture the debug log again.
I do this on a clean machine because the original problem firefox browser connects to too many web sites (privacy concern).
Comment 4•7 years ago
|
||
(In reply to Patrick Dung from comment #3)
For comment #2
I forget to load the CA of the DOH server. Looks like I need to capture the debug log again.
I do this on a clean machine because the original problem firefox browser connects to too many web sites (privacy concern).
Thanks. You can send the log to my email (kershaw at mozilla.com) directly.
Alright, I had send the new log to your email just now.
Comment 6•7 years ago
•
|
||
Well, the log shows that the TRR http channels are all canceled with the error NS_ERROR_ABORT. I can't tell the reason from the log.
Maybe FlushCache() is getting called.
Valentin, could you also take a look at the log? I've forwarded the log to you via email.
| Assignee | ||
Comment 7•7 years ago
|
||
(In reply to Kershaw Chang [:kershaw] from comment #6)
Well, the log shows that the TRR http channels are all canceled with the error NS_ERROR_ABORT. I can't tell the reason from the log.
Maybe FlushCache() is getting called.Valentin, could you also take a look at the log? I've forwarded the log to you via email.
I don't think FlushCache should cause the TRR channel to be cancelled. But even if it is cancelled during suspend, it should start up again and not error out.
I'll try to write some tests for this next week.
@Patrick, it's not clear from the logs. Are you using TRR in mode 2 (fallback to DNS) or mode 3 (TRR-only) ?
I used mode 3 TRR-only.
If I use mode 2, it falled back to DNS and I did not notice problem in resolving hostnames.
Updated•7 years ago
|
Comment 9•7 years ago
|
||
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
This also happens on Desktop after sleep (trr.mode=3).
Updated•7 years ago
|
Updated•7 years ago
|
Comment 11•7 years ago
|
||
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
network.trr.mode = 3
other .trr. settings are default
FF can not load any pages after resume from the hibernation.
tcpdump shows that FF tries to connect to the 'one.one.one.one' host.
FF works as usual after re-launch or just resetting 'network.trr.mode=0'.
Also, FF sometimes stop loading pages at arbitrary moment (until re-launched or until .mode is reset).
Comment 12•7 years ago
|
||
I cannot reproduce this with Firefox release in Ubuntu 19.04. Seems likely that this is Windows-only.
| Assignee | ||
Comment 14•6 years ago
|
||
(In reply to Dmitry Sokolov from comment #11)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
network.trr.mode = 3
other .trr. settings are defaultFF can not load any pages after resume from the hibernation.
tcpdump shows that FF tries to connect to the 'one.one.one.one' host.
FF works as usual after re-launch or just resetting 'network.trr.mode=0'.Also, FF sometimes stop loading pages at arbitrary moment (until re-launched or until .mode is reset).
It's not absolutely clear from the previous comments, but it would seem that both reporters run mode3 without setting a bootstrap address. When the TRR connection gets killed (such as when the computer goes to sleep), it fails to come back up because it can't resolve the domain for the DoH server anymore. This usability issue should be fixed by bug 1552176.
| Reporter | ||
Comment 15•6 years ago
|
||
Since I am self hosting the DOH server, currently I am setting a bootstrap address to my local DNS server.
I think I should have set the bootstrap address when I do the testing.
Comment 16•6 years ago
|
||
but it would seem that both reporters run mode3 without setting a bootstrap address
I'm not sure, but it won't work at all, will it?
I tried 1.1.1.1, 8.8.8.8, and some other, but with mode=3 it didn't work after hibernation.
| Assignee | ||
Comment 17•6 years ago
|
||
(In reply to Dmitry Sokolov from comment #16)
but it would seem that both reporters run mode3 without setting a bootstrap address
I'm not sure, but it won't work at all, will it?
I tried 1.1.1.1, 8.8.8.8, and some other, but with mode=3 it didn't work after hibernation.
Could you collect some logs for me using these instructions?
https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging
You can either paste them here, or send them to me via email. Note that the logs will contain private info.
Comment 18•6 years ago
|
||
I always use 1.1.1.1 for a bootstrap address with trr mode 3. On every Windows 10 machine hibernate kills the browser's ability to do DNS lookups.
I'll try to collect the logs you asked for when I get a chance.
Comment 19•6 years ago
|
||
I've turned on logging. I'll post a log when the issue appears.
What kind of a private info is in a log? Cookies?
| Assignee | ||
Comment 20•6 years ago
|
||
(In reply to Dmitry Sokolov from comment #19)
I've turned on logging. I'll post a log when the issue appears.
What kind of a private info is in a log? Cookies?
Cookies may appear, as well as the domain names you resolve. Email is best if you're not using a clean profile.
Updated•6 years ago
|
Updated•6 years ago
|
Comment 21•6 years ago
|
||
I used to be able to reproduce this easily, 100% of the time, up until at least 8 weeks ago. Now I can't reproduce.
I looked at networking bugs fixed in the last 90 days to see if there was anything that might be related to this, there are a bunch of fixes that could have impacted something like this.
Curious to hear if Dmitry or Patrick can reproduce.
Comment 22•6 years ago
|
||
I've changed my config to
network.trr.bootstrapAddress = 1.1.1.1
network.trr.mode = 3
and I still can not reproduce this issue also, but my FF version now is
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
and my Win10 updated recently to the build 1903 (about a month ago).
| Assignee | ||
Comment 23•6 years ago
|
||
I wonder if this was fixed by https://bugzilla.mozilla.org/show_bug.cgi?id=1558495#c5
It's not closed yet, but the code is on release.
| Reporter | ||
Comment 24•6 years ago
|
||
On my brief testing just now on Firefox 69.0.3, the problem seems resolved.
I would be using the 'trr mode = 3' for more testing.
| Assignee | ||
Comment 25•6 years ago
|
||
I'm happy to hear this works for everyone. If anyone can reproduce this again, please reopen the bug.
Comment 26•6 years ago
|
||
Reproduced.
Sent email with logs to valentin....com.
Comment 27•6 years ago
|
||
Kershaw, could you take a look at the logs and see if we need to reopen the bugs? Logs forwarded via email.
Comment 28•6 years ago
|
||
(In reply to Nhi Nguyen (:nhi) from comment #27)
Kershaw, could you take a look at the logs and see if we need to reopen the bugs? Logs forwarded via email.
I think we should reopen this bug.
According to the log, TRR channels are all canceled due to timeout. Note that the timeout is only 1500ms, which seems too short for mode 3. The default timeout for mode 3 is 30000ms.
2019-10-20 18:55:04.177000 UTC - [Parent 3016: Main Thread]: D/nsHttp Creating nsHttpChannel [this=00000152011DC000]
...
2019-10-20 18:55:05.676000 UTC - [Parent 3016: Main Thread]: D/nsHostResolver TRR: 0000015201174000 canceling Channel 00000152011DC040 ocsp.digicert.com 1
2019-10-20 18:55:05.676000 UTC - [Parent 3016: Main Thread]: D/nsHttp nsHttpChannel::Cancel [this=00000152011DC000 status=80004004]
I also took a look at the http connection used for TRR channel and I can't find this line nsHttpConnection::EnsureNPNComplete [this=%p] setting complete to true in the log. I only see:
2019-10-20 18:55:04.083000 UTC - [Parent 3016: Socket Thread]: E/nsHttp nsHttpConnection::EnsureNPNComplete 0000015203B77000 - early selected alpn not available, we will try one more time.
2019-10-20 18:55:04.098000 UTC - [Parent 3016: Socket Thread]: E/nsHttp nsHttpConnection::EnsureNPNComplete 0000015203B77000 - early selected alpn not available
So, it looks like the TLS handshake is never completed or completed too late after 1500ms.
I also noticed that every OCSP request is failed because of NS_ERROR_UNKNOWN_HOST.
Maybe it's a deadlock that TLS handshake is waiting for OCSP requets and OCSP request is waiting for the TRR channel to be ready.
Valentin, what do you think?
| Assignee | ||
Comment 29•6 years ago
|
||
Thanks for looking into this. I think you may be on to something here.
(In reply to Kershaw Chang [:kershaw] from comment #28)
According to the log, TRR channels are all canceled due to timeout. Note that the timeout is only 1500ms, which seems too short for mode 3. The default timeout for mode 3 is 30000ms.
bug 1575780 landed in Firefox 70. The logs have the UA string for Firefox 69.
So, it looks like the TLS handshake is never completed or completed too late after 1500ms.
I also noticed that every OCSP request is failed because of
NS_ERROR_UNKNOWN_HOST.
Maybe it's a deadlock that TLS handshake is waiting for OCSP requets and OCSP request is waiting for the TRR channel to be ready.Valentin, what do you think?
Ouch! That is likely to be the problem.
| Assignee | ||
Comment 30•6 years ago
|
||
The OCSP channel is created here
There doesn't seem to be an easy fix to this.
Until bug 1552176 lands, we can't easily except it from TRR when using mode3.
Comment 31•6 years ago
|
||
I said before that I couldn't reproduce this any more, but now I can reproduce again. And it doesn't require putting the machine to sleep any more. Symptoms are consistent with the discussion happening here about timeouts.
| Assignee | ||
Comment 32•6 years ago
|
||
I tried reproducing this manually by pasting this into the Multiprocess Browser Console
Cc["@mozilla.org/security/x509certdb;1"].getService(Ci.nsIX509CertDB).clearOCSPCache();
Cc["@mozilla.org/network/dns-service;1"].getService(Ci.nsIDNSService).clearCache(true);
It should clear the OCSP cache and the DNS cache, but I still manage to load pages afterwards. Maybe there's another cache I also need to clear?
Patrick, does this bug still reproduce for you?
| Reporter | ||
Comment 33•6 years ago
|
||
(In reply to Valentin Gosu [:valentin] (he/him) from comment #32)
Patrick, does this bug still reproduce for you?
I presume yes. I was using trr mode 2.
I would set to trr mode 3 and see if the problem is still there.
I would update about result of the testing later.
| Reporter | ||
Comment 34•6 years ago
|
||
I had tested it for a few times today and doesn't seem to reproduce the problem again.
| Assignee | ||
Comment 35•6 years ago
|
||
Glad to hear that. Please reopen if it starts happening again.
Comment 36•5 years ago
|
||
This is now broken for me using 82.0 on Arch Linux. It was working before but started happening recently, perhaps in Firefox 81? I'm not 100% sure.
Steps to reproduce:
- Create a brand new Firefox profile
- Set the following preferences
security.OCSP.enabled=1 (is default value)
security.OCSP.require=true
network.trr.mode=3 - Restart Firefox. This bug only occurs when security.OCSP.require=true and network.trr.mode=3 are set before Firefox launches. I assume that clearing the OCSP cache would have the same effect, but I couldn't get the console command mentioned above to work.
I can work around this bug by setting security.OCSP.require to false upon startup, and then changing it back to true, but this is incredibly annoying.
| Assignee | ||
Comment 37•5 years ago
|
||
| Assignee | ||
Updated•5 years ago
|
Comment 38•5 years ago
|
||
Comment 39•5 years ago
|
||
| bugherder | ||
Updated•5 years ago
|
Comment 40•5 years ago
•
|
||
Valentin, it seems that this issue is reproducing for me on FF 84 (20201207203640). I've followed the steps from comment 36, and when I access any webpage by its hostname, I'm getting this message in Firefox: Hmm. We’re having trouble finding that site. We can’t connect to the server at www.google.com.
Any ideas about what is going on here?
| Assignee | ||
Comment 41•5 years ago
|
||
Hi Ciprian, can you open a new bug and post the HTTP logs recorded when reproducing?
https://developer.mozilla.org/en-US/docs/Mozilla/Debugging/HTTP_logging
Thanks!
Comment 42•5 years ago
|
||
Hi Valentin! Sure, I have filled bug 1681683. Thanks.
Description
•