Thursday, June 07, 2007

"Firefox is Running..." Even when it isn't...

Quick Firefox tip.

The other day I was playing around on one of my Windows system with both Firefox 2.x and Firefox 3 (Minefield) that I didn't previously have Minefield running on.

I made a copy of my current (primary) user profile and then associated Minefield to that 2nd one to avoid any potential corruption issues.

When I was all done with the testing, I deleted the Firefox profile copy I had created as well as the Minefield build from my system.

Then I went to launch my regular Firefox session and got the following error I had never seen before:

Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system.

Pitch one...strike one

No problem. I've done that before when I tried to shut down and relaunch Firefox.exe before it had fully closed the previous process.

So I opened up Process Explorer (or you could use Task Manager) with plans to shut it down. Only it wasn't running at all.

I relaunched and got the same error...even though it wasn't running anywhere on my system. Rebooting the system didn't help. I even tried launching Firefox in its safe mode, but got the exact same error. That's not good.

Hmmm.

Pitch two...strike two

So I did some research and found a tip by Matt Cutts that sometimes if Firefox exits unexpectedly, it can leave a "parent.lock" file in your profile (Win). (Linux and Mac builds differ slightly: more details at this MozillaZine KB article)

I went looking but didn't find the offending file.

Pitch three...home run!

A little bit more research on the web led me to two posts that contained the solution: Firefox was trying to launch a bad/missing profile.

Simply fixed.

I just went into the property settings for the Firefox shortcut icon on my desktop and changed the Target line to read: "C:\Program Files\Mozilla Firefox\firefox.exe" -profilemanager

Or you could also use "C:\Program Files\Mozilla Firefox\firefox.exe" -P

Then I relaunched the icon and this time got the Firefox profile manager. I was able to quickly see which one was the bad profile...the one I had deleted from my hard drive, but not removed from the profile manager. Oops!

I deleted that one and then set it to launch my old "default" profile.

Worked like a charm.

Then I went back to my modded shortcut and removed the extra -profilemanager I had added and was back to launching Firefox like normal.

  • Bonus tip: You might also want to just make a second "profile manager launching shortcut" before you fix the original back. Then copy it into your Firefox start-menu program list. That way you can use that one next time. Just be sure to rename it something like "Firefox - Profile Manager Launcher" or whatever so you can tell them apart.

Now you know: Sometimes when Mozilla says "Firefox is already running" what they really mean to say is "Firefox is trying to run, but can't figure out which profile to use, you dunderhead..."

Sheesh.

Two more semi-related items:

--Claus

4 comments:

Jim said...

As someone who has also seen and had to solve these three strikes (and they can happen on unix boxes too), I have to say that Firefox's handling of user profiles, and detecting when they are busy, is one of the most klunky things in the browser's design. It's not hard to tag a lock file with a process ID, and check at runtime to see whether the locking process still exists. Likewise, it's not hard (even easier, actually) to see whether a profile directory exists. So why doesn't Firefox do a better job of diagnosing these problems instead of lazily falling back to the "already running" error? Seems like pure laziness to me.

Anonymous said...

I have the same conclusion. The message is totally meaningless and only googling can help you finding real problem and its solution.

Anonymous said...

to claus:

thank you so much for this blog entry.

without a firefox support phone line, i had to seriously spend more than a month online searching for solutions for that damn error message.

the only stuff i could find only addressed how to solve strikes 1 and 2. which was absolutely useless to me

i finally come upon your website and fixed it in 5 mins!

again, thanks alot

Kyle said...

Very helpful solution. Thanks for the advice!