Folder panel has no content. JSON.parse: unexpected end of data Source File: chrome://messenger/content/folderPane.js

VERIFIED FIXED in Thunderbird 12.0

Status

defect
VERIFIED FIXED
8 years ago
7 years ago

People

(Reporter: kami911, Assigned: standard8)

Tracking

({regression})

9 Branch
Thunderbird 12.0
Dependency tree / graph

Thunderbird Tracking Flags

(thunderbird10+ fixed, thunderbird11+ fixed)

Details

(Whiteboard: [gs][datalossy], )

Attachments

(6 attachments, 2 obsolete attachments)

User Agent: Mozilla/5.0 (Ubuntu; X11; Linux x86_64; rv:10.0a2) Gecko/20111202 Firefox/10.0a2
Build ID: 20111202052423

Steps to reproduce:

After (updating and) starting Beta version of Thunderbird 9


Actual results:

The folder panel is empty, nothing appear at that place.
I tried to resize the window of TB, move the slide between folder panel and message panel. It is working but I haven't got any content in folder panel.
I tried also the safe-mode and disabling extension.

I have working client, I can write a new letter, receive mails, etc. But I cant open addo-ons tab.

The screenshot:
http://kepfeltoltes.hu/111202/thunderbird9problem_www.kepfeltoltes.hu_.png

I have Ubuntu 11.10 and Thunderbird 9 Beta from thunderbird-next ppa


Expected results:

Folder should be viewable on folder panel
If you bring up tools, error console, are there any errors?
I cannot reproduce on my home machine.

On the problematic machine:

Error: JSON.parse: unexpected character
Source File: chrome://messenger/content/folderPane.js
Line: 196

"
        this._persistOpenMap = JSON.parse(data);
"
Hmm, sounds like your open map was corrupted. I though I had a patch that added a try catch around this, but was convinced that we couldn't generate json that we couldn't reparse. In your user profile directory, there's a file called folderTree.json - if you shutdown TB, move that away (don't delete it, since I'm curious what its contents are), and restart, you should see your folder pane again.
I supported someone on irc that had this issue - his folderPane.js looked like a binary file. Not quite sure what could cause this, but I think a try catch would help.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hi!

I renamed the old file, and yes it was a binary like file. I upload it because I cannot see any personal information in it. The bad file is nearly 3x bigger then the newly created: 369 vs 1088.
Happened again. Maybe it is connected to improper shutdown of Thunderbird.
Assignee: nobody → mbanner
Keywords: regression
Summary: Folder panel has no content → Folder panel has no content. JSON.parse: unexpected end of data Source File: chrome://messenger/content/folderPane.js
Whiteboard: [gs][datalossy]
Changing to All/All, because I was able to confirm this problem on Thunderbird 9.0.1 on Windows XP. Renaming the file and restarting Thunderbird fixed the problem for now.

The file contains random binary gibberish, it seems.
OS: Linux → All
Hardware: x86_64 → All
Some of the getsatisfaction.com reports mention this happening after OS crash.
An ex-colleague of mine just saw this happen on Linux (Ubuntu 11.04) after a crash. removing folderTree.json fixed it for him too
What exactly did crash for him? Thunderbird? Does he have a crash ID? Or the whole OS?
(In reply to Roland Tanglao :rolandtanglao from comment #11)
> An ex-colleague of mine just saw this happen on Linux (Ubuntu 11.04) after a
> crash. removing folderTree.json fixed it for him too

And did your friend saved the file ?
Posted patch Handle the error (obsolete) — Splinter Review
In the absence of understanding why folderTree.json is getting corrupt (apart from a crash causing it for some reason we don't yet understand), a try/catch seems the best thing to keep users going.

This will also log the failure to the error console, so that the user knows why it happens.

I'll do a hard-coded en-US version for the branches, which shouldn't really matter as it is only going to the error console.
Attachment #587321 - Flags: ui-review?(bwinton)
Attachment #587321 - Flags: review?(dbienvenu)
(In reply to Ludovic Hirlimann [:Usul] from comment #13)
> (In reply to Roland Tanglao :rolandtanglao from comment #11)
> > An ex-colleague of mine just saw this happen on Linux (Ubuntu 11.04) after a
> > crash. removing folderTree.json fixed it for him too
> 
> And did your friend saved the file ?

It was a System Crash, not a Thunderbird crash. Here's his saved folderTree.json. Hope it helps.
Comment on attachment 587321 [details] [diff] [review]
Handle the error

generally, the error on the console is just going to be "SyntaxError: JSON.parse: unexpected character" which is of limited value.
Attachment #587321 - Flags: review?(dbienvenu) → review+
Will this help the users in any way to recover from the situation? Or will it be just debugging hint for us if they post that message?
(In reply to :aceman from comment #17)
> Will this help the users in any way to recover from the situation? Or will
> it be just debugging hint for us if they post that message?

The folder pane will appear, but you will lose the collapsed/expanded state of your folders. So, a vast improvement.
So if the file is corrupt, thanks to ignoring this error TB will regenerate the folder view to some initial (uncollapsed) state? Thanks, that would be great.
(In reply to :aceman from comment #19)
> So if the file is corrupt, thanks to ignoring this error TB will regenerate
> the folder view to some initial (uncollapsed) state? Thanks, that would be
> great.

yes, though the state is (mostly) collapsed, not uncollapsed.
Posted patch Branch fix (obsolete) — Splinter Review
Non-string affecting version for branches.
Attachment #587445 - Flags: review?(dbienvenu)
Attachment #587445 - Flags: review?(dbienvenu) → review+
Comment on attachment 587321 [details] [diff] [review]
Handle the error

I think I'ld prefer it to be:
failedToReadFile=Failed to read file: %1$S reason: %2$S
so that we can use the message in other places.  ui-r=me with that change.
Attachment #587321 - Flags: ui-review?(bwinton) → ui-review+
Addresses the comment from the ui-review.
Attachment #587321 - Attachment is obsolete: true
Attachment #587628 - Flags: ui-review+
Attachment #587628 - Flags: review+
Posted patch Branch fix v2Splinter Review
With revised wording.
Attachment #587445 - Attachment is obsolete: true
Attachment #587630 - Flags: review+
Attachment #587630 - Flags: approval-comm-beta+
Attachment #587630 - Flags: approval-comm-aurora+
Checked into trunk: http://hg.mozilla.org/comm-central/rev/2216e845c307

I'll file a follow-up bug later for seeing if we can handle the corruption in a better way, e.g. hardening the file writing or backup routines.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 12.0
Blocks: 717225
Checked with Tb12.0a1 2012/01/14 build
> Mozilla/5.0 (Windows NT 5.1; rv:12.0a1) Gecko/20120114 Thunderbird/12.0a1

(1) Corrupt folderTree.json manually, restart Tb => error message at Error Console
(1-1) x {}
> Timestamp: 2012/01/16 10:40:30
> Error: Failed to read file: folderTree.json reason: SyntaxError: JSON.parse: unexpected character
> Source File: chrome://messenger/content/folderPane.js Line: 200
(1-2) {
> Timestamp: 2012/01/16 10:42:19
> Error: Failed to read file: folderTree.json reason: SyntaxError: JSON.parse: end of data while reading object contents
> Source File: chrome://messenger/content/folderPane.js Line: 200
(1-3) {} x
> Timestamp: 2012/01/16 10:43:24
> Error: Failed to read file: folderTree.json reason: SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data
> Source File: chrome://messenger/content/folderPane.js Line: 200
(2) Folder pane is re-initialized(all is collapsed).
(3) Click account, folder, terminate Tb. Following was saved in fileTree.json.
> {"all":["mailbox://x@x.x.x","mailbox://x@x.x.x/Inbox","mailbox://nobody@Local%20Folders"]}

=> Verified
Status: RESOLVED → VERIFIED
Duplicate of this bug: 720616
Duplicate of this bug: 720958
Duplicate of this bug: 720474
Duplicate of this bug: 721842
(My first foray in here, so apologies in advance)
I have experienced this bug - my json file was full of nulls, and the error log clearly showed a file reading error. (ref 'i_cannot_see_any_folders_help')

1. This was a trivial bug that was injected by poor developer testing - the 'json.parse' routine should automatically test for correct file format. The commentry above does not make it clear if this now happens, as the fault is not restricted to just this instance.
2. The result of the bug was very 'novice' - there should have been a 'fail-safe' result not a catastrophic loss of functinality. Have other places where this routine is used been checked ? The commentry above does not make this clear.
3. This should have surfaced during testing shouldnt it ? Doesnt anyone deliberately interfere with all the data files ?
4. If this was spotted TWO MONTHS ago, why isnt it a Known Issue ? (It produces a catastrophic loss of functionality !)

regards to all fellow professionals
phil harris
senior software developer
trend control systems
Just had this problem and thought I'd post a note in hope I might shed some light on what causes the file corruption... This happened on my Windows 7 laptop that I hibernated (instead of shutting down) a couple of days in a row. At one point I noticed that I had a couple of hanging Visual Studio processes that took a lot of memory and decided to reboot. I don't know in which state Thunderbird was at that moment, but it showed no signs of trouble. The shutdown process stuck and I had to kill it using the power button. When I booted it again, Thunderbird still worked but Skype had lost its settings. I shut down the laptop normally afterwards but the next time I started it and ran Thunderbird, the left pane was empty. It also re-downloaded all messages, even the ones I already had in the mailbox, from one POP3 server (I have set all accounts to leave messages on the server for 7 days) but this seemed to happen only for one of the two accounts I have. At that point my folderTree.json file had 345 bytes of NULLs. Then I installed Thunderbird 10 (the previous version was 9.0.1) and the pane reappeared but folderTree.json was left as it was. Only after I removed the file did it regenerate.
I had the same problem with a folderTree.json with 0 byte.
This happened during the night when an program was runing with extensif output with thunderbird on.
It happened that i had no more disc space.
After creating more disque space. And a reboot of thunderbird. I had this problem.
The only way to correct it was to move the empty file out.
Safe mode or disable addon doesn't serve.

This problem was part my fault for having a disque with no free space. But i think that a recovery mechanism or a message saying wich file to move can be usefull.
All bets are off with Mozilla code if your disk is full, really...
I had the same problem, but unfortunately my folderTree.json does not get recreated after moving it away. When closing thunerbird the following messages popup in the error console:

https://bugzilla.mozilla.org/show_bug.cgi?id=707329

	Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIFileOutputStream.init]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: file:///usr/lib/thunderbird-3.1.19/modules/sessionStoreManager.js :: ssm_saveStateObject :: line 171"  data: no]


	Error: Components is not defined
	Source File: chrome://messenger/content/folderPane.js
	Line: 1873

	Error: gFolderDisplay is not defined
	Source File: chrome://messenger/content/msgMail3PaneWindow.js
	Line: 96

	Error: this._tree is null
	Source File: chrome://messenger/content/folderPane.js
	Line: 1895

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19
This bug is about Thunderbird 9.
You write that the errors are printed while closing Thunderbird. The workaround has to be applied while Thunderbird doesn't run. Then I also get the folderTree.json rebuilt with Thunderbird 3.1.19. But maybe something else is broken in the profile.

You can get support for Thunderbird at http://getsatisfaction.com/mozilla_messaging/
Happening now on Windows 7 when upgrading to version 16.0.2

If I reinstall an older version (e.g. 12.0.1) the folders pane get back. This happen without any previous crash but the folderTree.json only include the empty brackets {} (2 bytes). I can still see in the file menu (File>Get new Messages) my folder structure. Does it maybe only occur with a certain amount of accounts in the list as I have up to 23. Or it is an issue with my virus scanner (BitrDefender) but I even tryed to disable all plugins. I also tryed to delete the json file but to no avail.

Anyway in the console I got a couple of errors and warnings:
1-3. Warning: XUL box for _moz_generated_content_before element contained an inline #text child, forcing all its children to be wrapped in a block. (toolbar.xml)
4. Error: NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.setBoolPref] (specialTabs.js)
Timestamp: 31.10.2012 19:56:44
5. Error: TypeError: gStatusBar is null (tabmail.xml)
Timestamp: 31.10.2012 19:56:45
6. Warning: XUL box for _moz_generated_content_before element contained an inline #text child, forcing all its children to be wrapped in a block. (messenger.xul)
(In reply to Götz Lohmann from comment #38)
> Happening now on Windows 7 when upgrading to version 16.0.2
> 

see bug 807848
You need to log in before you can comment on or make changes to this bug.