Closed Bug 2010535 Opened 10 months ago Closed 10 months ago

Links from external apps don't load, clicking a link brings Firefox to the foreground but the URL doesn't open

Categories

(Toolkit :: Startup and Profile System, defect)

Firefox 149
defect

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox147 --- unaffected
firefox148 + fixed
firefox149 + fixed

People

(Reporter: suishouen, Assigned: mossop)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 external files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:149.0) Gecko/20100101 Firefox/149.0

Steps to reproduce:

Click a link from an external application, or open a webloc file.

Actual results:

the URL doesn't open.

And when opening URL from external application, it hits the following error:
TypeError: can't access property "path", SelectableProfileService.currentProfile is null
redirectCommandLine resource:///modules/profiles/SelectableProfileService.sys.mjs:1731

Expected results:

the URL should open.

The Bugbug bot thinks this bug should belong to the 'Toolkit::Startup and Profile System' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Startup and Profile System
Product: Firefox → Toolkit

This looks like another case of bug 1991913. The selectable profiles service thinks it is active but doesn't have a currentProfile. This specific case was most likely made worse by bug 2010535.

Can you run the following two scripts in the browser console when you're in this state and copy what gets displayed into this report? You may need to enable "Browser chrome and add-on debugging toolboxes" in the web developer tools settings:

  • SelectableProfileService.getAllProfiles().then(p => console.log(p.map(p => p.path)))
  • Services.dirsvc.get("ProfD", Ci.nsIFile).path
Blocks: 1991913
Flags: needinfo?(suishouen)
Keywords: regression
Regressed by: 2004469
Assignee: nobody → dtownsend
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Set release status flags based on info from the regressing bug 2004469

Pushed by dtownsend@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/53c15a78a635 https://hg.mozilla.org/integration/autoland/rev/3cc3953ee50c Fall back to the remoting service for opening URLs if the profile service is in an invalid state. r=profiles-reviewers,jhirsch
Status: ASSIGNED → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch

Even though this is fixed it would be good to get the questions in comment 2 answered because something about your state is broken and I'd like to understand more about what it is.

Attachment #9538094 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: A small number of users will be unable to open links from other applications while Firefox is running
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: The patch is a simple null check
  • String changes made/needed: None
  • Is Android affected?: no

(In reply to Dave Townsend [:mossop] from comment #7)

Even though this is fixed it would be good to get the questions in comment 2 answered because something about your state is broken and I'd like to understand more about what it is.

Is this okay?

18:28:35.179 SelectableProfileService.getAllProfiles().then(p => console.log(p.map(p => p.path)))
18:28:35.209 Promise { <state>: "pending" }
18:28:53.663 Services.dirsvc.get("ProfD", Ci.nsIFile).path
18:28:53.686 "/Users/xxx/Library/Application Support/Firefox/Profiles/xxx.default"

Flags: needinfo?(suishouen)

(In reply to Eiichi from comment #10)

(In reply to Dave Townsend [:mossop] from comment #7)

Even though this is fixed it would be good to get the questions in comment 2 answered because something about your state is broken and I'd like to understand more about what it is.

Is this okay?

18:28:35.179 SelectableProfileService.getAllProfiles().then(p => console.log(p.map(p => p.path)))
18:28:35.209 Promise { <state>: "pending" }

There should have been an additional line logged here.

18:28:53.663 Services.dirsvc.get("ProfD", Ci.nsIFile).path
18:28:53.686 "/Users/xxx/Library/Application Support/Firefox/Profiles/xxx.default"

I don't need the username, but the xxx in the profile directory name is kind of important. It's also random so does not reveal anything about you.

Flags: needinfo?(suishouen)

(In reply to Dave Townsend [:mossop] from comment #11)

I don't need the username, but the xxx in the profile directory name is kind of important. It's also random so does not reveal anything about you.

As follows:

18:28:53.663 Services.dirsvc.get("ProfD", Ci.nsIFile).path
18:28:53.686 "/Users/xxx/Library/Application Support/Firefox/Profiles/2v7gxoyr.default"

Flags: needinfo?(suishouen)

(In reply to Eiichi from comment #12)

(In reply to Dave Townsend [:mossop] from comment #11)

I don't need the username, but the xxx in the profile directory name is kind of important. It's also random so does not reveal anything about you.

As follows:

18:28:53.663 Services.dirsvc.get("ProfD", Ci.nsIFile).path
18:28:53.686 "/Users/xxx/Library/Application Support/Firefox/Profiles/2v7gxoyr.default"

Ok and try running this: await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path)).catch(console.error).

Flags: needinfo?(suishouen)

Ok and try running this: await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path)).catch(console.error).

19:15:23.876 await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path)).catch(console.error)
19:15:23.979 Array []

Flags: needinfo?(suishouen)

Thanks. Can you copy the contents of the browser console from after a fresh start of Firefox into here?

Flags: needinfo?(suishouen)
Attachment #9538094 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

(In reply to Dave Townsend [:mossop] from comment #15)

Thanks. Can you copy the contents of the browser console from after a fresh start of Firefox into here?

As follows:

07:10:12.381 Window.fullScreen attribute is deprecated and will be removed in the future. browser-customtitlebar.js:68:7
07:10:18.225 Unknown property ‘-moz-border-radius’. Declaration dropped. codemirror.css:244:22

Flags: needinfo?(suishouen)

Jared I'm a bit confused by what might be happening here. Eiichi was clearly hitting this codepath which can only happen if the profile service is enabled and initialized. In order to be marked initialized we must have gone through this block which should have seen there was no currentProfile and so counted the profiles in the database, seen there were 0 and so reset state and returned early, so not marked the profile service as initialized.

Any ideas what might be going on?

Flags: needinfo?(jhirsch)

For reference:
I rebuilt my profile and rerun.

15:14:15.767 await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path)).catch(console.error)
15:14:15.870 Array [ "/Users/xxx/Library/Application Support/Firefox/Profiles/8iobnutt.Default User" ]
                          0: "/Users/xxx/Library/Application Support/Firefox/Profiles/8iobnutt.Default User"
                           length: 1
                          <prototype>: Array []

I hope this will be useful.

Eiichi, thanks very much for your help debugging so far!

Let's see. Can you remember if you have created, then deleted, additional profiles in the past using the Profiles menu?

Also, have you manually edited profiles.ini recently?

Could you explain in more detail what you mean by "I rebuilt my profile" in your last comment 19? Does this mean you are now using a different profile than before? I'm asking because the name of the profile directory is different in comment 19 (8iobnutt.Default User) than in the earlier comment 12 (2v7gxoyr.default), and in comment 19 you have a non-empty profile group, where in comment 12 the profile group seemed to be empty.

Finally, if you still have the earlier profile (2v7gxoyr.default), it would be helpful to run Nightly using that profile, open the browser console, then run the following commands and share the result here:

  1. SelectableProfileService.isEnabled
  2. SelectableProfileService.initialized
  3. Same command as before: await SelectableProfileService.getAllProfiles().then(p => p.map(p => p.path)).catch(console.error)
Flags: needinfo?(suishouen)

This is an interesting bug! I also can't see how this state could occur, especially the empty getAllProfiles() result in comment 14.

To reach the line mentioned in comment 0, we need to have SelectableProfileService.isEnabled true, SelectableProfileService.initialized true, and a non-null defaultPath at line 1729 (here) so findDefaultProfilePath must have found something in profiles.ini.

On the other hand, normally we would expect SelectableProfileService.currentProfile to be null and SelectableProfileService.getAllProfiles() to return an empty list in the case where SelectableProfileService.initialized is false.

Looking at SelectableProfileService.getAllProfiles(), one way it could return an empty list is if this.#connection is falsy, but this cannot be true if we are initialized. The other way it could return an empty list is if the Profiles table exists and is empty. But if the table is empty, then SelectableProfileService.init runs the code here, bailing out early, so that SelectableProfileService.initialized never becomes true.

I don't quite see how we can reach this state, but maybe I'll need to be more creative in how I try to break things locally!

Flags: needinfo?(jhirsch)

(In reply to Jared Hirsch [:jhirsch] (he/him) (Needinfo please) from comment #20)

Let's see. Can you remember if you have created, then deleted, additional profiles in the past using the Profiles menu?

No.

Also, have you manually edited profiles.ini recently?

No, I haven't.

Could you explain in more detail what you mean by "I rebuilt my profile" in your last comment 19? Does this mean you are now using a different profile than before? I'm asking because the name of the profile directory is different in comment 19 (8iobnutt.Default User) than in the earlier comment 12 (2v7gxoyr.default), and in comment 19 you have a non-empty profile group, where in comment 12 the profile group seemed to be empty.

I'm sorry I can't provide a clear explanation.
While using the profile (2v7gxoyr.default), I noticed that the "Profiles" menu lacked an "Original Profile (current)" option.
So I refreshed the profile, it now displays the profile (8iobnutt.Default User) as the "Original Profile (current)" and has become the default profile.

Finally, if you still have the earlier profile (2v7gxoyr.default), it would be helpful to run Nightly using that profile, open the browser console, then run the following commands and share the result here:

Unfortunately, I deleted the profile (2v7gxoyr.default), so I can't fulfill your request.

Flags: needinfo?(suishouen)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: