Compact folders - shows wrong estimated and compacted size. Compacts too often. totalExpungedBytes number is wrong.
Categories
(MailNews Core :: Backend, defect, P3)
Tracking
(thunderbird_esr52 affected, thunderbird_esr60- affected, thunderbird60 wontfix, thunderbird61 wontfix, thunderbird62 affected, thunderbird63 affected)
People
(Reporter: direwolf, Unassigned, NeedInfo)
References
()
Details
(Keywords: regression, regressionwindow-wanted, ux-trust)
User Story
https://www.reddit.com/r/Thunderbird/comments/pbaac0/thunderbird_asking_me_to_compact_and_telling_me/ All tagged support requests: https://support.mozilla.org/en-US/questions/thunderbird?tagged=bug1260698&order=votes&show=all https://support.mozilla.org/en-US/questions/1228592 https://support.mozilla.org/en-US/questions/1226501 https://support.mozilla.org/en-US/questions/1225973 https://support.mozilla.org/en-US/questions/1225165 https://support.mozilla.org/en-US/questions/1225419 https://support.mozilla.org/en-US/questions/1226979 https://support.mozilla.org/en-US/questions/1225638 https://support.mozilla.org/en-US/questions/1225133 https://support.mozilla.org/en-US/questions/1231444 https://support.mozilla.org/en-US/questions/1231702 https://support.mozilla.org/en-US/questions/1234040 https://support.mozilla.org/en-US/questions/1234499 https://support.mozilla.org/en-US/questions/1241019 https://support.mozilla.org/en-US/questions/1243833#answer-1198405 https://support.mozilla.org/en-US/questions/1247192 https://support.mozilla.org/en-US/questions/1253800 https://support.mozilla.org/en-US/questions/1254925 https://support.mozilla.org/en-US/questions/1259888 https://support.mozilla.org/en-US/questions/1259990
Attachments
(3 files, 1 obsolete file)
Updated•6 years ago
|
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
Comment 8•6 years ago
|
||
Comment 9•6 years ago
|
||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Comment 14•6 years ago
|
||
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
Comment 17•6 years ago
|
||
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
Comment 20•6 years ago
|
||
Updated•6 years ago
|
Comment 21•6 years ago
|
||
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
Comment 24•6 years ago
|
||
Comment 25•6 years ago
|
||
Comment 26•6 years ago
|
||
Comment 27•6 years ago
|
||
Comment 28•6 years ago
|
||
Comment 29•6 years ago
|
||
Comment 30•6 years ago
|
||
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment hidden (obsolete) |
Comment 34•6 years ago
|
||
Comment 35•6 years ago
|
||
Comment 36•6 years ago
|
||
Comment 37•6 years ago
|
||
Comment 38•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 40•6 years ago
|
||
Comment 41•6 years ago
|
||
Comment 42•6 years ago
|
||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 44•6 years ago
|
||
Continues to be reported by users.
I know it doesn't solve the issue, but can we add the crude sanity check you suggested and, as a permanent fixture, throw something in the error console with the filename?
There is also Bug 1521073 to consider - CPU use on OSX rises to 70% after Inbox compact
Updated•5 years ago
|
Comment 45•5 years ago
|
||
Can we add a debug/sanity check at the point where messages are deleted or moved?
Comment 47•5 years ago
|
||
More like at all places where we touch the expungedBytes variable. I could do that in the debugging patch we carry here.
Comment 48•5 years ago
|
||
Does anybody know of a workaround to make it stop asking me to compact folders every freaking day?
I know I had seen this error ages ago but I don't remember what I did that made it go away (or it went away on its own). Then it hase resurfaced recently after I have deleted tons of messages.
Comment 49•5 years ago
|
||
Uncheck the option? Tools > Options, Advanced, Network & Diskspace, uncheck "Compact all folders ...".
Comment 51•5 years ago
|
||
Well, ok, that might do as long as I remember to compact manually from time to time.
What I meant was whether there is a workaround to force whatever corrupted information seems to be stored somewhere to be recomputed, so that it will start behaving correctly again with the compact-when-above-threshold option enabled, at least for some time until it gets screwed up again.
Comment 52•5 years ago
|
||
I am affected by the same issue and would like to help resolving it, as it has bothered me for a long time now.
Searching the source code, I found that the size of space that can be freed up is tracked via the property m_expungedBytes
of nsDBFolderInfo
objects (see https://dxr.mozilla.org/comm-central/source/comm/mailnews/db/msgdb/src/nsDBFolderInfo.cpp). Whenever messages are deleted, this counter is increased. The compacting method nsMsgDBFolder::HandleAutoCompactEvent
(https://dxr.mozilla.org/comm-central/source/comm/mailnews/base/util/nsMsgDBFolder.cpp) just reads and adds up this variable for different folders. If summing up works (which we may assume since otherwise everyone would have this issue), we therefore need to investigate where m_expungedBytes
is changed in a potentially wrong way.
To this end, it would be great if there were an option to track the state of this variable and all calls to the ChangeExpungedBytes
method (https://dxr.mozilla.org/comm-central/source/comm/mailnews/db/msgdb/src/nsDBFolderInfo.cpp). I think this would require a custom build of Tb. Unfortunately I do not have the hardware to build Tb myself (and I do not really know c++). Is there a way to get around this issue?
My current hypothesis is that the issue may be related to the setting to download new emails only, since I am basically never deleting messages on my own. However, I have set Tb to download messages newer than 1 year only. That is, older emails are deleted. This happens in ApplyRetentionSettings
(https://dxr.mozilla.org/comm-central/comm/mailnews/imap/src/nsImapMailFolder.cpp).
To test this hypothesis without going deep into the code, it would already be helpful if I could figure out how much space can supposedly be freed up in each individual folder. Then I could compare folders with this setting to folders without it. Furthermore, I know that Tb regularly checks if compacting folders makes sense. Is there a way to trigger this query without having to wait?
Comment 53•4 years ago
|
||
(In reply to Sam from comment #52)
I am affected by the same issue and would like to help resolving it, as it has bothered me for a long time now.
...
My current hypothesis is that the issue may be related to the setting to download new emails only, since I am basically never deleting messages on my own. However, I have set Tb to download messages newer than 1 year only. That is, older emails are deleted. This happens inApplyRetentionSettings
(https://dxr.mozilla.org/comm-central/comm/mailnews/imap/src/nsImapMailFolder.cpp).To test this hypothesis without going deep into the code, it would already be helpful if I could figure out how much space can supposedly be freed up in each individual folder. Then I could compare folders with this setting to folders without it. Furthermore, I know that Tb regularly checks if compacting folders makes sense. Is there a way to trigger this query without having to wait?
Sam, does this occur in a profile that has only has an inbox with retention settings applied?
Comment 54•4 years ago
|
||
David ...
(In reply to David Simmons from comment #38)
For what it's worth, I built Thunderbird from source yesterday and poked
around a bit. In my case, I frequently saw the compact dialog with the
inaccurate estimate because I always declined compaction. I ran into a wall
when I discovered that the bad expungedBytes values were being read from
each folder's .mdb database. (I confirmed the bad values were present in
the mdb files.) So in my case, the root cause may have been a one-off event
that happened weeks ago (on version <= 52.9.1), making it hard to debug.
Can you explain a) in what way the value is bad - high/low/... ? b) what event?
Chances are this is unrelated, but I am often seeing a problem (on
yesterday's tip) where quitting will stall for a minute or two after the
following log line before finally crashing:[40353, Main Thread] WARNING: some msg dbs left open: '!m_dbCache.Length()',
file
/Users/simmons/thunderbird/source/comm/mailnews/db/msgdb/src/nsMsgDatabase.
cpp, line 81It reminded me that I occasionally experienced some similar stalls on
release builds (version <= 52.9.1) where I had to manually find and kill the
Thunderbird process. I wonder if this could be leading to corrupt databases
which in turn leads to the bad expungedBytes values.
So it hung? (not crash)
Do you still see either of these problems - the incorrect compact values, and hangs?
And does Sam's comment 52 seem relevant to your situation?
Comment 55•4 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #53)
Sam, does this occur in a profile that has only has an inbox with retention settings applied?
The issue occurs also in accounts for which I download all emails without considering their age. This speaks against my earlier hypothesis and puzzles me even more, as I typically do not delete any emails in from my accounts. I am happy to provide more information if I can.
Comment 59•4 years ago
|
||
(In reply to :aceman from comment #47)
More like at all places where we touch the expungedBytes variable. I could do that in the debugging patch we carry here.
assert (or something) on expungedBytes > folder size ?
Comment 60•4 years ago
|
||
(In reply to Sam from comment #52)
...
Is there a way to trigger this query without having to wait?
(I haven't tested this) An indirect approach is set the compact threshold to a low value (1MB), create a template message with large attachments, send it to yourself a few times, delete the messages you received. If no prompt, then restart thunderbird.
FWIW the purge code is at https://searchfox.org/comm-central/rev/dfafa758b061c4b4052899dd51d4304c066b249f/mailnews/base/src/nsMsgPurgeService.cpp#111
And lightweight description at https://bugzilla.mozilla.org/show_bug.cgi?id=990551#c9
Comment 61•4 years ago
|
||
We have a new example at https://support.mozilla.org/en-US/questions/1328291
I assume the debugging info being referenced is at https://bugzilla.mozilla.org/show_bug.cgi?id=750569#c62
If the regression is from v38 era, then it may be from one of https://mzl.la/30kBnUp
If from v52 era, then maybe from https://mzl.la/30fk0V1
Updated•3 years ago
|
Comment 62•3 years ago
|
||
I typically run without offline store so I seldom run into the auto-compact feature. But I sometimes set folders to use offline store when debugging a problem, for example the recent bug 1702692. In that bug the user has a message in offline store that has a header that TB v78.* deems invalid. This causes TB to re-download the message from the server when the folder is accessed and the message is redundantly stored to offline store many times. This causes the mbox file holding the message to grow in size continuously. Unfortunately, expunging, compacting or even repairing the folder doesn't get rid of this redundant content and reduce its size. So when an auto-compact occurs, this redundant space may be calculated as potentially able to be compacted out but it never is, thus causing the number of compact-able bytes to increase over time.
This is just a possible cause or a contributing cause of what is observed in this bug. The fix for bug 1702692 is not yet released and is currently only in the TB daily build and it doesn't get rid of the redundant content in the offline storage file; it just makes it less likely that redundant content will be added due to a bad header received from the IMAP server. The only way I could find to get rid of the redundant content was to delete the mbox file and the corresponding .msf file for the folder and let tb re-download and rebuild the folder with the patch for bug 1702692 applied which is more tolerant of "bad" header lines when accessing the mbox file.
Updated•3 years ago
|
Comment 64•3 years ago
|
||
This is the debugging patch I have have pending for this bug. It looks like it was never attached here, but maybe we made some try builds with it in the past.
It probably does not apply cleanly today.
Looks like there are some cleanups that could be landed independently on finding the main issue.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 66•2 years ago
|
||
My thunderbird is exhibiting symptoms that sound like this bug. Many times a day it says, "Thunderbird needs to do regular file maintenance to improve the performance of your mail folders. This will recover 89.7 megabytes of disk space without changing your messages..." It is always 89.7 MB, regardless of how often I compact my folders.
I have an inbox with a few subfolders and sub-sub-folders in at least one of those subfolders. I don't know where to find totalExpungedBytes and estimated/compacted size, so I can't tell you if they are incorrect or not.
I am running Thunderbird 102.0 on Windows 7.
Comment 67•2 years ago
|
||
I should add that if this doesn't seem to be the same as bug 1260698, I will be happy to submit a separate report. And I will be happy to run any tests that can help in fixing the bug. Unfortunately, I can't think of any way to recreate this bug from scratch.
Comment 69•2 years ago
|
||
I am embarrassed to confess that my problem was most likely the result of user error. I forgot to re-boot my computer after upgrading Thunderbird. I have re-booted and the problem has gone away.
Updated•2 years ago
|
Comment 70•1 year ago
|
||
(In reply to Stuart Soloway from comment #69)
I am embarrassed to confess that my problem was most likely the result of user error. I forgot to re-boot my computer after upgrading Thunderbird. I have re-booted and the problem has gone away.
Is this necessary? What OS? I have never thought a program issue was dependent on the OS rebooting.
Comment 71•1 year ago
|
||
In answer to Worcester12345: I believe that after I upgraded Thunderbird, a pop-up said that I should reboot my computer. I didn't. Then I saw the bug and reported it. Finally I remembered that popup and rebooted. The bug disappeared. I'm running a Windows7 desktop.
Comment 72•1 year ago
|
||
I seem to suffer from this bug. :-(
I've never seen it before, and I'm a very longtime user, using TB on many different OS, many machines.
It's on a newly set up Mac, latest macOS (ARM64) version, latest TB version.
It's suddenly saying that compacting folders would free 65.3 GB of disk (somehow reminds me of "65.535", i.e. 2^16 - 1?!). I don't dare to let TB clean up, scared that something bad could happen.
My profile folder is only 5 GB in size in total.
Could somebody pls guide me where to find a recent debug build that would output the size estimates for individual folders, so that we could find out what's wrong?
Description
•