Closed Bug 2083679 Opened 1 month ago Closed 1 month ago

'NS_ERROR_NOT_AVAILABLE [nsIChannel.contentType]' error from the JSON view sniffer for every failed page load

Categories

(DevTools :: JSON Viewer, defect)

defect

Tracking

(firefox160 fixed)

RESOLVED FIXED
160 Branch
Tracking Status
firefox160 --- fixed

People

(Reporter: marco, Assigned: marco)

References

(Blocks 1 open bug)

Details

Attachments

(1 external file)

Content sniffers are also called for top level loads that failed before a response was received, e.g. on connection or DNS errors, or when the load is cancelled. Reading the channel's content type then throws, and the JSON view sniffer doesn't handle it:

NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIChannel.contentType]  Sniffer.sys.mjs

User impact: page loads aren't affected, since a failing sniffer is skipped, but an error is logged in the browser console for every failed top level load.

On CI it was logged 44,322 times in 11,572 jobs, from 136 tests, out of the 31,690 mozilla-central mochitest jobs of 2026-10-15 in the errors dashboard (https://tests.firefox.dev/errors.html?kind=mochitest#date=2026-10-15). These are mostly tests that open external links, which fail in CI, or close tabs while they load.

Content sniffers are also called for top level loads that failed before a
response was received, where reading the content type throws, which logged an
error in the browser console for every such load.

Assignee: nobody → mcastelluccio
Attachment #9664675 - Attachment description: WIP: Bug 2083679 - Don't throw in the JSON view sniffer when the channel has no content type. r?#devtools-reviewers! → Bug 2083679 - Don't throw in the JSON view sniffer when the channel has no content type. r?#devtools-reviewers!
Status: NEW → ASSIGNED
Pushed by mcastelluccio@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/22c821f24b28 https://hg.mozilla.org/integration/autoland/rev/c156d9071b01 Don't throw in the JSON view sniffer when the channel has no content type. r=devtools-reviewers,ochameau,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: