Sunday, September 27, 2015

A Workaround to a Mozilla Thunderbird Blank Folder Pane Problem

[last updated * 5/21/26; prior 5/18/16; 1/09/16]

At least a handful of times over the past week, I have launched Thunderbird with a blank or hidden messages pane, i.e., I'll see my familiar calendar/today pane on the right, but nothing to the left--no list of mailbox accounts and their folders, no local folders, etc. Oddly enough, I can download my external email pop accounts--but I don't see them. Now I occasionally experienced this problem in the past, and I simply would shutdown Thunderbird and relaunch later--with the folder pane viewable again (a memory issue?); I've removed any recent add-ons and/or rebooted the PC, which occasionally works. But what if all the usual steps, e.g., clearing cache, resetting options (e.g., toggling the folder pane off and on), don't work? It may be, for instance, some key file in the AppData Thunderbird folder has been corrupted.

I have a workaround solution, but first let discuss backups; as a professional DBA, I'm obsessed with backups. I have several layers of backups; with multi-terabyte USB external drives available for roughly $100-150, there's no reason not to do backups frequently. (For a list of freeware backup tools, see here; I've successfully used Paragon, EaseUS, and Aomei; also check the folder synchronization tools.)  Flash drives are also increasingly inexpensive; for example, I was recently able to purchase a 120GB flash drive for around $30. I use licensed encryption software to maintain archivals (not to mention portable applications). Finally, depending on your email storage size, you can use any number of free (up to x GBs) online storage options (including Dropbox, Microsoft OneDrive, and Google Drive); at the time of this post, Google offers 100 GB storage for about $2/month. In some cases, you can configure your data, e.g., Thunderbird mail folders, under your online service sync folder (see  discussion below*).  If for some reason you cannot reconfigure your storage locations, you might be able to set up a file synchronization from your source folder(s) to your target sync folder.

I suspect that some files under the Thunderbird profile folder have been corrupted; it doesn't seem to involve email folders themselves. Here is my workaround, designed to minimize the loss of downloaded emails:
  • First, always maintain at least one recent copy of your email folders. Also you should have at least one recent copy of your profile folder/tree, via system backup or file folder synchronization. (If you are using default email locations, your profile backup includes your mail folders.)
  • If you run into the blank folder pane, shutdown Thunderbird. (You may want to see if launching it again, say 20 minutes later, or rebooting resolves the problem before moving onto the next step.)
  • If any interim emails have been downloaded since your last relevant profile backup and you are using default profile mailbox locations for external or local email storage, backup/sync your Mail folder under the profiles folder (AppData, Roaming, Thunderbird) to a sync or temporary directory. [Note below discussion on migrating emails to non-default locations.*]
  • Delete the existing profile directory (some-alphanumeric-string.default), and restore the last profile backup to the same location. 
  • If you had to backup up Mail directory files before restoring your profile directory, replace your restored profile Mail directory with your Mail directory backup.
  • Launch Thunderbird. You should now see your folder pane as expected. I would recommend doing another backup of your profile ASAP.
[* Note: 9/28/15. My earlier writeup implied a non-default setting for my local email folders but default settings for the external email folders.  I wasn't aware that you can also reconfigure target directories for your external email folders: the setting is on the server settings pane, not the account settings pane. (Also note if you reset your local folders to say your sync drive directory, you need to manually cut-and-paste the folders from the AppData subdirectory to the target directory after setting the Thunderbird account parameter and bringing down Thunderbird.) [Changing the mail storage directory, local or external, results in a Thunderbird popup saying that it needs to come down.] Assuming you've already moved messages from your external email folders to local folders, you don't have to worry about manually moving folders during reconfiguration: it will simply recreate folders, inbox, trash, send folders as needed at the target setting, e.g., [sync drive path]/Gmail.]

[Note: 10/26/15.  The delete/restore profile workaround almost always works. I think I've encountered one time it didn't seem to work after a copy in the same PC session, but it did after a reboot. As I've said, sometimes I close Thunderbird and restart it minutes later, no problem. Sometimes a reboot seems to do the trick. If you have gigabytes of email folders like I do, you may want to try these first, before going through a few minutes of delete/restore. As always, continue to backup your PC regularly, at least to the point you are willing to accept lost emails. I've occasionally, under prior Outlook Express (I haven't liked Windows Mail because it seemed to take forever to load my emails, hence my move to Thunderbird) and/or Thunderbird, found that one or more email folders got corrupted.

Take, for instance, I have a problem with my local inbox.  I might do something like create a folder inbox2, bounce the email client, click into inbox2. bring down the client, get relevant inbox files from backup, rename/copy to the target, and delete the corrupted inbox. The email client should regenerate a missing inbox or other core folder. After startup I should see my new empty inbox and a populated inbox2. At this point, if I wish, I can move my messages from inbox2 to inbox. I sometimes call this my shell game workaround.

Again, I have no idea how prevalent this problem for other Thunderbird users; I religiously update Thunderbird and I don't recall it happening over the last few years until recent months, so it may be a bug, but I've seen it happen a few times a week--not always, but frequently enough to be a nuisance. I sometimes have tried another workaround short of delete/replace. In my case I have multiple configured email accounts; I've found, on at least two occasions, that switching the default email account for Thunderbird and restarting Thunderbird seems to resolve the issue.]

[Update 1/09/16].

I ran into folder pane problem on a recurring basis lately, which may have coincided after a recent Thunderbird update. Many of the tactics I've listed above did not seem to work (i.e., restarting Thunderbird and/or the PC, refreshing the profile folder under user AppData). Based on a tip I read in a Thunderbird forum, I tried running Thunderbird in safe mode (I usually add the client to my taskbar and then click on the icon while holding down the shift key: you should see a popup and I simply proceed without toggling on available options). This seemed to work consistently in restoring the folder pane, but with the addons temporarily disabled; in my case, for example, I have Lightning which is configured with my Google calendar, Nostalgy which I use to file emails not configured with my existing filter rules, and others which prune duplicate emails, strip attachments, and convert eml's to other formats.

Are addons incompatibile with the upgraded client? I tried disabling addons one at a time and restarting in normal mode, but I couldn't identify the rogue addon if any. (I also saw the folder pane appearing with addons available on an inconsistent basis since the patch.)

Finally, I uninstalled Thunderbird (without removing data) and reinstalled the software from the Mozilla website, finding the folder pane as usual appearing with addons intact. I have subsequently bounced the software on multiple occasions without the issue reappearing. I don't have enough information to judge whether somehow the software had been corrupted. If the problem resurfaces again, I'll update the post.

[Update 5/18/16]

After a few months of no issues, it reoccurred in full force again. There had been one or 2 times I launched into a folderless screen in the interim, but an application restart seemed to resolve the issue. Today I made numerous restarts plus a reboot, and the problem persisted. Deleting and refreshing the profile folder from my Google drive backup resolved the issue. So clearly one or more files in the profile folder are getting corrupted.

I ran into a separate performance issue lately which involved painfully slow email composes. I tweaked a few things, like togging off the message preview panel. One thing I noticed is that the application seems to spontaneously toggle preview back on. What I find is to undo that I have to toggle preview back on and then immediately toggle it back off.

There are a few other bugs that test my patience like pop-up error messages (especially on startups) which get in the way of password validation. I also notice that in moving messages from my download to local folders if the mouse floats over one of the other options (like copy to folder...), it seems to get stuck and I have to wait for the option to time out (my description) before I can float over the Move to Inbox option again.

Another tip for Thunderbird users: I use another layer of redundancy, the free-for-personal-use MailStore Home, which can be configured to back up Thunderbird folders. I will usually archive/update my MailStore emails every week or two. It basically appends new emails to folders; it doesn't sync the source/target email folders. So, for example, I might still have copies of emails that were in my local inbox years ago during archiving. Searching is blazing fast; for example, I have a Venezuelan immigrant friend and I was able to pull up emails from him over the last few years in a split second.

* [5/21/16]

I did another Google search; for some reason, I pulled down more usable results than prior Google searches. I ran into the same problem again for the second time in a week, this time a little more problematic. There were multiple tweeks plus a reboot necessary to regain the panes (there must have been some process that the reboot released--beyond the thunderbird executable).

I do have a more nuanced solution based on a couple of troubleshooting posts that suggest looking at a couple of JSON files in the profile folder: foldertree and/or session. One or both sources suggested that deleting or renaming existing files should result in Thunderbird regenerating said files. I think that the foldertree regenerated but same problem. I tried copying over the same two files from my Gdrive copy; it didn't work. I rebooted and this time the folder tree appeared on startup. So I suspect some process must have been hosing things. I'll have to wait and see if the problem recurs to see if the issue can be resolved with a reboot/JSON regeneration fix or whether the archival files do the trick. I would like to see if I can figure out what process is hosing a session fix.