Closed Bug 1252107 Opened 8 years ago Closed 8 years ago

When restarting itself, spawn new Firefox with the same profile/remote setting as old instance

Categories

(Toolkit :: Startup and Profile System, defect)

45 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jasa.david, Unassigned)

Details

(Keywords: steps-wanted)

When restarting Firefox with non-default profile, Firefox with default profile is being launched. This is clearly wrong as the intended purpose of the self-restart feature (e.g. after addon installation) is to get the same profile back, just restarted. The fix should be pretty easy: start the new instance with the same profile/remote settings as the instance that is restarting itself.

Versions tested: up to 45 ESR

Steps to reproduce
1. launch FF as usual to get default profile window
2. launch firefox with "-P -no-remote" CLI options and choose a different profile
   (create one if you don't have any)
3. install addons that requires FF restart
4. hit Restart button

What happens:
a new window of FF with default profile is launched

What should happen instead:
the non-default profile from step 2. should be launched again
Component: General → Startup and Profile System
Product: Firefox → Toolkit
I can't reproduce this.

Ryan, can QA take a look?
Flags: needinfo?(ryanvm)
Maybe it's Linux-only issue.
I have many shortcuts for profiles with "-p -no-remote" on my Win 7 and every time I restart one of them to install an add-on (or to enable/disable HWA/e10s), the same profile is reopen.
(In reply to David Jaša from comment #2)
> Maybe it's Linux-only issue.

Which version of Linux are you on? Did this start recently? More details would be helpful so we can try to reproduce :)
Flags: needinfo?(ryanvm)
(In reply to Ryan VanderMeulen [:RyanVM] from comment #4)
> (In reply to David Jaša from comment #2)
> > Maybe it's Linux-only issue.
> 
> Which version of Linux are you on? Did this start recently? More details
> would be helpful so we can try to reproduce :)
Flags: needinfo?(jasa.david)
It's a long standing issue. I use ESR builds and I encountered it when I started using multiple profiles which was in 31 ESR (or maybe even in 24 ESR). I'm currently using 45 ESR, namely 45.0b10.

OS is RHEL 7 x86_64.
Flags: needinfo?(jasa.david)
(In reply to David Jaša from comment #0)
> 1. launch FF as usual to get default profile window
> 2. launch firefox with "-P -no-remote" CLI options and choose a different
> profile
>    (create one if you don't have any)

How specifically do you "launch" firefox? Does this happen if you directly invoke firefox from the commandline with the full path to its executable? And are these distro installs or "official" copies from mozilla.org ? I'm asking because various start scripts are known to interfere with some of what we do, cf. bug 1155012, and so to reproduce it would be helpful if we know exactly what you do and where it goes wrong.
Flags: needinfo?(jasa.david)
I used a distribution builds only so far so I downloaded the Mozilla's nightly (45.0; and accidentally also latest 38 ESR) and tried them as well. It turns out that versions/builds don't matter all behave the same no matter what combination of default/specific profile I tried:

1) when my default profile without -no-remote is running, new window of this default profile is launched
2) when just this [path/to/]firefox -P my_profile -no-remote is running, it restarts to itself just fine
Flags: needinfo?(jasa.david)
(In reply to David Jaša from comment #8)
> I used a distribution builds only so far so I downloaded the Mozilla's
> nightly (45.0; and accidentally also latest 38 ESR) and tried them as well.
> It turns out that versions/builds don't matter all behave the same no matter
> what combination of default/specific profile I tried:
> 
> 1) when my default profile without -no-remote is running, new window of this
> default profile is launched
> 2) when just this [path/to/]firefox -P my_profile -no-remote is running, it
> restarts to itself just fine

I just tried this on my ubuntu VM and I cannot reproduce there either. Here's what I did. From gnome-terminal, I ran:

~/mc-nightly/firefox

then the profile dialog came up. I started with one of my profiles. Once that was up and running, in a new tab in gnome-terminal, I ran:

~/mc-nightly/firefox -P trunk -no-remote

and in the new instance, opened the add-ons manager. I uninstalled some old-school add-on and clicked the 'restart now' notification at the top of the add-on manager. Once a new window popped up, I then opened a third tab in gnome-terminal and ran:

ps aux | grep firefox

which listed 2 firefox processes. I also verified in the 2 different windows that different lists of add-ons were given.


Please can you give us more specific information about how you launch Firefox? Do you use a desktop icon? From the terminal? Are you using -no-remote with just 1 or 2 leading '-' characters? (1 is what you have stated so far, 2 would be unix convention. Not sure it makes a difference here, but it'd be nice to narrow down where this is going wrong.)

If you use two completely new + clean profiles, does the same thing happen?
Flags: needinfo?(jasa.david)
Keywords: steps-wanted
(In reply to :Gijs Kruitbosch from comment #9)
> (In reply to David Jaša from comment #8)
> > I used a distribution builds only so far so I downloaded the Mozilla's
> > nightly (45.0; and accidentally also latest 38 ESR) and tried them as well.
> > It turns out that versions/builds don't matter all behave the same no matter
> > what combination of default/specific profile I tried:
> > 
> > 1) when my default profile without -no-remote is running, new window of this
> > default profile is launched
> > 2) when just this [path/to/]firefox -P my_profile -no-remote is running, it
> > restarts to itself just fine
> 
> I just tried this on my ubuntu VM and I cannot reproduce there either.
> Here's what I did. From gnome-terminal, I ran:
> 
> ~/mc-nightly/firefox
> 
> then the profile dialog came up. I started with one of my profiles. Once
> that was up and running, in a new tab in gnome-terminal, I ran:
> 
> ~/mc-nightly/firefox -P trunk -no-remote
> 
> and in the new instance, opened the add-ons manager. I uninstalled some
> old-school add-on and clicked the 'restart now' notification at the top of
> the add-on manager. Once a new window popped up, I then opened a third tab
> in gnome-terminal and ran:
> 
> ps aux | grep firefox
> 
> which listed 2 firefox processes. I also verified in the 2 different windows
> that different lists of add-ons were given.
> 
> 
> Please can you give us more specific information about how you launch
> Firefox? Do you use a desktop icon? From the terminal? 

It doesn't change my results but here you go:
1) when no FF is running, I launch default profile using distribution firefox using desktop icon. I also run it directly by calling /usr/bin/firefox launcher (that in turn launches /usr/lib64/firefox/run-mozilla.sh)
2) I launched nighly build from terminal (or Run dialog) using path/to/firefox/firefox and path/to/firefox/run-mozilla.sh
3) usually, I launch other profiles using ProfileSwitcher extension which results in "/usr/bin/firefox -P $profile -no-remote. During this testing, I launched FF with the same options from terminal

but that doesn't matter...

> Are you using
> -no-remote with just 1 or 2 leading '-' characters? (1 is what you have
> stated so far, 2 would be unix convention. Not sure it makes a difference
> here, but it'd be nice to narrow down where this is going wrong.)

$ man firefox | grep no-remote
       -no-remote

> 
> If you use two completely new + clean profiles, does the same thing happen?

This.

It did happen when I used both existing profiles or existing default and clean secondary profile. When I run both clean, it didn't happen. After this, it only happened when I used existing secondary profile...
Flags: needinfo?(jasa.david)
(In reply to David Jaša from comment #10)
> It did happen when I used both existing profiles or existing default and
> clean secondary profile. When I run both clean, it didn't happen. After
> this, it only happened when I used existing secondary profile...

Right, so clearly it's specific to your profile(s). Can you determine what might be causing this in those profiles using Firefox "refresh" (available from about:support - it will back stuff up in a folder on your desktop so you can put them back part-by-part) or by bisecting your add-ons and prefs manually?
Flags: needinfo?(jasa.david)
I think I have the culprit - it's ProfileSwither extension: https://addons.mozilla.org/en-US/firefox/addon/profileswitcher/ . When active in secondary profile, the profile restarts to default profile.
Flags: needinfo?(jasa.david)
(In reply to David Jaša from comment #12)
> I think I have the culprit - it's ProfileSwither extension:
> https://addons.mozilla.org/en-US/firefox/addon/profileswitcher/ . When
> active in secondary profile, the profile restarts to default profile.

OK. In that case, it would be good to contact the profileswitcher folks. As it is, the issue doesn't seem to be Firefox's, so I'm going to close this bug. We can reopen this if the profileswitcher add-on folks can show that it isn't an issue with their code but with specific Firefox APIs that they use, or something like that. Thanks!
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.