Maintenance Service gets turned off after occasional failures spread over many updates, because successful updates do not reset the error count
Categories
(Toolkit :: Application Update, defect)
Tracking
()
People
(Reporter: yannis, Assigned: yannis)
References
Details
handleUpdateFailure counts Maintenance Service failures in app.update.service.errors. When the count is already at app.update.service.maxErrors (default 10) and one more service error happens, it sets app.update.service.enabled to false for the profile.
The count is only reset when an update fails with an error that is neither in SERVICE_ERRORS nor in the retried group (write errors, ELEVATION_CANCELED, SILENT_UPDATE_NEEDED_ELEVATION_ERROR, BACKGROUND_TASK_SHARING_VIOLATION). A successful update never resets it.
As a result, occasional service failures add up over the lifetime of the profile, spread over many unrelated updates, even when the service installs most updates fine. After enough of them, the service is turned off for good. From then on:
- every update needs the UAC prompt, and fails for users who cannot or do not accept it (for example standard, non-admin accounts), see e.g. bug 2033218;
- background updates that need elevation can no longer complete silently.
The safety net is meant for profiles where the service is consistently broken, not for a service that fails now and then. Bug 2058359 re-enabled the service once for affected profiles, but without this change their count builds up again.
| Assignee | ||
Comment 1•10 days ago
•
|
||
One problem with making every success reset the counter is that for a profile whose service is always broken, every update would start with a service attempt that is bound to fail before falling back. Depending on the failure, that means a delay before the updater gives up on the service (it can wait up to 10 minutes for the service to stop), an additional restart to retry without the service, or both. The user then still gets the UAC prompt, so the service only adds delay. Today, these profiles go straight to the UAC prompt once the service is turned off.
For this reason I would be in favor of resetting the counter only upon successful updates that went through the maintenance service. However, :spohl mentioned that an update that doesn't use the maintenance service may fix the maintenance service issue, so we probably want a mechanism that gives a chance to new updates as well. I feel like that mechanism should not just be resetting the counter though, because of the problem I expose in the previous paragraph.
Comment 2•10 days ago
|
||
| frontend-triage | ||
UpdateService.sys.mjs counts service errors cumulatively, and the STATE_SUCCEEDED branch of #asyncInit at #3267 clears app.update.cancelations and app.update.elevate.attempts but never app.update.service.errors. The update's prior pending-service state cannot stand in for "the service installed it": updater.cpp falls back to a UAC prompt in the same run and still writes succeeded (as fallbackOnSvcFailure.js exercises), and the startup service-error path through handleUpdateFailure never saves active-update.xml, so the retry can still read pending-service.
Fix: Have the updater record that the install ran with sElevationType == ElevationType::ElevatedByMMS, for example as a field next to install_timestamp in WriteUpdateTelemetry (#2824), and clear app.update.service.errors in the STATE_SUCCEEDED branch only when that marker is present, which matches comment 1 and keeps always-broken services disabled. Cover it with a new xpcshell test in unit_aus_update modeled on cleanupSuccessLogMove.js, with a marker case that clears the pref and a no-marker case that keeps it.
Suggested severity: S2. Any Windows profile that collects ten occasional service failures loses silent updates for good, so standard-account users like the reporter of bug 2033218 get a UAC prompt they cannot accept and stay unpatched, and the only workaround is a hidden about:config pref.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-{wrong-file, wrong-cause, hallucination, out-of-scope, not-a-bug, wrong-fix, shallow-fix, wrong-severity}.
Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.
Comment 3•10 days ago
|
||
(In reply to Yannis Juglaret [:yannis] from comment #1)
One problem with making every success reset the counter is that for a profile whose service is always broken, every update would start with a service attempt that is bound to fail before falling back. Depending on the failure, that means a delay before the updater gives up on the service (it can wait up to 10 minutes for the service to stop), an additional restart to retry without the service, or both. The user then still gets the UAC prompt, so the service only adds delay. Today, these profiles go straight to the UAC prompt once the service is turned off.
For this reason I would be in favor of resetting the counter only upon successful updates that went through the maintenance service. However, :spohl mentioned that an update that doesn't use the maintenance service may fix the maintenance service issue, so we probably want a mechanism that gives a chance to new updates as well. I feel like that mechanism should not just be resetting the counter though, because of the problem I expose in the previous paragraph.
I'm worried that not resetting this pref during "other" updates is going to miss out on the possibility that our many fixes to the installer/updater/maintenance service etc. reach affected users. If the main concern is the delay to install an update, can we pursue a compromise? For example, the regular number of attempts before disabling the service is 10. If an update succeeds through any other method, it could be reduced to 5, or 2, to give the maintenance service an opportunity to resume? If the maintenance service then succeeds at updating, it could revert to the default of 10 attempts.
| Assignee | ||
Comment 4•9 days ago
|
||
(In reply to Stephen A Pohl [:spohl] from comment #3)
If an update succeeds through any other method, it could be reduced to 5, or 2, to give the maintenance service an opportunity to resume? If the maintenance service then succeeds at updating, it could revert to the default of 10 attempts.
How does this proposition differ from just never disabling app.update.service.enabled ourselves? Because I'd hope that for most people who have a buggy maintenance service, the fallback would generally succeed, and if I understand the proposition we would always be retrying with the maintenance service on the next update?
Comment 5•9 days ago
|
||
(In reply to Yannis Juglaret [:yannis] from comment #4)
(In reply to Stephen A Pohl [:spohl] from comment #3)
If an update succeeds through any other method, it could be reduced to 5, or 2, to give the maintenance service an opportunity to resume? If the maintenance service then succeeds at updating, it could revert to the default of 10 attempts.
How does this proposition differ from just never disabling app.update.service.enabled ourselves? Because I'd hope that for most people who have a buggy maintenance service, the fallback would generally succeed, and if I understand the proposition we would always be retrying with the maintenance service on the next update?
Just recording here that we discussed this in our install & update meeting today and we determined that my recommendation was based on a misunderstanding on my part that we could reach 10 retries for the same update. However, it turns out that there is only ever one try per update version, so a user wouldn't hit this until 10 separate updates to separate versions of Firefox have failed. Yannis is working on a fix.
Description
•