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

Connect failed with Failed to write the VPN config #29512

Closed
simonhong opened this issue Apr 5, 2023 · 7 comments · Fixed by brave/brave-core#17927 or brave/brave-core#17964
Closed

Comments

@simonhong
Copy link
Member

simonhong commented Apr 5, 2023

Description

There was crash when creating os vpn entry with emtpy hostname at brave_vpn::internal::CreateEntry().
With brave/brave-core#17917, crash doesn't happen anymore.
But still have connect failed issue with Failed to write the VPN config due to empty hostname.

backtrace links for crash
https://brave.sp.backtrace.io/p/brave/explore?time=month&aggregations=((callstack%2Chead))&fingerprint=329b1f29ef943e90d7cd52d791d30d622dbfba3f61034ca1e359831cb6a6ff65&
https://brave.sp.backtrace.io/p/brave/explore?time=month&aggregations=((callstack%2Chead))&fingerprint=115990e2619af1f1ac806aec7400f1ebb70b68b3f0932a6a8eacb9fa3c70aa24&

Steps to Reproduce

See #28940 for the STR

Actual result:

Recording from @MadhaviSeelam

2023-04-04_17h12_33.mp4

No more crash but connect failed.

Expected result:

Reproduces how often:

Brave version (brave://version info)

Version/Channel Information:

  • Can you reproduce this issue with the current release?
  • Can you reproduce this issue with the beta channel?
  • Can you reproduce this issue with the nightly channel?

Other Additional Information:

  • Does the issue resolve itself when disabling Brave Shields?
  • Does the issue resolve itself when disabling Brave Rewards?
  • Is the issue reproducible on the latest version of Chrome?

Miscellaneous Information:

@simonhong
Copy link
Member Author

Reopened as brave/brave-core#17927 doesn't fix this issue.

@stephendonner
Copy link

stephendonner commented Apr 7, 2023

❤️

@bsclifton
Copy link
Member

bsclifton commented Apr 7, 2023

Latest code changes did help narrow it down completely 😄 Huge thanks to @MadhaviSeelam for testing

Here's the behavior we ultimately saw

  • Now, the path is set and it'll try to write the config
  • Call to RasSetEntryProperties was happening... but this generated a 0 byte file at %APPDATA%\Microsoft\Network\Connections\Pbk\rasphone.pbk
  • The next call (SetCredentials) fails because the entry (BraveVPN-Nightly) was not there (because the file is empty)

At that point, @MadhaviSeelam checked and the folder is read-only and this is what seems to be preventing the file from being written.
image

She changed this to NOT be read-only (unticking, clicking Apply) but retrying did not work.
I remembered an incident we had before - where deleting the last entry would do something similar and rebooting helped. I asked @MadhaviSeelam to reboot and that fixed the issue.

Next attempt at connecting worked great 😄

@MadhaviSeelam
Copy link

Verified using

Brave | 1.52.26 Chromium: 112.0.5615.49 (Official Build) nightly (64-bit)
-- | --
Revision | bd2a7bcb881c11e8cfe3078709382934e3916914-refs/branch-heads/5615@{#936}
OS | Windows 11 Version 22H2 (Build 22621.1413)

Confirmed connected to VPN successfully and Failed to write config error no longer shown

image

@stephendonner
Copy link

stephendonner commented May 10, 2023

Verification PASSED using

Brave 1.52.92 Chromium: 113.0.5672.92 (Official Build) beta (64-bit)
Revision b6f521170062a1fa8a82c33fb223b06fec566da1-refs/branch-heads/5672_63@{#10}
OS Windows 10 Version 22H2 (Build 19045.2965)

Steps (with credentials and Windows 10 filesystem Read-only changes already made, from below):

  1. launched Brave
  2. connected to Brave VPN
  3. confirmed I could switch server regions
  4. confirmed it wrote out to rasphone.pbk

Confirmed I could connect to Brave VPN, without crashing, even with the containing folder for rasphone.pbk set to Read-only

example example example example
image image image image

Attempted to reproduce the issue using 1.49.118 and 1.51.110

Steps:

  1. installed 1.49.118 / 1.51.110
  2. launched Brave
  3. restarted (to get Griffin changes)
  4. purchased, configured, and connected to Brave VPN
  5. disconnected from Brave VPN
  6. closed Brave
  7. set rasphone.pbk in C:\Users\steph\AppData\Roaming\Microsoft\Network\Connections\Pbk to Read-only
  8. tried to reconnect
  9. confirmed I got the Failed to write the VPN config. error
  10. set its containing folder also to Read-only
  11. unset Read-only for C:\Users\steph\AppData\Roaming\Microsoft\Network\Connections\Pbk
  12. confirmed I was able to reconnect to Brave VPN

No crashes, however.

example example example
image (1) image (2) image

@stephendonner stephendonner added QA/In-Progress Indicates that QA is currently in progress for that particular issue and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels May 10, 2023
@MadhaviSeelam
Copy link

MadhaviSeelam commented May 10, 2023

Verification Failed using

Brave | 1.52.93 Chromium: 113.0.5672.92 (Official Build) beta (64-bit)
-- | --
Revision | b6f521170062a1fa8a82c33fb223b06fec566da1-refs/branch-heads/5672_63@{#10}
OS | Windows 11 Version 22H2 (Build 22621.1555)

Installed 1.52.93
launched Brave
connected Brave VPN via existing prod credentials

*Still seeing Failed to write the VPN config message

2023-05-10_15h03_37.mp4

@MadhaviSeelam MadhaviSeelam added the QA/In-Progress Indicates that QA is currently in progress for that particular issue label May 10, 2023
@MadhaviSeelam
Copy link

QA passing this issue since #30291 filed as a follow up.

@MadhaviSeelam MadhaviSeelam added QA Pass-Win64 and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment