20

I have multiple users on my MacBook (OS X 10.9.5). One of them has parential restrictions, but is allowed to use Firefox. Now, despite that, she is unable to run Firefox: whenever she tries, an error box pops up with the message

Close Firefox
A copy of Firefox is already open. Only one copy of Firefox can be open at a time.

(needless to say that Firefox was not open, neither by her nor by any other user, and that none of the other users has that problem).

It appears this occured after a recent update of Firefox (to version 39.0).

What could be the cause of this? How can I sort this out?

Walter
  • 1,240

10 Answers10

38

Here is what I did to fix the issue:

  • In OS X Terminal, find your currently used Firefox profile directory (something like): $ cd ~/Library/Application\ Support/Firefox/Profiles/ $ ls -l

  • if you have multiple profiles, list the one with the most recent date $ cd rAnd0m.default $ ls -la

  • remove the hidden parentlock file $ rm -v .parentlock

  • try to start Firefox again

(If the problem was not related to the parentlock file, you will see: rm: .parentlock: No such file or directory)

If you prefer to use the Finder, just make hidden dot-files visible first, so you can check for the existence of .parentlock and delete it.

IconDaemon
  • 19,234
ChrisW
  • 626
  • I think making hidden (dot) files visible within Finder is not trivial ... – Walter Nov 30 '16 at 19:36
  • 4
    I found that I also had a 'ghost process' running - @joshua's answer (using ps -wwax | grep firefo) was needed to find and kill it. btw, the process didn't appear in OSX's 'force quit' list. – drevicko Jul 31 '17 at 10:05
  • Thanks. The error dialog should really have an option to do that automatically! – Matt Oct 07 '18 at 16:46
  • this worked for me after https://apple.stackexchange.com/questions/196771/cant-open-firefox-because-a-copy-of-firefox-is-already-open#comment370427_238169 I had planned to "Restore Previous Session" (https://support.mozilla.org/en-US/kb/fix-bookmarks-and-history-will-not-be-functional) and unfortunately when I launched and found a "security" error that meant that bookmarks and history would be inaccessible. once i killed the "ghost process" and restarted firefox, I was in good shape with respect to the error, but now my "previous" session was worthless. – Michael Sep 05 '19 at 01:13
  • Before you do this, first check the Activity Monitor application (in Utilities), sort the process names and remove any Firefox ones. A lot faster and will save you the hassle of rebuilding anything. – garth Jun 14 '22 at 14:34
  • Or more concisely, pkill firefox && find ~/Library/Application\ Support/Firefox/Profiles/ -name .parentlock -delete – miken32 Nov 06 '22 at 15:54
  • I did this, this allows me to open again all my Firefox windows and tabs, however, all my bookmarks and history have been cleared up. – Noil Nov 18 '23 at 11:26
  • NB: All bookmarks and history are now back after a computer restart – Noil Nov 21 '23 at 10:15
18

When I got this message I only had to kill the stray process, no lock was involved for me.

% ps -wwax | grep -i firefo
81106 ??       711:45.58 /Applications/Firefox.app/Contents/MacOS/firefox -foreground
28986 ttys000    0:00.00 grep -i firefo

% kill 81106

Despite the process still being "secretly" alive, there was no Firefox visibile in the cmd-tab task switcher, nor under the cmd-opt-esc Force Quit dialog. Firefox was in this state after a crash/restart.

3

emma24xia's answer is relevant for Windows and not applicable on a Mac due to how the OS differ. On a Mac I think you want to:

Open up Applications/Utilities and launch Activity Monitor.

Look for Firefox in that list. Select it and click the stop-sign icon to force quit that process.

bmike
  • 235,889
  • There were a few firefox processes still running - sort by name so you don't miss them. Clicked info and then quit > force quit and this solved the issue. I wish I'd remembered the Activity Monitor that before I tried the top ranked answer, it would have saved me a lot of hassle. now I need to recover my login passwords. – garth Jun 14 '22 at 14:32
0

The same thing happened to me (after an overload in the RAM usage) Firefox seems to shutdown and refuses to reopen. I opened the Activity Monitor and killed the Firefox instance from the memory section. Problem solved.

0

I had this problem on my Macbook and there was no parentlock file. Whatever you do, DO NOT delete the profiles.ini file. Make a backup. If you delete it and you don't know your "sync" credentials you will lose access to a good portion of your sync'd data.

  1. On the mac make sure firefox is not running and make a backup copy of your profile.ini file. Then
  2. run the firefox profile manager: /Applications/Firefox.app/Contents/MacOS/firefox-bin -P and then
  3. CREATE A NEW PROFILE and name it something like profilebackup Then
  4. quit the profile manager Then look inside the original profile.ini backup file with a text editor and find out what the folder is that it references, then
  5. close that file Go into that folder and COPY all the files into the new "proiflebackup" folder Then
  6. start the profile manager again with: /Applications/Firefox.app/Contents/MacOS/firefox-bin -P Then
  7. select the "profilebackup" profile, set as the default and start firefox and voila.

Once you are in firefox, everything should come up normal, then REFRESH your profile and do a backup of it from within firefox so you can always recover with it down the road.

This worked for me. I hope it gives you some useful info if the recommended fix doesn't work.

TekOps
  • 1
-1

The only solution I could find so far was to open an unsaved file in some kind of editor and do a "Log Out ".

If you are lucky, the stuck process will disappear from the dock before editor complains about unsaved file so you can click "Cancel", and most of your workspace will stay there.

-1

After killing the background processes as shown, Firefox was able to start:

$ ps -wwax | grep firefox
 1305 ??        59:06.29 /Applications/Firefox.app/Contents/MacOS/firefox -foreground
 2809 ttys006    0:00.00 grep firefox

$kill -9 1305

$ ps -wwax | grep firefox
 2815 ttys006    0:00.00 grep firefox
Nimesh Neema
  • 51,809
Manas
  • 1
-1

My solution was

  1. List all running process lsof -i and find Firefox enter image description here
  2. Kill Firefox by its PID (process ID) kill -9 [PID]

According to IBM docs

The lsof (list open files) command returns the user processes that are actively using a file system.

According to this Linux blog post How to Kill a Process from the Command Line you can kill a proces by running kill SIGNAL PID

Where SIGNAL is the signal to be sent and PID is the Process ID to be killed.

ricks
  • 99
  • @mmmmmm its just how i solved the issue, also added references for lsof -i returning user process, answer should be easier to understand now. – ricks May 05 '21 at 19:39
  • There seems to be a step missing between 1 and 2. Also, why use lsof instead of ps? – nohillside May 05 '21 at 19:48
  • @nohillside just personal preference, i find it easier to type lsof -i and find Firefox under COMMAND once it pops up, no steps missing, PID will be next to the command ill add a picture for reference – ricks May 05 '21 at 19:51
  • 1
    Maybe your screen is bigger than mine, but scrolling through 170 entries (just checked) to find the right one seems to be hassle (especially if ps aux | grep -i firefox just returns one entry and is significantly faster). But good to know there are alternatives. – nohillside May 05 '21 at 20:02
-1

Killing running processes and restarting the application worked like a charm for me.

# Kill running processes
ps -ef|grep 'Firefox'|awk -F' ' '{print $2}'|xargs kill -9

open firefox

open -a /Applications/Firefox.app

-2

I find a solution online here, you can check it. https://support.mozilla.org/en-US/kb/firefox-already-running-not-responding

emma24xia
  • 316
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – grg Jul 21 '15 at 09:31
  • Your link provided the correct solution: remove the .parentlock file. – Walter Jul 25 '15 at 08:41
  • Glad that helps you guys. – emma24xia Jul 27 '15 at 06:33