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

Thunderbird
Folder and Message Lists
VERIFIED FIXED
6 years ago
5 years ago

People

(Reporter: Kami, Assigned: standard8)

Tracking

({regression})

9 Branch
Thunderbird 12.0
regression

Thunderbird Tracking Flags

(thunderbird10+ fixed, thunderbird11+ fixed)

Details

(Whiteboard: [gs][datalossy], URL)

Attachments

(6 attachments, 2 obsolete attachments)

(Reporter)

Description

6 years ago
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

Comment 1

6 years ago
If you bring up tools, error console, are there any errors?
(Reporter)

Comment 2

6 years ago
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);
"

Comment 3

6 years ago
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.
(Assignee)

Comment 4

6 years ago
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
(Reporter)

Comment 5

6 years ago
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.
(Reporter)

Comment 6

6 years ago
Created attachment 579283 [details]
Bad, binary content of folderTree.json
(Reporter)

Comment 7

5 years ago
Happened again. Maybe it is connected to improper shutdown of Thunderbird.
(Reporter)

Comment 8

5 years ago
Created attachment 580831 [details]
Another bad folderTree.json
(Assignee)

Updated

5 years ago
Assignee: nobody → mbanner
(Assignee)

Updated

5 years ago
tracking-thunderbird10: --- → +
tracking-thunderbird11: --- → +
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]
Created attachment 585822 [details]
faulty folderTree.json from WinXP

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.

Updated

5 years ago
OS: Linux → All
Hardware: x86_64 → All

Comment 10

5 years ago
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

Comment 12

5 years ago
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 ?
(Assignee)

Comment 14

5 years ago
Created attachment 587321 [details] [diff] [review]
Handle the error

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)
Created attachment 587350 [details]
folderTree.json after Linux system crash

(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 16

5 years ago
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+

Comment 17

5 years ago
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?

Comment 18

5 years ago
(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.

Comment 19

5 years ago
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.

Comment 20

5 years ago
(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.
(Assignee)

Comment 21

5 years ago
Created attachment 587445 [details] [diff] [review]
Branch fix

Non-string affecting version for branches.
Attachment #587445 - Flags: review?(dbienvenu)

Updated

5 years ago
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+
(Assignee)

Comment 23

5 years ago
Created attachment 587628 [details] [diff] [review]
Updated trunk patch

Addresses the comment from the ui-review.
Attachment #587321 - Attachment is obsolete: true
Attachment #587628 - Flags: ui-review+
Attachment #587628 - Flags: review+
(Assignee)

Comment 24

5 years ago
Created attachment 587630 [details] [diff] [review]
Branch fix v2

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+
(Assignee)

Comment 25

5 years ago
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
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 12.0
(Assignee)

Comment 26

5 years ago
Checked into branches:

http://hg.mozilla.org/releases/comm-aurora/rev/67482f1a5317
http://hg.mozilla.org/releases/comm-beta/rev/381fce935899
status-thunderbird10: --- → fixed
status-thunderbird11: --- → fixed
(Assignee)

Updated

5 years ago
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
(Assignee)

Updated

5 years ago
Duplicate of this bug: 720616

Updated

5 years ago
Duplicate of this bug: 720958

Updated

5 years ago
Duplicate of this bug: 720474
Duplicate of this bug: 721842

Comment 32

5 years ago
(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

Comment 33

5 years ago
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.

Comment 34

5 years ago
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...

Comment 36

5 years ago
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/

Comment 38

5 years ago
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.