Open Bug 1793335 Opened 3 years ago Updated 2 years ago

Cannot load any site for a long time after restarting the browser when using PAC and DoH together.

Categories

(Core :: Networking: Proxy, defect, P2)

Firefox 106
defect

Tracking

()

People

(Reporter: y3110wp00k33, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Steps to reproduce:

Firefox Dev Edition 106.0b6 64-bit on Windows 10.
UA: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0

Clean new profile.
Set this prefs:

user_pref("network.proxy.autoconfig_url", "https://antizapret.prostovpn.org/proxy.pac");
user_pref("network.proxy.type", 2);
user_pref("network.trr.mode", 3);
user_pref("network.trr.uri", "https://mozilla.cloudflare-dns.com/dns-query"); // can use any DoH svc, it doesn't matter

Contents of PAC file is here: https://paste2.org/1y4w01Ck

Restart Firefox.

Actual results:

Can't load any site right after restart as if there is no internet connection. This goes on for up to a half of minute or more.

Expected results:

Sites should open after restarting the browser without such a huge delay.

The Bugbug bot thinks this bug should belong to the 'Core::Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Networking
Product: Firefox → Core

Have you observed this issue earlier or is it a new issue in Firefox 106?

Flags: needinfo?(y3110wp00k33)

Earlier. Just tested it on 91.13.0ESR.
Maybe the problem exists in earlier versions as well.

Flags: needinfo?(y3110wp00k33)

Could you try to record a http log?
It'd be interesting to see what happens during startup.
Please also add proxy:5 to MOZ_LOG. Thanks.

Flags: needinfo?(y3110wp00k33)

Applied this:

set MOZ_LOG=timestamp,rotate:1000,nsHttp:5,cache2:5,nsSocketTransport:5,nsHostResolver:5,cookie:5,proxy:5
set MOZ_LOG_FILE=%CD%\moz.log

launched it with an empty profile containing user.js with proxy and trr parameters, waited for the mozilla start pages to open, then closed FF.
So here are the logs: https://envs.sh/Qzn.zip

Also, I found that if proxy.pac is not downloaded from the URL, but loaded locally from the disk, this problem does not exist.

So, use this when trying to reproduce:

user_pref("network.proxy.autoconfig_url", "https://envs.sh/QzT.pac");
Flags: needinfo?(y3110wp00k33)

Thanks for the log.
It shows that the PAC request is failed after the long timeout of trr mode 3 and all other http requests are blocked by the PAC one.
Maybe we should also disable TRR for PAC request.
Valentin, what do you think?

Flags: needinfo?(valentin.gosu)

This is not very good, because it may not be possible to reach the PAC except through TRR (domain blocking by the provider, for example).

On the other hand, if the PAC file is on the local network - TRR will never resolve local domain at all.

Maybe just disable trr mode 3 (force fallback) for PAC URL? With mode 2 all works fine.

(In reply to Kershaw Chang [:kershaw] from comment #6)

Maybe we should also disable TRR for PAC request.
Valentin, what do you think?

I thought you meant DNS resolves triggered by the PAC script here which already don't use TRR, but you mean we should disable TRR for the PAC script channel here right?

I would have expected that TRR requests would not be resolved using the PAC script until the PAC is actually installed - but that's apparently not the case. There's clearly another bug here, since it works when you initially set the PAC script, but not after restart when it's already set?

In any case, I think a temporary fix might be if global TRRMode==3 then set PAC channel TRRMode to be TRR_FIRST_MODE.

Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(valentin.gosu)
Priority: -- → P2
Whiteboard: [necko-triaged]

since it works when you initially set the PAC script, but not after restart when it's already set?

Yes it is

Moving bug to Core/Networking: Proxy.

Component: Networking → Networking: Proxy
You need to log in before you can comment on or make changes to this bug.