Compaction pop up window reappears every few minutes
Hello everyone. Thanks for all your support.
A few weeks ago I started noticing a pop up window was occurring every (approx) 5 minutes in Thunderbird suggesting that I run a compact to save 992MB. I assumed this would stop happening after a few weeks and a few updates from Mozilla, but the problem has remained, so I'm coming here to ask about it.
Context: I'm on Windows 11. I have multiple email accounts that my Thunderbird reaches out to. At least one of the accounts is retired so reaching out to its historical server fails.
Reproducing: For me to reproduce it, I run the compact. Quit Thunderbird. Start Thunderbird. It reports 992MB can be freed. I let it compact. The main inbox disappears and reappears. I wait a few seconds and restart Thunderbird. It again tells me that it can save 992MB by running a compact.
What I've tried: I've tried repair on the inbox folder of the account I'm typically in. That didn't help. I have many other folders across many accounts and not tried to repair any other folders. I've searched the Mozilla help system.
Logs: It seems to me that a compact is probably failing but I don't know where to look for evidence of the failure.
Alle antwurden (10)
As far as I know, it's literally not possible for compact to pop up more than once an hour, unless you have restarted Thunderbird.
Are your account types mostly or all pop?
Wayne Mery said
As far as I know, it's literally not possible for compact to pop up more than once an hour, unless you have restarted Thunderbird. Are your account types mostly or all pop?
Thanks for the response. I supposed it's possible it's once an hour and time was passing quickly for me, but it's many times each day and previously it was about once each week. And it seems it now doesn't make any progress given that it's consistently 992MB.
My accounts are all IMAP, and none are POP. Several are with Google/Gmail. The rest are connecting to a managed Linux server running PostFix, etc. I don't know how the now-offline server was implemented... but it was IMAP as well.
I have some technical skills, but am a bit weak on Windows tech skills. With that being said, feel free to suggest steps I can take to provide useful clues.
https://kb.mozillazine.org/Nstmp_folders
Please try this first:
- Go into 'Offline' mode first
- Then compact folders - you could try compacting on specific folders as mentioned below.
- Do not attempt to view any folders or emails whilst this occurs.
- Do not exit Thunderbird.
I notice you mention 'Gmail' - do you have an 'All Mail' folder?
Try to compact on specific folders. The most common files that need compacting are those that get a lot of deletions or moves. examples 'Inbox', 'Drafts', 'Spam', 'Trash' and 'All Mail'
- Right click on 'Inbox' for one account and select 'compact'.
When completed:
- Right click on 'Drafts' for one account and select 'compact'.
etc
Look in profile folders to see if there are any nstmp files.
- In 'Help' > 'Troubleshooting Information'
- Under 'Application Basics' section - half way is 'Profile Folder' - click on 'Open Folder'
- It opens in a new window
- click on 'ImapMail' folder to see contents
- click on a mail account folder to see contents
Do you see any nstmp files ?
Bewurke troch Toad-Hall op
Thanks Toad-Hall.
offline After going offline as you suggested I compacted my main inbox. After that I saw no more compact menu items for me to click on. I went online again and those menu items reappeared for each folder and each account. I then went offline again and the menu items all seemed to go away. (I don't know why the first time there was that one compact menu item but none at all the second time.)
All Mail A few days ago I removed the All Mail/IMAP configurations at gmail.com for my main gmail account. That didn't help and I can no longer compact that folder in TB because TB says the server says the folder is nonexistent. Some of my other gmail accounts still have that folder and do allow compaction, but show 0 bytes saved when I compact. -- If you'd like me to reenable the AllMail/IMAP configuration and try another compact, let me know. That used to be large before I disabled IMAP for it, but now TB lists that folder as having zero messages.
extra profile directories When snooping the directories you mentioned I see several old unused profile directory trees. Quitting TB, moving those extra folder trees elsewhere, and restarting TB, has not resolved the problem.
no nstmp files You asked about nstmp files. While looking into this I notice that I seem to have many msf files and no nstmp files.
blue bar I do notice that sometimes the blue progress bar in the lower right corner of Thunderbird stays at about 60%. I've not noticed when it does this or what it's probably doing when it shows that blue progress bar.
no compaction feedback I do notice that if I start TB, it pops up that dialog window asking me to compact. If I wait about 20sec for all the status messages regarding all the initial connection attempts to my accounts end and then I then say that I want to do a compact, the dialog window does away, but I see no status message indicating that anything is being done or has been completed. So maybe it isn't even doing the compact?
Bewurke troch trewtus+200514ffox op
It is equally likely that the estimated compact recovery amount is just wrong and that there is no need to compact. Without a log It's not possible to know whether compact is failing or the amount is wrong.
Toad-Hall said
https://kb.mozillazine.org/Nstmp_folders ... Do you see any nstmp files ?
This information is no longer accurate. There are intermediate files in a .compact-temp dir. Details at: https://source-docs.thunderbird.net/en/latest/backend/folder_compaction.html
I figured out how to turn on logging of "compact" events. I've browsed those logs and reviewed the (admittedly old) github version of that code (because it was too difficult for me to set up mercurial to fetch newer code). I now understand that the "992MB" number is across all servers and folders that TB is managing. The logs don't give me a lot of details about how that 991..993MB number is calculated. The code mentions something about summing up the values found for both local and online as well, but I don't know what that is. (That (admittedly old) code seems to use global variables in a way that might result in a miscalculation if certain (unfamiliar to me) criteria are met. But I don't don't think that's this problem.) I'm hypothesizing that there is something that I've not identified that the code is seeing that consistently boosts the estimated saving up to about 991MB and the code might find another 1..2 MB of actual expungedBytes. The result is an estimate of expunged 991MB..993MB. According to the logs the subsequent compaction does eliminate those extra 1..2 MB that it found.
I'm also running into a bit of trouble with the logs because they seem to stop in the middle of a logging line as if the logging is not fully flushed to disk. You might know a way to work around that. With that being said, I don't think the problem is hidden by these unflushed log lines.
I don't know what online folders vs local folders means in the context of compaction. Perhaps only one of them is being compacted but the other is the one that is responsible for boosting the estimate up by 991MB?
I'll try to read the code again tomorrow, but suggestions are welcome.
Online (actually offline) folders refers to messages which have been downloaded for offline use from imap accounts.
Your 991MB is indeed a number across all accounts. In theory, the variable gets incremented as messages are deleted, and decremented as compacts occur on individual folders. In other words, it is not derived by summing all folders each time a compact might happen.
Do you have filters on pop accounts? Are your accounts all imap or all pop?
Thanks for those tips. I'll keep them in mind.
Sorry about my confusing offline/online. I assume the main difference is that one type will sync with the server and the other does not.
My TB is using only IMAP.
After four attempts on Windows to clone the actual mozilla-central code, I finally succeeded in WSL. My next step, probably not today, is to parse those Mork/msf files to understand which might be claiming a very large amount of expungedBytes.
Thanks again.
Bewurke troch trewtus+200514ffox op
trewtus+200514ffox said
My next step, probably not today, is to parse those Mork/msf files to understand which might be claiming a very large amount of expungedBytes.
Appreciate you looking at this, as it would be significant progress.
Bear in mind there is an equal chance that each folder's data is correct but the global calculated value of expungedBytes is somehow flawed. A wildly flawed number for expungedBytes might point in this direction.
Bewurke troch Wayne Mery op
re :All Mail A few days ago I removed the All Mail/IMAP configurations at gmail.com for my main gmail account. That didn't help and I can no longer compact that folder in TB because TB says the server says the folder is nonexistent.
If still a problem - you can see 'All Mail' folder in imap but cannot do anything with it. In gmail webmail allow IMAP for 'All Mail'. Then in Thunderbird you should be able to 'unsubscribe' from seeing it, then back in webmail you can deselect the 'Show in Imap'. This should remove properly from imap account.