Closed Bug 1949059 Opened 6 months ago Closed 6 months ago

File corruption error in console when trying to send email

Categories

(Thunderbird :: Message Compose Window, defect)

Thunderbird 137
defect

Tracking

(thunderbird_esr128 unaffected, thunderbird136 affected)

RESOLVED FIXED
137 Branch
Tracking Status
thunderbird_esr128 --- unaffected
thunderbird136 --- affected

People

(Reporter: pvagner, Assigned: mkmelin)

References

Details

Attachments

(1 file)

Steps to reproduce:

I have updated from Thunderbird 133 directly to Thunderbird 137 daily 20250214 and noticed I can no longer send messages.

I am using ctrl+enter to send the message when I am done typing it in.

As soon as I press ctrl+enter, the traceback like this is printed to the console:

NS_ERROR_FILE_CORRUPTED: Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [mozIStorageStatement.executeStep] SQLiteDirectory.sys.mjs:437
NS_ERROR_FILE_CORRUPTED: Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [mozIStorageStatement.executeStep] SQLiteDirectory.sys.mjs:437
GenericSendMessage FAILED: [Exception... "Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [mozIStorageStatement.executeStep]"  nsresult: "0x8052000b (NS_ERROR_FILE_CORRUPTED)"  location: "JS frame :: resource:///modules/SQLiteDirectory.sys.mjs :: getCardFromProperty :: line 437"  data: no] MsgComposeCommands.js:6452:13
NS_ERROR_FILE_CORRUPTED: Component returned failure code: 0x8052000b (NS_ERROR_FILE_CORRUPTED) [mozIStorageStatement.executeStep]
    getCardFromProperty resource:///modules/SQLiteDirectory.sys.mjs:437
    cardForEmailAddress resource:///modules/AddrBookDirectory.sys.mjs:470
    book resource:///modules/AddressCollector.sys.mjs:40
    collectSingleAddress resource:///modules/AddressCollector.sys.mjs:40
    _collectAddressesToAddressBook resource:///modules/MessageSend.sys.mjs:1275
    _deliverAsMail resource:///modules/MessageSend.sys.mjs:1183
    _deliverMessage resource:///modules/MessageSend.sys.mjs:860
MsgComposeCommands.js:6363:13

I have listed all the .sqlite files inside my profile folder, checked it with sqlite 3 pragma integrity_check; and I think all of them are readable with no errors.

Actual results:

I would expect more informative error message or troubleshooting tips on how I can get message sending to work again.

It does seem like some address book file is still "bad". That error is mapped from SQLITE_NOTADB - perhaps one of your address books is set to use some non sqlite file for whatever reason.

Anyway, corrupt ab shouldn't cause sending failure. I'll fix that.

Component: Untriaged → Message Compose Window
Assignee: nobody → mkmelin+mozilla
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

:mkmelin I know this is not a technical support forum, but can you please try to give me a hint how I might be able to discover which of my addressbooks is corrupted?

When going to tools -> Addressbook I do have

  • Personal address book: that is the default and it's empty
  • Personal without the word addressbook in the name - this is the one I am syncing from caldav server. It's working fine and it has more than 300 contacts including photos for a few contacts.
  • Family - another one synced from caldav, it has another 300 contacts and appears to work fine. There are no photos.
  • Collected addresses - This one has more than 2000 entries and it can still be browsed.

All of these appear to be writable and I can export all of them to file. Are they stored in a single file or is there a specific file for each addressbook? Please how do I find that from within about:config?

Or might there be more not showing in the UI?

I think you can go to about:config, go through `ldap_2.servers´ (not the most logical name, but...) and see what filenames are used for each.
Each of the address books will have their own sqlite file (pref named like ldap_2.servers.FOO.filename for addressbook FOO).
For the built-in ones. If address books from add-ons were at some point involved... then I don't know.

Huge thanks, collected addresses got broken. I went removing one file at a time and trying the sending emails again and again and I have found out history.sqlite file was the culprit. I removed that file, reimported collected addresses from backup and now my immediate issue is resolved.
I imagine the fix you are working on will make it more resilient to such issues in the future.

Once again huge thanks for being so helpfull and also for all the hard work related to thunderbird development.

Target Milestone: --- → 137 Branch

Pushed by john@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/61f306a14cb8
Handle corrupted ab gracefully during sending. r=john.bieling

Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED

Probably this surfaced through bug 1900211.

Comment on attachment 9467044 [details]
Bug 1949059 - Handle corrupted ab gracefully during sending. r=john.bieling

[User impact if declined]

  • Having a corrupt address book sqlite file prevents sending mail

[Is this code covered by automated tests?]

  • No

[Has the fix been verified in Daily? (or Beta for an ESR uplift?)]

  • Yes

[Needs manual test from QA?]

  • No

[Risk to taking this patch]

  • No risk. Just adds try-catch to ignore such errors, should they occur.
Attachment #9467044 - Flags: approval-comm-release?
Attachment #9467044 - Flags: approval-comm-beta?

Comment on attachment 9467044 [details]
Bug 1949059 - Handle corrupted ab gracefully during sending. r=john.bieling

[Triage Comment]
Approved for beta
Approved for release

Attachment #9467044 - Flags: approval-comm-release?
Attachment #9467044 - Flags: approval-comm-release+
Attachment #9467044 - Flags: approval-comm-beta?
Attachment #9467044 - Flags: approval-comm-beta+
Duplicate of this bug: 1953505
Duplicate of this bug: 1954699
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: