Closed Bug 1374244 Opened 7 years ago Closed 7 years ago

Thunderbird 52.2.0 loses my local copies of gmail folders and email on startup and then redownloads everything

Categories

(MailNews Core :: Networking: IMAP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 54.0

People

(Reporter: Gijs, Unassigned)

References

Details

(Keywords: regression, Whiteboard: [fixed by backout of bug 1176399])

Since updating to 52.2.0 (I think from 52.1.0), when restarting Thunderbird it seems delete all the folder information and mail, and then redownloads everything. Some accounts end up being highlighted blue (ie "new messages") but with no folders (not even Inbox/sent/trash), making it impossible to read those emails. After several restarts, all the folders show up, but it's become clear that TB still needs to redownload all their contents. After then leaving it running for a while, the next restart everything was deleted once more.

Needless to say, with several gmail accounts with several gigabytes of email each, this basically broke thunderbird for me.

I'm familiar with gecko / xul / js so I'd be happy to help debug, but I have no real idea of where to start.
see Bug 1373161.

We'd love to know why bug 1176399 broke gmail.
Summary: Thunderbird deletes my local copies of folders and email on startup → Thunderbird 52.2.0 loses my local copies of gmail folders and email on startup and then redownloads everything
Version: unspecified → 52
Gijs, thanks for reporting, we have many users reporting the same. Perhaps you can check what was landed in bug 1176399 to see whether anything obvious could have caused this:
https://hg.mozilla.org/comm-central/rev/c553f7084ca92a5a93b66c5d0a82b78e385d356b
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #1)
> see Bug 1373161.

Just so we're clear on the summary change here, re: "loses" vs. "deletes" - the activity window explicitly says "deleting folder X" (times <many>).
(In reply to Jorg K (GMT+2) from comment #2)
> Gijs, thanks for reporting, we have many users reporting the same. Perhaps
> you can check what was landed in bug 1176399 to see whether anything obvious
> could have caused this:
> https://hg.mozilla.org/comm-central/rev/
> c553f7084ca92a5a93b66c5d0a82b78e385d356b

It looks to me like, before, oauth connect didn't directly call into the prompt code, and now it does, which I don't understand. Like, it didn't call onPromptStart() directly anyway, but now it's been made to call onPromptStartAsync? Also, it then calls back to the aListener passed to connect() *before* calling back into the prompt thing's onAuthResult, which also seems odd. If anything, I would expect that the aListener callback should wait until after the onAuthResult call has been resolved and whatever code depends on that had run to completion.

More generally, it seems oauth.connect() used to return synchronously (and call onSuccess() synchronously!) in the case where a token was readily available, and now it doesn't. Perhaps some caller doesn't wait, but should?

The timing differences could mean that there's some kind of race - which folders get recreated / deleted seems to vary every time I start up, which would support that theory.

However, I don't actually know any of this code and don't have time to dive into it in detail...
The symptoms I'm seeing look scarily similar to, except sans master password:

https://bugzilla.mozilla.org/show_bug.cgi?id=1176399#c27


(In reply to Magnus Melin from comment #27)
> With this patch applied, [...]
> only one of the accounts is showing any folders (just shows the account
> name, no folders to expand). Presumably the "second" one is not really
> authenticated.

FWIW, my error console does have a single line containing simply 'null' with no other information (no file name or anything).
Gijs, thanks for the excellent info, esp comment 4.  Too bad it's spring time and it's hard to attract developer time - especially to PITA imap issues. :(


(In reply to :Gijs from comment #3)
> (In reply to Wayne Mery (:wsmwk, NI for questions) from comment #1)
> > see Bug 1373161.
> 
> Just so we're clear on the summary change here, re: "loses" vs. "deletes" -
> the activity window explicitly says "deleting folder X" (times <many>).

I'm sorry, yes, this change is confusing and I was ambivalent about it - I don't want users with other "delete" problems to be drawn to the bug, and because the folder still exist, it's just the local copy deleted.
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #6)
> Too bad it's spring
> time and it's hard to attract developer time - especially to PITA imap
> issues. :(

Is there a particular reason not to revert this and do a dot-release for ESR? At the moment, TB ESR is basically completely unusable for gmail users. I kind of assume (but obviously have no data to support...) that there are more gmail users than master password users, and even if that weren't the case, it feels like having the app be completely unusable is a lot worse than an issue with multiple prompts that has existed for several years now.
Flags: needinfo?(vseerror)
+1 that Thunderbird 52.2.0 is has become unusable for Gmail. Same problem is plaguing me here with all local downloaded folders disappearing, and then having to re-download everything. I have A LOT of email in the cloud, and this repeated downloading is painful.

Yes, I intentionally want to keep a local copy of all email just in case the cloud goes poof. But not re-downloading many gigabytes several times a day.

I'm not seeing any auth issues here or any signs that folders are individually disappearing. I just start up Thunderbird and every folder under my mail account is missing from the Thunderbird folder list.

If you need further info, I'll be happy to provide it if you tell me how to collect it. I'm on Windows 10 Creators Edition.
(In reply to Mark Bixby from comment #8)
> +1 that Thunderbird 52.2.0 is has become unusable for Gmail. Same problem is
> plaguing me here with all local downloaded folders disappearing, and then
> having to re-download everything. I have A LOT of email in the cloud, and
> this repeated downloading is painful.
> 
> Yes, I intentionally want to keep a local copy of all email just in case the
> cloud goes poof. But not re-downloading many gigabytes several times a day.

by cloud, you mean generic gmail?

> I'm not seeing any auth issues here or any signs that folders are
> individually disappearing. I just start up Thunderbird and every folder
> under my mail account is missing from the Thunderbird folder list.

Does the same thing happen if you start Thunderbird in safe mode?
Flags: needinfo?(mark)
My bixby.org email is hosted by Google G Suite (formerly known as Google Apps). The Thunderbird server settings are a server type of IMAP Mail server, to imap.gmail.com port 993, with connection security of SSL/TLS and authentication of OAuth2.

The first time I started up Thunderbird in safe mode this morning, it retained the mail folder structure from last night, but did start downloading from where it left off in the wake of yesterday's problems.

Then I shut it down, and started again in safe mode. Poof! The mail folder structure was initially present, but then disappeared, re-appeared, then it started downloading headers and content.

Safe mode isn't solving the problem, but it apparently isn't occurring with every startup.
Flags: needinfo?(mark)
Just some information on the failure I am experiencing.  I have several Gmail accounts (and others) and use unified folders.  Initially, I lost the unified folder view, though could still see each individual account.  Then I lost all Gmail accounts; unified view still showed non-Gmail accounts.  I have restarted in safe mode.  The unified view still shows non-Gmail accounts, but not Gmail, but under it I can see the individual Gmail accounts.  So I can continue to work.

Not sure if it is relevant, but Google has changed at least the appearance of their login process in the last few weeks; is that a factor?
(In reply to Jorg K (GMT+2) from comment #13)
> All people affected, please try TB 52.2.1:
> http://ftp.mozilla.org/pub/thunderbird/candidates/52.2.1-candidates/build1/

This seems to fix things for me.
(In reply to Jorg K (GMT+2) from comment #13)
> All people affected, please try TB 52.2.1:
> http://ftp.mozilla.org/pub/thunderbird/candidates/52.2.1-candidates/build1/

So far so good for me, but it's going to have to run overnight here in California to complete all of the mass-downloading to recover from prior loss of the local folder copies under 52.2.0.
All of my mail folders have downloaded, and I've been through a bunch of TB restarts with no folder loss issues noted.

52.2.1 appears to have fixed this problem for me.
5.2.1 solves the missing GMail folders, thanks.  But it does not include the Gmail accounts in the Unified view.  Tried deleting "smart mailboxes" but this does not help. I don't know the drill; should I leave this comment here or register it as a new bug`?
(In reply to Mike from comment #17)
> 5.2.1 solves the missing GMail folders, thanks.  But it does not include the
> Gmail accounts in the Unified view.  Tried deleting "smart mailboxes" but
> this does not help. I don't know the drill; should I leave this comment here
> or register it as a new bug`?

You should open a new bug and be more clear in your message than the one you have just written.
(In reply to Yarr from comment #18)
> (In reply to Mike from comment #17)
> > 5.2.1 solves the missing GMail folders, thanks.  But it does not include the
> > Gmail accounts in the Unified view.  Tried deleting "smart mailboxes" but
> > this does not help. I don't know the drill; should I leave this comment here
> > or register it as a new bug`?
> 
> You should open a new bug and be more clear in your message than the one you
> have just written.

Thanks.  I have done that (1376508), though it isn't a technical analysis; I hope it is clear enough.  I had previously given more detail in comment 12 above.
resolved by backouts
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(vseerror)
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 54.0
Blocks: 1176399
Whiteboard: [fixed by backout of bug 1176399]
You need to log in before you can comment on or make changes to this bug.