Firefox and Thunderbird Troubleshooting: Firefox or Thunderbird is already running, but not responding Error

Saturday, March 14, 2009

I get these errors when invoking Firefox & Thunderbird from my individual desktop sessions on a server from two different systems, as obvious, though they are different sessions, its the same user login which points to the same NFS mounted home directory, I usually keep my Firefox and Thunderbird sessions open on both the systems and so that I can continue from where I left in the first system on the other one, when I first started Firefox and Thunderbird on my second desktop session on the second system after keeping them open in the first system (and locking it of course), I got the error

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

and

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

Though I saw the above errors in Windows too, the solution is very simple, you need to remove some lock files (.parentlock and lock on Solaris and parent.lock in Windows in the firefox profile directory), you can also end any Firefox process in task manager in Windows if you get this error and restart it again.

But I wanted to explore more, how session locks work in Firefox, how can I continue with the same session I left on one system from the other, though removing lock files is part of the solution, I found some simple things about how Firefox handles sessions, knowing this might help you to troubleshoot your problem with Firefox sessions if any, also this applies to Solaris, but similar procedure should work for other flavors of Linux and Thunderbird as well.

1. Firefox Profile directory
2. Locks before and after Firefox is invoked
3. Trying to open Firefox on a different system with same login when an instance is already running/crashed on your other session
4. Clearing locks and restoring/starting your new Firefox session

1. Firefox Profile directory

Before you open a Firefox session, your firefox profile directory would be like the one shown below, for a user named solarisuser, this would be like,
bash-3.00$ pwd
/home/solarisuser

bash-3.00$ cd .mozilla/firefox
bash-3.00$ ls -la
total 18
drwxr-xr-x 3 solarisuser staff 512 Jan 24 20:40 .
drwx------ 14 solarisuser staff 1024 Jan 27 14:31 ..
drwx------ 5 solarisuser staff 1024 Mar 14 00:50 a43y8e05.default
-rw-r--r-- 1 solarisuser staff 94 Jan 24 20:39 profiles.ini

bash-3.00$ cat profiles.ini
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=a43y8e05.default
As shown above, the firefox profile details are stored in <HOME>/.mozilla/firefox/profiles.ini which has the path to the profile directory, where <HOME> is the home directory of the user.

2. Locks before and after Firefox is invoked

Before I invoked Firefox on my session in my first system, the profile directory had the following lock files.
bash-3.00$ cd a43y8e05.default/
bash-3.00$ pwd
/home/solarisuser/.mozilla/firefox/a43y8e05.default
bash-3.00$ ls -la
total 7304
drwx------ 5 solarisuser staff 1024 Mar 14 00:50 .
drwxr-xr-x 3 solarisuser staff 512 Jan 24 20:40 ..
-rw-r--r-- 1 solarisuser staff 0 Mar 14 00:49 .parentlock
Note that there is a .parentlock file even before I invoked my Firefox instance, but this will be updated by a new .parentlock file which will be created when a user starts Firefox as can be seen from its updated timestamp below, therefore after Firefox is invoked, the profile contents would be like the one shown below.
bash-3.00$ ls -la
total 7306
drwx------ 5 solarisuser staff 1024 Mar 14 00:54 .
drwxr-xr-x 3 solarisuser staff 512 Jan 24 20:40 ..
-rw-r--r-- 1 solarisuser staff 0 Mar 14 00:54 .parentlock
lrwxrwxrwx 1 solarisuser staff 21 Mar 14 00:54 lock -> 10.5.150.5:+61310
Note the updated timestamp on the .parentlock file and a new link file lock which is created pointing to IP address and port details (probably the client IP and port details from which the Firefox instance was invoked), therefore irrespective of an already existing .parentlock, each time it will be updated when one invokes Firefox as shown above.

3. Trying to open Firefox on a different system with same login when an instance is already running/crashed on your other session

Now when I logged in to my second desktop and tried to open Firefox when an instance is already running on the first system, I got the above error as shown in the figure below, this applies for cases where an instance is still running in the first system or it crashed abruptly.


Fig 1: Firefox is already running, but not responding error

4. Clearing locks and restoring/starting your new Firefox session

Now from the second system, I removed the .parentlock file from my Firefox profile folder to get rid of the above error and start Firefox.
bash-3.00$ ls -la
total 7306
drwx------ 5 solarisuser staff 1024 Mar 14 00:54 .
drwxr-xr-x 3 solarisuser staff 512 Jan 24 20:40 ..
-rw-r--r-- 1 solarisuser staff 0 Mar 14 00:54 .parentlock
lrwxrwxrwx 1 solarisuser staff 21 Mar 14 00:54 lock -> 10.5.150.5:+61310

bash-3.00$ pwd
/home/solarisuser/.mozilla/firefox/a43y8e05.default
bash-3.00$ rm .parentlock

bash-3.00$ ls -la
total 7308
drwx------ 5 solarisuser staff 1024 Mar 14 01:02 .
drwxr-xr-x 3 solarisuser staff 512 Jan 24 20:40 ..
-rw-r--r-- 1 solarisuser staff 0 Mar 14 00:54 .nfs6D1F81
lrwxrwxrwx 1 solarisuser staff 21 Mar 14 00:54 lock -> 10.5.150.5:+61310
Now after I removed the .parentlock, Firefox created a file called .nfs6D1F81, this is because Firefox has to save the session details of the instance which is already running because the .parentlock file is abruptly removed ( it may be a case similar to that of Firefox crashing), in other words, the presence of the above .nfs6D1F81 file is an indication that the session is saved by Firefox for restoring.

Then after I invoked Firefox in my second system (on a different session from the first one), it prompted me on whether I should restore the previous session or open a new session as shown below.

Fig 2: Restoring/Opening a new Firefox session

Now since I want to continue from where I left, I selected the restore session option, in this way I can work on the same Firefox session from my second system login. After the second session is opened, the profile directory contents are shown below.
bash-3.00$ ls -la
total 7312
drwx------ 5 solarisuser staff 1024 Mar 14 01:16 .
drwxr-xr-x 3 solarisuser staff 512 Jan 24 20:40 ..
-rw-r--r-- 1 solarisuser staff 225 Mar 14 00:50 .nfs422F81
-rw-r--r-- 1 solarisuser staff 0 Mar 14 00:54 .nfs6D1F81
-rw-r--r-- 1 solarisuser staff 0 Mar 14 01:14 .parentlock
lrwxrwxrwx 1 solarisuser staff 21 Mar 14 01:14 lock -> 10.5.150.5:+16851
As obvious a new .parentlock file is created after the invocation as can be seen from its updated timestamp and also a different lock is created for the second instance (see the difference between the two lock files shown above), but now you also see two files .nfs422F81 and .nfs6D1F81, the second file is the one we saw after we removed the .parentlock file and a new one is created for the second invocation, my guess is since there are two instances running now with one which is active (in the second system) and the other process still running in the other system (in the first system), probably the two .nfs files are there to identify different sessions running on the two instances (so that they can be saved when any one of the instance crashes), therefore now the user can run Firefox from both the systems.

Finally after I closed the Firefox on both the systems, now I no longer see the .nfs files and the lock link file removed, probably an indication that the sessions are closed gracefully.
bash-3.00$ ls -la
total 7306
drwx------ 5 solarisuser staff 1024 Mar 14 01:21 .
drwxr-xr-x 3 solarisuser staff 512 Jan 24 20:40 ..
-rw-r--r-- 1 solarisuser staff 0 Mar 14 01:21 .parentlock
The same logic will apply for Thunderbird as well (<HOME>/.thunderbird), little things teach us a lot!.

3 comments:

Anonymous said...

Thank you, Prassanna!! Removing parent.lock worked for me to restore Thunderbird, whereas two reboots did nothing!!

The parent.lock file was a 0-byte file.

Prasanna Seshadri said...

Thats right, its a zero byte file but very significant. good that this post helped you and thanks for saying so.

Anonymous said...

Hi again, Prasanna ~

I just found a forum called DonationCoder (where I happen to be a member...) that had an alternate solution, and that is to check the name of the "profile.default" in your TB folder with what actually appears in the "profiles.ini" file.

My filenames where the same, but I was pointing to a mapped network drive (N:\) in profile.ini. I changed it to the physical drive (D:\), saved the file, clicked on TBs icon, and it opened.

Now, this is STRANGE, because I've been using (N:) for several years now!! Why is it all of a sudden changing, I wonder.

Anyway, here's the link to DonationCoder so you can read more about it. I feel the more we all share, the more likely we can find a solution.

http://www.donationcoder.com/Forums/bb/index.php?topic=11994.0

I just have a hunch this is not going to be the end of this SNAFU.

Warm regards, and a hearty thanks...
Cheryl


Copyright © 2016 Prasanna Seshadri, www.prasannatech.net, All Rights Reserved.
No part of the content or this site may be reproduced without prior written permission of the author.