brave / brave-browser

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

VPN config failed to load with an error `Failed to write the VPN config` #27056

Closed MadhaviSeelam closed 1 year ago

MadhaviSeelam commented 1 year ago

Description

VPN config error is shown when tried to connect to VPN in following scenarios: Also noticed that rasphone entry disappears in %APPDATA%\Microsoft\Network\Connections\Pbk folder when VPN config error is shown

  1. After removing any previous configs, create a new VPN profile and connect to VPN for the first time
  2. Switch to different region once VPN is successfully connected

Steps to Reproduce

Scenario 1: VPN connection fails first time login in a new profile

Pre-requisite: Remove any pre-existing VPN configs from Windows settings

  1. Install 1.46.130
  2. launch Brave
  3. Enable brave://flags/#brave-vpn
  4. click Relaunch
  5. load account.bravesoftware.com
  6. enter basic-auth creds for site
  7. enter an email address and click Get login link
  8. check your email inbox
  9. click Log in to Brave or the link in the email
  10. click on Browse plans
  11. scroll down and click on Buy now for Brave VPN Subscription
  12. enter payment details on https://checkout.stripe.com/pay/cs_test…
  13. click Subscribe
  14. Success screen is shown with YOU HAVE ACTIVE CREDENTIALS LOADED! message
  15. Click VPN button in the toolbar and connect to VPN

Scenario 2: Switch to different region once VPN is successfully connected

Actual result:

Got this below error:

Work around for both scenarios is

Logs show this error: ERROR: failed to write "NumCustomPolicy" field to rasphone.pbk

Ex1 Ex2 scenario 2
Screenshot 2022-11-29 154319 Screenshot 2022-11-29 172703 image

Expected result:

VPN should be connected successfully without errors

Reproduces how often:

Easily

Brave version (brave://version info)

Brave | 1.46.130 Chromium: 108.0.5359.62 (Official Build) (64-bit)
-- | --
Revision | 041930a89a990cfab0315a2d9f20d6429a4a67cf-refs/branch-heads/5359@{#938}
OS | Windows 11 Version 21H2 (Build 22000.1219)

Version/Channel Information:

Other Additional Information:

Miscellaneous Information:

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

kjozwiak commented 1 year ago

The above will require 1.46.141 or higher for 1.46.x verification 👍

MadhaviSeelam commented 1 year ago

Verification PASSED using

Brave | 1.46.141 Chromium: 108.0.5359.99 (Official Build) (64-bit)
-- | --
Revision | 410951fc34bb4b2cbf182231f9f779efaafaf682-refs/branch-heads/5359_71@{#9}
OS | Windows 11 Version 21H2 (Build 22000.1219)

Verified using STR from https://github.com/brave/brave-browser/issues/27056#issue-1468905481

Scenario 1:

Ex1 Ex2
image image

Scenario 2:

Ex1 Ex2 Ex3
image image image