brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.9k stars 2.34k forks source link

When switching release channels, connecting to a server can error with `Can't connect to server` #41395

Open MadhaviSeelam opened 1 month ago

MadhaviSeelam commented 1 month ago

Description

Found while testing https://github.com/brave/brave-browser/issues/38186. Once connected to VPN and upgraded from 1.70.x (release) to 1.71.x (Beta), switching to different servers via new server selection panels throws Can't connect to server dialog. This dialog is persistent, and it renders every time when server is switched. Apart from that, can't connect to other websites if VPN is connected. eg. whatismyipaddress.com.

Steps to reproduce

  1. Install 1.70.123
  2. launch Brave
  3. open account.bravesoftware.com with basic auth
  4. log into Brave VPN as an existing user (brave38186vpnnewuser@mailinator.com)
  5. click `Refresh Firewall + VPN
  6. enabled VPN
  7. closed Brave
  8. renamed the profile to Brave-Browser-Beta
  9. install 1.72.58
  10. relaunch Brave
  11. click VPN button
  12. expand the VPN Panel
  13. scroll up and hover over Australia
  14. click Connect button

Actual result

scenario 1: Can't connect to server error message is shown

https://github.com/user-attachments/assets/fc771b10-2aa5-430a-8295-8865c5286a2d

scenario 2: tried to load whatismyipaddress.com with VPN connected with Canada servers (edited)

Image

Expected result

No error should be shown

Reproduces how often

Easily reproduced

Brave version (brave://version info)

Brave 1.71.104 Chromium: 129.0.6668.89 (Official Build) beta (64-bit)
Revision 3da42496f366e4dc607c58cfdd95ce3f5064c171
OS Windows 11 Version 23H2 (Build 22631.4249)

Channel information

Reproducibility

Miscellaneous information

@simonhong @bsclifton cc: @mattmcalister @brave/qa-team

bsclifton commented 1 month ago

I am curious if this is because of switching from Beta to Release, which is not a real scenario a user faces. I had a profile on 1.70 which was connected to VPN and working and then I installed 1.71.112 release candidate and was able to connect and change servers just fine

Different channels make different configs for connecting. I suspect that would be the root cause

@MadhaviSeelam can you please try your test steps for going FROM 1.70.126 https://github.com/brave/brave-browser/releases/v1.70.126 TO 1.71.112 https://github.com/brave/brave-browser/releases/v1.71.112

I'm going to clear my profile and try this again just for fun. Links to the full installers here to save time 😄

bsclifton commented 1 month ago

OK confirmed using release channel the experience works nicely 😄 I am unable to reproduce the problem

Here are the exact steps I ran through @MadhaviSeelam

  1. Install 1.70.126 https://github.com/brave/brave-browser/releases/download/v1.70.126/BraveBrowserStandaloneSetup.exe
  2. launch Brave
  3. open account.brave.com
  4. log into Brave VPN as an existing user (clifton@brave.com)
  5. click `Refresh Firewall + VPN
  6. enabled VPN (connected to server: USA (West))
  7. closed Brave
  8. install 1.71.112 https://github.com/brave/brave-browser/releases/download/v1.71.112/BraveBrowserStandaloneSetup.exe
  9. relaunch Brave
  10. click VPN button
  11. expand the VPN Panel
  12. scroll up and hover over Australia
  13. click Connect button

I think this is a problem with switching the profile from Beta => Release. But other things could be broken for that scenario too

bsclifton commented 1 month ago

Talking with @simonhong, I believe we have found the root cause. The problem is because of switching from BETA to RELEASE.

No VPN services are installed at install time. It's only when you login to account.brave.com to get credentials the first time, then the service is installed.

When switching profile (beta to release), you already have credentials and it already setup BETA channel VPN service. Because you have credentials already, I don't believe the code enters the branch that installs VPN services (for RELEASE channel). This means WireGuard won't work - the service isn't installed.

This specific scenario (switching channel and owning VPN) is an edge-case and you should be able to solve by using brave://skus-internals/ and resetting the SKU state. Then you can login to account.brave.com.

@simonhong is also testing only using release channel (same as my last comment). Maybe he can share the notes too

GeetaSarvadnya commented 1 month ago

The issue isn't reproducible on macOS arm64.

Brave | 1.71.112 Chromium: 130.0.6723.44 (Official Build) (arm64)
-- | --
Revision | 7d51df656b247f9432ee714a6d160142a1e11c13
OS | macOS Version 12.5 (Build 21G72)
mattmcalister commented 1 month ago

removing the P1. and I recommend removing release/blocking

but let's keep the issue open for a little while to make sure it doesn't happen in a different context.

kjozwiak commented 1 month ago

removing the P1. and I recommend removing release/blocking

but let's keep the issue open for a little while to make sure it doesn't happen in a different context.

Agreed, remove release/blocking as per @bsclifton comment via https://github.com/brave/brave-browser/issues/41395#issuecomment-2409626506. Most users won't be updating from one channel to the other and run into the above. However, @MadhaviSeelam will add more info re: upgrading from 1.70.x -> 1.71.x RC.

MadhaviSeelam commented 1 month ago

Thanks for looking into it @bsclifton. Seem like the issue is with switching the profile from Beta => Release. Confirmed no issues have been found when upgraded from 1.70.123 (current release) -->1.71.112 (RC) with VPN enabled. Verified via https://github.com/brave/brave-browser/issues/38186#issuecomment-2412423488