Open Bug 1178729 Opened 9 years ago Updated 2 years ago

Eliminate "Uncaught exception" (which is spamming the Error Console) from onFolderRemovedFromQ call to removeActivity throwing NS_ERROR_NOT_AVAILABLE

Categories

(Thunderbird :: General, defect)

38 Branch
Unspecified
All
defect

Tracking

(Not tracked)

People

(Reporter: jesper, Unassigned, NeedInfo)

References

()

Details

(Whiteboard: [waiting on bug 981187, via bug 1044109])

This could be related to bug 1143523, but I am not deleting mails, but this seems to trigger some time after hitting Get Messages on imap an account. I debugged this first in c++ from observer->notify()->onFolderRemovedFromQ->removeActivity->uncaught Exception Then attached the remote debugger and found[1]: 94 removeActivity: function (aID) { 95 let activity = this._activities[aID]; 96 97 if (!activity) 98 throw Cr.NS_ERROR_NOT_AVAILABLE; to be the triggering cause. The remote debugger wont step out to onFolderRemovedFromQ in autosync.js, but setting a breakpoint will allow stepping into removeActivity and then out again[2]. The remote debugger will hit the catch code: 209 try { 210 this.activityMgr.removeActivity(process.id); 211 } 212 catch(e) { 213 // It is OK to end up here; If the folder is queued and the 214 // message get manually downloaded by the user, we might get 215 // a folder removed notification even before a donwload 216 // started for this folder. This behavior stems from the fact 217 // that we add activities into the activity manager in 218 // onDownloadStarted notification rather than onFolderAddedIntoQ. 219 // This is an expected side effect. 220 } It will however still produce an uncaught exception. [1] http://mxr.mozilla.org/comm-esr38/source/mail/components/activity/nsActivityManager.js#98 [2] http://mxr.mozilla.org/comm-esr38/source/mail/components/activity/modules/autosync.js#210
Component: Untriaged → General
Modified that javascript code a bit: try { dump("PREEXCEPTION CALL\n"); this.activityMgr.removeActivity(process.id); dump("POSTEXCEPTION CALL\n"); } catch(e) { dump("EXCEPTION : removeActivity: " + e + "\n"); // It is OK to end up here; If the folder is queued and the // message get manually downloaded by the user, we might get // a folder removed notification even before a donwload // started for this folder. This behavior stems from the fact // that we add activities into the activity manager in // onDownloadStarted notification rather than onFolderAddedIntoQ. // This is an expected side effect. } dump("CATCH PASSED\n"); Expected yet unexpected results: PREEXCEPTION CALL JavaScript error: , line 0: uncaught exception: 2147746065 EXCEPTION : removeActivity: [Exception... "Component is not available'Component is not available' when calling method: [nsIActivityManager::removeActivity]" ns result: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource:/ //modules/activity/autosync.js :: autosyncModule.onFolderRemovedFromQ :: line 21 1" data: no] CATCH PASSED
What is the real problem here? You see the exception in the Error console even though the code says an exception is expected and should be silently caught by the catch(e) clause? Do you maybe have some development setting that shows exceptions even when they are caught?
I do not know what the real problem is, but I too am not deleting mail. Just using a "normal" environent with fairly continuous Error: uncaught exception: 2147746065 Source File: resource:///modules/activity/autosync.js Line: 210 It would be nice to be rid of it because it just polutes the error concole Unclear if these are related https://www.thunderbird-mail.de/thread/71158-neue-mails-werden-erkannt-aber-nicht-heruntergeladen-bzw-angezeigt/
Flags: needinfo?(jesper)
We need a XPCOM magician to look at this bug. 49 get activityMgr() { 50 delete this.activityMgr; 51 return this.activityMgr = Cc["@mozilla.org/activity-manager;1"] 52 .getService(Ci.nsIActivityManager); 53 }, For some reason throws are not caught outside of the service. Maybe that's by design though
Flags: needinfo?(jesper)
Perhaps joshua or magnus
Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(Pidgeot18)
No ideas atm, sorry.
Flags: needinfo?(mkmelin+mozilla)
Could be similar to bug 1044109.
so ultimately we are waiting on bug 981187? (which has made zero progress in >1yr, except possibly in some of its blockers)
Depends on: 1044109
(In reply to Wayne Mery (:wsmwk, use Needinfo for questions) from comment #8) > so ultimately we are waiting on bug 981187? Yup. And it can't be changed to a return instead of a throw either. Unless you want to change a lot of code.
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #3) [...] > Just using a "normal" environent with fairly continuous > Error: uncaught exception: 2147746065 > Source File: resource:///modules/activity/autosync.js > Line: 210 I get the same with Thunderbird 45.1.1 every time I access [Gmail]/All Mail. As explained in Description, there is a short time before the error appears.
(In reply to Jesper Hansen from comment #9) > (In reply to Wayne Mery (:wsmwk, use Needinfo for questions) from comment #8) > > so ultimately we are waiting on bug 981187? > Yup. > And it can't be changed to a return instead of a throw either. Unless you > want to change a lot of code. Now that the other bug is fixed, is there more you can do?
Flags: needinfo?(jesper)
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #11) > (In reply to Jesper Hansen from comment #9) > > (In reply to Wayne Mery (:wsmwk, use Needinfo for questions) from comment #8) > > > so ultimately we are waiting on bug 981187? > > Yup. > > And it can't be changed to a return instead of a throw either. Unless you > > want to change a lot of code. > > Now that the other bug is fixed, is there more you can do? I don't have an answer to that question
Flags: needinfo?(jesper)
Flags: needinfo?(Pidgeot18)

(fixed) bug 981187 comment 7 in 2016 "This is done now (bug 1277278 removed dontReportUncaught)."

Which is strange because bug 1277278 is not found in bug 981187's dependency tree.

Flags: needinfo?(acelists)
OS: Unspecified → All
Summary: Uncaught exception from onFolderRemovedFromQ call to removeActivity throwing NS_ERROR_NOT_AVAILABLE → Eliminate "Uncaught exception" (which is spamming the Error Console) from onFolderRemovedFromQ call to removeActivity throwing NS_ERROR_NOT_AVAILABLE
Whiteboard: [waiting on bug 981187, via bug 1044109]

Aceman, I guess the question still in play is from comment 3

And it can't be changed to a return instead of a throw either. Unless you
want to change a lot of code.

Now that the other bug is fixed, is there more you can do?

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.