Open Bug 1491115 Opened 6 years ago Updated 2 years ago

Insufficient context information to diagnose "Error: Invalid tab ID"

Categories

(WebExtensions :: Frontend, defect, P3)

63 Branch
defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: from_bugzilla3, Assigned: robwu)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0 Build ID: 20180906162647 Steps to reproduce: I don't know. The whole problem is that I lack information necessary to identify the cause. Actual results: I've been getting an "Error: Invalid tab ID: 436" in the browser console every 5 seconds, but the only source information is "ExtensionUtils.jsm" without a line number. This is made even less helpful by the fact that having ExtensionUtils.jsm as the source says nothing to me beyond the "this is probably running in a timer" which I already knew.
Component: Untriaged → Tabbed Browser
Component: Tabbed Browser → Frontend
Product: Firefox → WebExtensions
Priority: -- → P2
Can you narrow down which extension is causing this since there are no STR?
Flags: needinfo?(from_bugzilla2)
I have 38 extensions installed, so, given that this bug is about how Firefox presents diagnostic information, it'd probably be quicker and easier to just construct a demo extension which intentionally requests an invalid tab ID. That said, if I notice the browser has gotten back into a state where the "Error: Invalid tab ID" message is being fired repeatedly by a timer, I'll try turning off extensions one-by-one. I do eventually need to report that bug too... it's just a pain to do so while this bug is unresolved. I've got a few other bugs which need further info from me (eg. determining whether bug 1491624 is a regression), so it may take me a few days to get to this.
I decided to just bite the bullet and managed to figure out what causes the messages to start (having the last manipulation of the tab strip be the closing of a tab), so I kept looking. I haven't managed to identify what causes it to keep retrying once every 5 seconds, but, by disabling one extension at a time, I managed to track down the source of the bug and produce a STR for the relevant part (the message itself): 1. Create a new profile in Firefox Nightly 2. Install Tree Style Tab 2.5.4 from addons.mozilla.org 3. Open the Browser Console (Ctrl+Shift+J) 4. Close a tab By following those extensions, I induced two copies of "Error: Invalid tab ID: 3" in the browser console which, in line with this bug report, provide no means of tracing their origin back to Tree Style Tab.
Flags: needinfo?(from_bugzilla2)
Ugh. "By following those instructions ...". I hate how error-prone I get when I'm trying to recover a sleep debt.
Priority: P2 → P3

I was about to file a new bug, but then found this report, so I'll attach my comment and STR here. This bug does not only make it difficult to debug extensions, it also makes it difficult to debug test failures.

If an extension API error occurs, then the console attributes the error to ExtensionUtils.jsm. This is next to useless, as is does not allow me to find the source of the error. Test case, run the following from the background page of any extension (e.g. via about:debugging):

browser.tabs.get(1337);

The console then contains:

Error: Invalid tab ID: 1337 ExtensionUtils.jsm

ExtensionUtils.jsm is shown, because somehow it is the top of the stack.

When I put a breakpoint in ExtensionParent.jsm, then I see the following stack trace:

ExtensionError@resource://gre/modules/ExtensionUtils.jsm:54:49
getTab@chrome://browser/content/parent/ext-browser.js:457:11
get@chrome://browser/content/parent/ext-browser.js:1131:32
get@chrome://browser/content/parent/ext-tabs.js:925:29
call/result</<@resource://gre/modules/ExtensionParent.jsm:1160:68
withPendingBrowser@resource://gre/modules/ExtensionParent.jsm:771:26
call/result<@resource://gre/modules/ExtensionParent.jsm:1160:24
callAndLog@resource://gre/modules/ExtensionParent.jsm:1119:14
call@resource://gre/modules/ExtensionParent.jsm:1159:25
async*receiveMessage@resource://gre/modules/ExtensionParent.jsm:1006:16
( ... cut because not relevant ...)
Assignee: nobody → rob
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Priority: P3 → P2
Priority: P2 → P3
Severity: normal → S3

I'm getting this same error message "Error: Invalid tab ID: 1" but my source says it's "undefined" - that's literally what it says where the source of error is. I'm getting this in literally ever tab I've tried, my site, wikipedia, youtube... each has same number "1"

You need to log in before you can comment on or make changes to this bug.