brave / brave-browser

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

Components randomly unable to update for users #38609

Open Saoiray opened 1 month ago

Saoiray commented 1 month ago

Description

For quite some time now I have been seeing users complain about things like Widevine not being recognized or ads no longer being blocked. Typically those experiencing this issue will be able to go to brave://components and will see something that says Update Error and will display Version 0.0.0.0 for components. This is especially happening with the components associated with Shields.

In the past, this could be fixed by launching as administrator, but this doesn't seem to work anymore. There have been a variety of workarounds by users, but it seems like it should be more important to get devs to work on this. I've reported it to Mattches and others, but haven't seen any open Github issues or movement on finding solutions. Perhaps it's just internal only or I'm missing it, but wanted to bring here and hope we can get some eyes on it. Thanks

@rebron or @ShivanKaul either of you able to handle or pass to whoever can?

Steps to reproduce

  1. Open Brave
  2. Go to content and experience issues
  3. Go to brave://components and realize it won't update

Actual result

image

Expected result

image

Reproduces how often

Intermittent issue

Desktop Brave version (brave://version info)

This has been happening for a very long time across Desktop and Android, with primarily occurring on Desktop. Hope you don't mind me not putting in revision and all here.

Android device

Misc. Please see variety of links in Miscellaneous Information below as an example.

Channel information

Reproducibility

Miscellaneous information

Posts for example:

https://community.brave.com/t/the-adblocker-is-not-working/550312/2

https://community.brave.com/t/why-i-am-seeing-youtube-ads-in-brave-browser-again-and-also-component-update-error/546476

https://community.brave.com/t/fingerprinting-protection-no-longer-as-good/548139/11

https://www.reddit.com/r/brave_browser/comments/1cl3gtc/unable_to_drag_and_drop_files_in_youtube/

https://www.reddit.com/r/brave_browser/comments/1ck069h/ad_block_suddenly_doesnt_work/

https://community.brave.com/t/several-brave-components-are-not-updating/539258

https://community.brave.com/t/widevine-content-decryption-module-status-update-error-version-0-0-0-0/536020

https://community.brave.com/t/youtube-still-blocking-ads-component-issue/531055

https://community.brave.com/t/getting-ad-blocker-from-youtube/528672/6

https://community.brave.com/t/update-errors-on-components-page/519950

https://community.brave.com/t/brave-component-updates-fail-with-error/513846

https://community.brave.com/t/component-update-issue/510694

https://community.brave.com/t/youtube-ad-blocking-was-glitched/497287/5

https://community.brave.com/t/brave-shields-is-not-working/445208/8

https://community.brave.com/t/brave-ads-resources-error/271085

https://community.brave.com/t/brave-android-ad-block-doesnt-block-ads-brave-adblock-page-is-empty/215943

https://community.brave.com/t/brave-shields-ad-blocker-not-working-after-new-install/181478

https://community.brave.com/t/internal-component-fail-to-update/149628

https://community.brave.com/t/brave-stopped-blocking-ads/538720/17

Examples of suggested workarounds/solutions

https://community.brave.com/t/brave-stopped-blocking-ads/538720/32

https://community.brave.com/t/brave-stopped-blocking-ads/538720/8

https://community.brave.com/t/brave-stopped-blocking-ads/538720/13

Brave-Matt commented 1 month ago

cc @ryanbr @rebron

ShivanKaul commented 1 month ago

Thanks @Saoiray, we're looking into this but we haven't been able to repro so far.

ShivanKaul commented 1 month ago

@Saoiray are you on Windows?

Saoiray commented 1 month ago

Hey @ShivanKaul. Before I answer, let me emphasize I'm not personally experiencing this issue. I created the Github to report it as it's an ongoing issue that I keep seeing raise its ugly little head on Reddit, Brave Community, etc. That said, I am on Windows 11 Pro.

To give a brief rundown, this has happened randomly for over a year. Originally just launching Brave as administrator would resolve it completely. However, newer replies have said this only resolves it on a per session basis and the next time they launch Brave regularly the issue returns.

The more long-term solution at this time had been more like the one proposed at https://community.brave.com/t/brave-stopped-blocking-ads/538720/8 and is further explained at https://community.brave.com/t/brave-stopped-blocking-ads/538720/13

Beyond that, I know I've also seen it resolved just simply by telling people to do a new installation on top of their current browser to do a forced manual update, though this isn't 100% accurate.

In summary, I guess it just seems like at some point during updates Brave is losing privileges on devices. There never seems to be any shared firewall, internet security, or anything in common. Then as people experience this, they come to say things like Brave is no longer blocking ads.

But I get that randomness and not being able to directly reproduce might make this challenging. But I did at least try to provide variety of links so you guys can kind of see it happening and have data there. This includes an ongoing post at https://community.brave.com/t/the-adblocker-is-not-working/550312 if you or others want to try to get info from them while they are experiencing the issue.

Saoiray commented 1 month ago

And another new one at https://www.reddit.com/r/brave_browser/comments/1d5t3pd/brave_browser_stopped_blocking_ads_unless_i_run/

ShivanKaul commented 1 month ago

So far all of these look like they're on Windows and are related to folder permissions.

Saoiray commented 1 month ago

So far all of these look like they're on Windows and are related to folder permissions.

Yeah, I mentioned primarily seeing it on Desktop. In terms of folder permissions, I guess struggle is determining why people are losing permissions. Perhaps it's related to what TEMP-ad was mentioning.

Btw, have one more shared today

https://community.brave.com/t/youtube-ads-on-brave-browser-need-assistance/552112

Saoiray commented 3 weeks ago

Another +1 https://community.brave.com/t/fingerprinting-protection-blocklist-update-error/553270

bsclifton commented 1 week ago

Hi folks - thanks for capturing all the incidents, @Saoiray

I'd like to propose some steps we can try with users in the future. If this works, we can consider putting a permissions check in place in Brave and then linking to a help article with steps similar to this.

If the person is NOT on Windows, I think there is a different problem. We should capture information about that in a new issue.

When issue happens

  1. Find out if install was a system level install or a user level install.

    • System level means prompt elevated installer to Admin when doing the install.
    • You can tell if it's system level because it'll be installed at %programfiles%\BraveSoftware\Brave-Browser\Application
    • User level will be installed to %LOCALAPPDATA%\BraveSoftware\Brave-Browser\Application
  2. Let's check the profile directory.

    • Windows + R, paste in %LOCALAPPDATA%\BraveSoftware\Brave-Browser\ (or whichever channel affected), and hit enter
    • Once folder is open, right click User Data folder and pick Properties.
    • Click Security tab
    • Make sure the user account the person is running is in the Group of user names field. For example, my account is brian image If that is NOT set, add the user by clicking Edit and then adding the user account.
    • If the user IS in that list, click the Advanced button image
    • Ensure the user account the person is running is listed as the OWNER image
    • If that user account is NOT the owner
    • click Change image
    • Enter the user account, hit Check Names to make sure it's valid, then hit OK image
    • Once that window closes, check the bottom left of the new window
    • Tick the box Replace all child object permission entries with inheritable permission entries from this object and then click Apply image
  3. If the above does NOT fix the issue, we'll need to dig in more.

Why can this happen?

If someone is copying the directory over from another machine or restoring a backup, the folder might not have the current user as the owner of the directory.

If the above steps don't help, there might be another root cause too - which we'll need to find.

ghost commented 1 week ago

@bsclifton

I don't think that's the reason why this happens to many people. I know that because people haven't said anything about copying anything over, but adblocker just stopped working, and then I give the fix and they say it worked, which means it's just for some reason Brave got started as Administrator.

The issue can be replicated by starting any version as admin: All users installation, Per user or Standalone/Zipped/Portable, you will get the same problem, and this only affects the version numbers of the components, not other folders (apparently).

The best way to see this is by brave.exe --user-data-dir=%USERPROFILE%\Desktop\TEMP in Terminal (Admin) and you will see any component version downloaded will look like this:

image

If you close brave and now start brave.exe --user-data-dir=%USERPROFILE%\Desktop\TEMP without admin rights, you will see you can't update the components anymore and you can't even access the folders anymore without you doing it from a file manager with admin rights or Terminal (I use Far).

And that's because as you can see user can't read or write the folder, which causes the folder to be there, but since Brave can't access the folder without admin rights, it causes an error where it can't download a new version.

Of course, the inheritance has to be properly fixed, if not Brave can never access and download new versions of the components.

How to properly fix this? It's very simple.

GUI: You go to the Advanced Security Settings from the User Data folder (TEMP in the case of --user-data-dir=), and just disable inheritance and remove all inherited permissions from this object, and then instead of hitting apply, just just Enable the inheritance so it only does it once. This will force all files to app to get the proper inheritance from the %userprofile% for the three SYSTEM, Administrators and Users.

CMD You start terminal with admin rights and use icacls "User Data" /t /reset or TEMP or whatever folder you placed the User Data and done. or you CD the user data and icacls * /t /reset and it will simply fix it by resetting and adding the proper inhiritance.

When did this started?

It started with https://github.com/brave/brave-browser/releases/tag/v1.53.43 when Chromium 114 got released in Nightly. You should see the same exact behavior in that version.

If you use https://github.com/brave/brave-browser/releases/tag/v1.53.42 the behavior is different, but it was never 'good'.

1.53.42 will work after starting the browser with admin rights, the problem is it is still not inheriting the permissions correctly, it the User permission will only be Read & Execute. Which means, it will be able to read and download new versions BUT it won't remove the old versions, which means you will accumulate all versions a component updates until you fix the inheritance issues, because the folder doesn't have permissions to write.

image

So the permissions were never set correctly to begin with as you can see, TrustedInstaller, CREATOR OWNER, ALL APPLICATIONS AND ALL PACKAGES, and no inherited permissions (Heredado de Objecto primario = Inherited from None), but they were better than what's going on now, at least the updates happened even if they didn't get removed on exit.

That's the whole story about this, easy to reproduce, easy to manually fix, and it is something being caused by whatever it is downloading the components and for some reason doing some strange magic by avoiding giving proper inheritance to the folder, it's only giving 2 of 3 permissions, which I have never seen happening, because you can't really do it, but I guess, and apparently, you can do somehow.

bsclifton commented 1 week ago

@TEMP-ad this is great information - thank you! I'll dig in some more and try to share an update