-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Google components automatic update fails #10464
Comments
Compiling some findings here. Starting Brave Nightly with flags
Even though the log says https://update.googleapis.com/..., I don't think Brave actually requests this URL. Because with
This seems to be a response from Brave servers. The components whose automatic update produce "Update errors" for me are:
I get "Component not updated" for the remaining 5 components:
These successes / errors are the same across Brave restarts. What's interesting is that error'd automatic update requests do succeed manually. So pressing the "Check for update" button next to "MEI Preload" for example works and eventually says "Component not updated". My hypothesis is the following: During an automatic update, the client asks the server "I have components 1,2,3,... Is there an update?" I can see in the logs that the server responds with only a partial response. It says "there are no updates for components 3, 7, 8". So it does not say "there is no update for component 1". I believe it is this that leads to the update errors. My hypothesis is further confirmed by the fact that checking for an update for a specific component manually does return the "no update" available response. Specifically: Update request for all components:
Response - note that many of the components for which an update was requested are missing:
On the other hand, here is the manual update request for a failed component (MEI Preload):
This component was not mentioned in the response to the automatic update check above. But it is mentioned in the response to the specific request:
The hypothesis is also confirmed by the fact that Chrome's servers do return |
@mihaiplesa do you know who maintains https://go-updater.brave.com/extensions? I have a suspicion that the problem described in this issue is caused by a bug in that server implementation. |
@jumde @linhkikuchi might be able to point in the right direction. |
Hi @jumde @linhkikuchi I think https://go-updater.brave.com/extensions may be returning invalid responses in some cases. Specifically: Brave's component update check sends a request to this URL asking "I have components 1,2,3, is there an update?". But the URL only responds "there is no update for component 2". It should, I think, respond "there are no updates for components 1, 2, 3". Google's implementation https://update.googleapis.com/service/update2/json does this. Further details are above. Are you able to look into this, do you know who can look into it, or can you give me instructions how I can look into it? |
@mherrmann - Code for go-updater.brave.com is here: |
Thanks @jumde! |
@jumde I looked at go-update and it seems to confirm my suspicion. What do you think of my hypothesis? Here it is again, in detail: I suspect that the update client expects to receive a We could verify my hypothesis by you adding an entry to DynamoDb for one of the failing components listed above. If my hypothesis turns out to be correct: Should I submit a PR to go-update that fetches and caches responses from componentupdater.brave.com? |
@jumde an update please? I'm blocked on your response. |
@mherrmann - If the component is not in the Let me dig into this a bit more to see what's going on, will share an update shortly. |
I think the request is only redirected when only one component is requested. It seems to me that when multiple components are requested, only those that are in Brave's DynamoDb are returned. That's where the problem comes from, I think. Thank you for looking into it! |
@jumde advised me via Slack how this can be fixed. He agrees with my analysis of the cause of the problem. However, my proposed solution won't work. For legal reasons, the Widevine component must be fetched from Google's servers. We are not allowed to set up a Brave proxy that mirrors Google's updates to this component. Just to recapitulate: In an automatic update check, the component updater asks "are there updates for <brave component 1>, <brave component 2>, ..., <google component 1>, <google component 2>, ...". For legal reasons, Brave's update server can't return responses for all Google components, in particular the Widevine component. But the updater expects to receive a response for all the components it requested. This leads to the error described in this issue. An important detail is that Brave's update server (go-updater) is able to handle update requests for a single Google component. The reason for this is that in this case it returns a redirect to Google's update server. This is what happens in on-demand updates of single components, hence why those updates do work. To fix the problem, @jumde suggested we iterate over the components one by one. I'm looking into how best to implement this. Currently, I'm torn between |
Verified that my fix works in Nightly v1.20.65 on Linux and Android. Linux: Android: |
Verification passed on
Clean profileConfirmed
Upgraded profileInstalled 1.19.78 (Dev) and confirmed
Verification passed on
Verified test plan from the description Clean profile Upgraded profile. Upgraded from 1.19.x. Verified passed with
Confirmed no component errors. |
Description
Automatic updates for google components fail.
Steps to Reproduce
Actual result:
Components like CRLSets error out
Expected result:
No error
Reproduces how often:
Easily
Brave version (brave://version info)
1.12.42 Chromium: 83.0.4103.106 (Official Build) nightly (64-bit)
The text was updated successfully, but these errors were encountered: