Closed Bug 1852412 Opened 1 year ago Closed 5 months ago

[win11] setAsDefaultUserChoice fails on some devices

Categories

(Firefox :: Shell Integration, defect, P2)

Desktop
Windows 11
defect

Tracking

()

RESOLVED WONTFIX
Tracking Status
firefox119 --- wontfix
firefox120 --- affected

People

(Reporter: emk, Assigned: michaelahughesuk)

References

Details

Attachments

(7 files)

My patch in bug 1851596 only fixes the fallback behavior. We should investigate why WDBA fails to set default with user choice and fix it if possible.

+++ This bug was initially created as a clone of Bug #1851596 +++

Found in

  • 118.0b4

Affected versions

  • 119.0a1 (2023-09-04)
  • 118.0b4
  • 117.0
  • 115.2esr

Tested platforms

  • Affected platforms: Windows 11x64
  • Unaffected platforms: macOS 13, Ubuntu 22.1, Windows 10x64

Preconditions

  • Firefox is not the default browser.

Steps to reproduce

  1. Open the Preferences page and click on the Make Default button.
  2. Close the newly opened window.
  3. Click on the Make Default button again.

Expected result

  • The Default Apps window is opened again.

Actual result

  • Nothing happens. Error: WDBA nonzero exit code 2147500037: ErrExeOther ShellService.sys.mjs:567:5 error is displayed in the browser console.

Regression range

Additional notes

  • I have Windows 22H2 (OS Build 22621.2215) Insider Release Preview.
  • We tried on two Windows 11 machines with the same version. It seems that only this station is affected for some reason.
Keywords: regression
No longer regressed by: 1805509

(In reply to Masatoshi Kimura [:emk] from comment #0)

  • Nothing happens. Error: WDBA nonzero exit code 2147500037: ErrExeOther ShellService.sys.mjs:567:5 error is displayed in the browser console.

Currently _handleWDBAResult could not identify the error because all error codes will be changed to NS_ERROR_FAILURE that has the same value as E_FAIL. So the telemetry result will always be ErrExeOther.

Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Keywords: leave-open

Have we seen this error in a non-Insider Preview build? Just as a heads up there's potentially a parallel issue specific to setting default specific to Fx119.

Flags: needinfo?(VYV03354)

(In reply to Nick Rishel [:nrishel] from comment #3)

Have we seen this error in a non-Insider Preview build? Just as a heads up there's potentially a parallel issue specific to setting default specific to Fx119.

Redirecting to Alexandru, the original bug reporter. I have never seen this error.

Flags: needinfo?(VYV03354) → needinfo?(atrif)
Attachment #9352375 - Attachment description: Bug 1852412 - Do not fold all error codes into NS_ERROR_FAILURE. r?nalexander → Bug 1852412 - Convert set user choice error types to nsresult. r?nrishel
Pushed by VYV03354@nifty.ne.jp: https://hg.mozilla.org/integration/autoland/rev/db960ca5d490 Convert set user choice error types to nsresult. r=nrishel

(In reply to Masatoshi Kimura [:emk] from comment #4)

(In reply to Nick Rishel [:nrishel] from comment #3)

Have we seen this error in a non-Insider Preview build? Just as a heads up there's potentially a parallel issue specific to setting default specific to Fx119.

Redirecting to Alexandru, the original bug reporter. I have never seen this error.

Sorry for the late response, redirecting this to Giorgia because I don't have a noninsider Windows 11 build atm.

Flags: needinfo?(atrif) → needinfo?(gmoldovan)

Please retest you did in bug 1851596 with the latest (changeset daceab96e958 or newer) Nightly.
If the default browser changed correctly when you click "Make Default", we can close this bug.
If "Default apps" settings open when you click "Make Default", please tell me the Browser Console output.

Flags: needinfo?(atrif)

(In reply to Masatoshi Kimura [:emk] from comment #8)

Please retest you did in bug 1851596 with the latest (changeset daceab96e958 or newer) Nightly.
If the default browser changed correctly when you click "Make Default", we can close this bug.
If "Default apps" settings open when you click "Make Default", please tell me the Browser Console output.

Hello! Sure. On the same Windows 11 machine I downloaded daceab96e958 zip archive.
Unfortunately, the "Default apps" settings open when I click "Make Default" from the preferences page.
When Make Default was clicked for the first time on a new profile this error was displayed:
Error: checkAllProgIDsExist() failed
After closing the Default apps and clicking again the Make Default this error is displayed Error: WDBA nonzero exit code 2147500037: ErrExeOther
Now I see only the Error: WDBA nonzero exit code 2147500037: ErrExeOther error when clicking the Make default button. Attaching the browser console errors.

If more information is needed please let me know.

Flags: needinfo?(atrif)

Do "Default apps" settings open for the second time or later? Or first time only?

Flags: needinfo?(atrif)

Also, do you see some messages from "Default Browser Agent" in Windows Event Log?

Attached image image.png

(In reply to Masatoshi Kimura [:emk] from comment #10)

Do "Default apps" settings open for the second time or later? Or first time only?

The Default Apps is opened each time the Make Default... button is clicked.

(In reply to Masatoshi Kimura [:emk] from comment #11)

Also, do you see some messages from "Default Browser Agent" in Windows Event Log?

Yes. Although I'm not sure if this screenshot helps.

Flags: needinfo?(atrif)

(In reply to Alexandru Trif, Desktop QA [:atrif] from comment #12)

Created attachment 9352885 [details]
image.png

(In reply to Masatoshi Kimura [:emk] from comment #10)

Do "Default apps" settings open for the second time or later? Or first time only?

The Default Apps is opened each time the Make Default... button is clicked.

(In reply to Masatoshi Kimura [:emk] from comment #11)

Also, do you see some messages from "Default Browser Agent" in Windows Event Log?

Yes. Although I'm not sure if this screenshot helps.

Thank you very much, it is very helpful. Firefox failed to delete UserChoice key with ERROR_ACCESS_DENIED here. (permission problem?)

Please run the following PowerShell commands instead.

(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\UserChoice').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https').Access
(Get-Acl 'HKCU:SOFTWARE\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice').Access
Attached file powershell.txt

Sure! I hope this helps.

Flags: needinfo?(atrif)

Thanks you. But I could not find any ACLs that denies deleting the UserChoice key.
Do you install any security software?

Attached image image.png

(In reply to Masatoshi Kimura [:emk] from comment #17)

Thanks you. But I could not find any ACLs that denies deleting the UserChoice key.
Do you install any security software?

This is my current software list. This is a test machine, so I usually test various antiviruses on it. I will uninstall Avira to see if this is the culprit.

Attached image default_00.gif

Sorry, but I'm hitting the same behavior after Avira uninstall. (see screen recording)

(In reply to Alexandru Trif, Desktop QA [:atrif] from comment #7)

(In reply to Masatoshi Kimura [:emk] from comment #4)

(In reply to Nick Rishel [:nrishel] from comment #3)

Have we seen this error in a non-Insider Preview build? Just as a heads up there's potentially a parallel issue specific to setting default specific to Fx119.

Redirecting to Alexandru, the original bug reporter. I have never seen this error.

Sorry for the late response, redirecting this to Giorgia because I don't have a noninsider Windows 11 build atm.

I have tried to reproduce this issue on an affected Nightly build and latest beta build on two non-Insider Windows 11, but without success.
Windows 11 Version 22H2 (OS Build 22621.2134)
Windows 11 Version 22H2 (OS Build 22621.525)

It seems that only Insider Preview builds are affected. I reproduce the error Alex mentioned in Comment 9 Error: WDBA nonzero exit code 2147500037: ErrExeOther on a Windows 11 Pro Insider Preview Version 22H2 (OS Build 23541) using the latest Nightly build (20230913092556). Clicking the Make default button will open the Default Apps window every time.

Flags: needinfo?(gmoldovan)

Unassigning as I have no idea how to fix this atm.

Assignee: VYV03354 → nobody
Status: ASSIGNED → NEW
  • I have Windows 22H2 (OS Build 22621.2215) Insider Release Preview.

Could you reproduce the problem after updating to newer builds? I suspect this is a bug of specific Insider Preview builds.

Flags: needinfo?(atrif)

(In reply to Masatoshi Kimura [:emk] from comment #22)

  • I have Windows 22H2 (OS Build 22621.2215) Insider Release Preview.

Could you reproduce the problem after updating to newer builds? I suspect this is a bug of specific Insider Preview builds.

I updated to the latest Windows 11 Insider Release Preview build which for me is Version 22H2 (OS Build 22621.2359). Clicking the Make default button still opens the Settings > Apps >Default Apps > Firefox Nightly window each time with Firefox 119.0a1 (2023-09-14). I have also created a new Windows administrator profile and the problem can be seen there as well :(. Maybe my Windows installation has some problems?!

Note: the same error is displayed in the browser console on each Make default click:
Error: WDBA nonzero exit code 2147500037: ErrExeOther WDBAError resource:///modules/ShellService.sys.mjs:527 _handleWDBAResult resource:///modules/ShellService.sys.mjs:496 setAsDefaultUserChoice resource:///modules/ShellService.sys.mjs:287 setDefaultBrowser resource:///modules/ShellService.sys.mjs:354 setDefaultBrowser chrome://browser/content/preferences/main.js:1727 ShellService.sys.mjs:355:17 setDefaultBrowser resource:///modules/ShellService.sys.mjs:355

Flags: needinfo?(atrif)
Priority: -- → P2

This issue is tracking two distinct bugs which happened to coincide; one of which has since been resolved.

:atrif could you spin off a new ticket for the Win11 Insider Preview specific issue and observations?

Flags: needinfo?(atrif)
Assignee: nobody → mhughes

I could reproduce the issue with Insider Preview Build 22621.2359!

Writing to/Deleting HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice or HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice fails with ERROR_ACCESS_DENIED somehow even if we are UAC elevated.

But Registry Editor can delete the UserChoice key and PS-SFTA works without Admin privs. I guess Microsoft tries to block tampering the UserChoice key from non-Microsoft binary.

I found the following statement in the release note of Build 22621.2213:

Also Edge's [Make default] button does no longer set itself as a default without UI on those Insider Preview builds. So I concluded that this is an intentional change by Microsoft. Suggesting WONTFIX.

(In reply to Nick Rishel [:nrishel] from comment #24)

This issue is tracking two distinct bugs which happened to coincide; one of which has since been resolved.

:atrif could you spin off a new ticket for the Win11 Insider Preview specific issue and observations?

I think bug 1851596 and bug 1850631 cover the already resolved issue (fallback behavior) and I filed this bug for the remaining problem (one-click-default does not work). So I don't think yet another bug is required.

I can repro this locally now with one of the Inside Preview builds of Windows (Make Default... from Firefox launches the Default Apps system preferences box. I also see an error in my system Event Viewer (access is denied, when trying to delete a registry key).

:mhughes Can you recreated in current stable builds or just nightly?

Flags: needinfo?(mhughes)

Windows 11 Insider Preview Build 22621.2361 (Release Preview) still has this bug (or feature).

(In reply to Nick Rishel [:nrishel] from comment #29)

:mhughes Can you recreated in current stable builds or just nightly?

I can repro in both stable and nightly.

Flags: needinfo?(mhughes)
Blocks: 1855340

We've investigated a bit more this issue, and we can confirm that the problem - Firefox is not set as default browser when clicking on the "Make default..." button, instead, Windows is opening the Default apps dialog, is still reproducible on latest Nightly 120.0a1 under Win 11, Version 22H2 (OS Build, 23550.1000), insider preview on dev channel.

We cannot reproduce the issue on a VM with Win 11 non-insider, Version 22H2 (OS Build, 22621.2283), the latest Nightly 120.0a1 is made default browser, after clicking one time on the "Make default..." button from "about:preferences#general" page.

(In reply to Nick Rishel [:nrishel] from comment #24)

This issue is tracking two distinct bugs which happened to coincide; one of which has since been resolved.

:atrif could you spin off a new ticket for the Win11 Insider Preview specific issue and observations?

Sorry, I was on PTO. Is this still needed?

I have also taken a look at this today and here are the results:

Installed a fresh install for Windows 11x64 22H2 without insider preview on a VM. First, it was updated to 22621.2283 where I could not reproduce the issue (one click default worked as expected on all the latest Firefox versions). The only thing worth mentioning on this build is that on Firefox 118.0.1 and 115.3.1esr when the Make default button was clicked for the first time it opened the default apps window. Clicking it the second time will make Firefox as default browser. On the latest nightly and 119.0b3, the Firefox browser was set as default on the first click.

Updated the Windows 11 installation again to 22621.2361 (manual update) and I still cannot reproduce the issue on the VM. Clicking the Make default button will make the Firefox browser as default on one click without opening the Default Apps window. Tested with (latest nightly, 119.0b3, 118.0.1, 115.3.1esr)

I can still reproduce the one-click issue with all Firefox versions on my other PC with 22621.2361 (where I initially encountered bug 1851596) which is enrolled in Insider Release Preview. Clicking the Make Default button will open the Default Apps window each time when clicked. This is strange because they are both on the same version and the only difference I know of is that one is enrolled on the Insider Release channel and one is not enrolled at all. If more information is needed please let us know. Thank you!

Flags: needinfo?(atrif)

(In reply to Alexandru Trif, Desktop QA [:atrif] [PTO: 18-29 Sept, please ni? :mboldan] from comment #34)

The only thing worth mentioning on this build is that on Firefox 118.0.1 and 115.3.1esr when the Make default button was clicked for the first time it opened the default apps window. Clicking it the second time will make Firefox as default browser.

That's odd, almost sounds like there's a race condition occurring? I kind of wonder if we're racing Windows the default before us.

I think Alexandru uses zip builds for 118.0.1 and 115.3.1esr. If so, it is expected that the first time clicking will fail. If the installer did not register Firefox as a browser, Firefox calls setDefaultBrowserUserChoice before Firefox registers itself when the user clicks the Make default button.. Once Firefox is registered, setDefaultBrowserUserChoice will work correctly. It it will only fail for the first time. In any case, it is out of scope of this bug.

(In reply to Masatoshi Kimura [:emk] from comment #36)

I think Alexandru uses zip builds for 118.0.1 and 115.3.1esr. If so, it is expected that the first time clicking will fail.

Yes, you are correct. 118.0.1 and 115.3.1esr were zip builds.

I cloned my Windows 11 VM two times and enrolled in Release Preview. After restarting and checking for updates kb5030651 was applied and the one click was still working. Restarted Windows 11 VM and the one click was no longer working... Repeated the same steps on another cloned VM and the one click was still working...

Blocks: 1858006

This bug does not have to do with auto-pin.

No longer blocks: 1858006, 1855340

With today's non-Insider update (build 22621.2428), one-click-default works with official Mozilla builds (Nightly and Release 118.0.2), but does not work with the local build.

Sorry, I forgot that I disabled browser.shell.setDefaultBrowserUserChoice on my profile that the local build used. One-click-default works.

Confirming as well that one-click-default still works with my non-insider Windows 11x64 22H2 (22621.2428) with Firefox 120.0a1 (2023-10-10), 119.0b7, 118.0.2 and 115.3.1esr.

Unfortunately, the one-click-default still does not work after the update on my enrolled Release Insider Windows 11x64 22h2 (22621.2428) with Firefox 120.0a1 (2023-10-10) and 119.0b7.

So is my understanding correct that this is reliably failing on some Insider Preview systems, and reliably succeeding on other Insider Previews, with no clear difference in versions?

S3, not great when this fails I believe the fallback is triggering.

:emk I can no longer reason about what information in this report is due to the parallel issue with similar source that has since been fixed. My assumption for now is that the default settings fallback is running, but if this is incorrect we can increase the severity.

Severity: -- → S3

(In reply to Nick Rishel [:nrishel] from comment #42)

So is my understanding correct that this is reliably failing on some Insider Preview systems, and reliably succeeding on other Insider Previews, with no clear difference in versions?

It is succeeding on non-Insider Previews even if the build number is the same as Insider's one, as far as I know.

Backed out due to changes breaking both Default Agent telemetry and launching Firefox in response to interaction with the Default Agent notifications.

Depends on D190868

Attachment #9358189 - Attachment description: Backed out changeset db960ca5d490 (Bug 1852412) → WIP: Backed out changeset db960ca5d490 (Bug 1852412)
Attachment #9358189 - Attachment description: WIP: Backed out changeset db960ca5d490 (Bug 1852412) → Backed out changeset db960ca5d490 (Bug 1852412)

Hello! We want to leave these notes here (we encountered this when testing the MSIX one-click default):

We downloaded and installed Windows 11 23H2 on two VMs. One-click set as default worked on both Windows 11 23H2 (22631.2428) VMS on MSIX and normal installers (if bug 1863980 was not encountered on MSIX)
We updated both VMs to Windows 11 23H2 (22631.2715) and here are the results:

  • on one VM the one-click set as default worked until a system restart
  • on the other VM the one-click set as default is still working after a system restart

The difference was that one was installed with the RO region and one with the US region, Idk if this matters because one colleague has the Windows 11 RO region installed as well but 22H2.2715 and one-click set as default works. Maybe this is some kind of rollout from Microsoft.

Closing the loop on this, we found this was part of a Windows roll out that broke 1-click set-to-default. We have since landed a complimentary guidance notification to accompany the existing fallback to Windows Settings.

Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: