Closed Bug 2027209 Opened 4 months ago Closed 3 months ago

Increase error code visibility on net error pages

Categories

(Firefox :: Security, defect, P2)

Firefox 149
defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox151 --- fixed
firefox152 --- fixed

People

(Reporter: jbrown, Assigned: jbrown)

References

(Blocks 1 open bug)

Details

Attachments

(8 files, 2 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
119.36 KB, image/png
Details
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

A Reddit thread surfaced user complaints that the new Felt Privacy error pages don't show error codes. Investigation suggests this might not be a straightforward regression, since the specific errors shown in the screenshot (connectionFailure/netInterrupt) never showed error codes in the old UI either.

The real issue could be broader, since this affects all net errors that go through the customNetError template in net-error-card.mjs. These error configs are all defined in net-errors.mjs, but not every config in that file is affected.

A decision is needed on which of these net errors should actually display their error code. If any should, the fix is straightforward: update customNetErrorSectionTemplate in net-error-card.mjs to render the error code when present in the config, and ensure the relevant registry entries have the correct errorCode values.

This looks like a duplicate of bug 2023800

See Also: → 2019611
Error ID Displayed Code Reason NOT to show Reason to show Show?
NS_ERROR_OFFLINE NS_ERROR_OFFLINE Real NS_ERROR_* code. meaningful for support and diagnostics TBD
blockedByCOOP NS_ERROR_DOM_COOP_FAILED Real NS_ERROR_* code. directly actionable for web devs debugging COOP headers TBD
blockedByCOEP NS_ERROR_DOM_COEP_FAILED Real NS_ERROR_* code. directly actionable for web devs debugging COEP headers TBD
netReset Useful to distinguish from other connection errors in bug reports TBD
connectionFailure Common. helps users search for solutions and file useful bug reports TBD
netInterrupt Distinguishes mid-transfer failures from initial connection failures TBD
netTimeout Distinguishes timeout from refused/reset TBD
dnsNotFound Very common. well-recognised by users and support staff TBD
httpErrorPage COMPLETE: Bug 2023800 already surfaces the HTTP status code and text in the intro via responsestatus/responsestatustext. Yes
serverError COMPLETE: Bug 2023800 already surfaces the HTTP status code and text in the intro. Yes
invalidHeaderValue Useful for web devs diagnosing malformed response headers TBD
deniedPortAccess Firefox security policy. not actionable by the user or support. Bug 2024150 (currently reverted) also removed whatCanYouDoL10nId from this config, treating it as having no remediation steps at all TBD
malformedURI User typed an invalid URL. "malformedURI" is semantically identical to the page title and doesn't help them fix it TBD
captivePortal Single clear action (open login portal). code has no actionable or diagnostic value TBD
contentEncodingError Identifies server-side encoding misconfigurations. useful for reporting to site owners TBD
corruptedContentErrorv2 Distinguishes corruption from other transfer errors TBD
fileAccessDenied Local file permission error. code restates the title with no additional diagnostic value TBD
fileNotFound COMPLETE: Bug 2018850 added file-specific messaging (actual file path, file-oriented advice). Yes
inadequateSecurityError Identifies weak TLS configuration specifically. useful for tech support TBD
netOffline Distinguishes browser offline mode from actual connectivity failures TBD
networkProtocolError Identifies HTTP/2 or HTTP/3 protocol-level failures TBD
notCached Informational only. code doesn't help the user or support take any action TBD
nssFailure2 Helps support identify NSS library failures TBD
proxyConnectFailure Useful for proxy configuration diagnosis TBD
vpnFailure Useful for IT support troubleshooting VPN connectivity TBD
proxyResolveFailure Distinguishes proxy DNS failures from proxy connection failures TBD
redirectLoop Helps users report the specific condition to site owners TBD
sslv3Used Identifies the specific obsolete protocol. useful for tech support TBD
unknownProtocolFound Identifies unrecognised URI scheme issues TBD
unknownSocketType Useful for tech support diagnosing misconfigured socket types TBD
unsafeContentType Identifies a MIME-type safety issue. useful for web devs TBD
cspBlocked Useful for web devs debugging CSP configurations TBD
xfoBlocked Useful for web devs debugging X-Frame-Options configurations TBD

I've updated the table below with what we should do in bold. Some of the pages I marked no because the text on the page is specific enough to already describe the error.

(In reply to Jack Brown from comment #2)

Error ID Displayed Code Reason NOT to show Reason to show Show?
NS_ERROR_OFFLINE NS_ERROR_OFFLINE Real NS_ERROR_* code. meaningful for support and diagnostics Yes
blockedByCOOP NS_ERROR_DOM_COOP_FAILED Real NS_ERROR_* code. directly actionable for web devs debugging COOP headers Yes
blockedByCOEP NS_ERROR_DOM_COEP_FAILED Real NS_ERROR_* code. directly actionable for web devs debugging COEP headers Yes
netReset Useful to distinguish from other connection errors in bug reports Yes
connectionFailure Common. helps users search for solutions and file useful bug reports Yes
netInterrupt Distinguishes mid-transfer failures from initial connection failures Yes
netTimeout Distinguishes timeout from refused/reset Yes
dnsNotFound Very common. well-recognised by users and support staff Yes
httpErrorPage COMPLETE: Bug 2023800 already surfaces the HTTP status code and text in the intro via responsestatus/responsestatustext. Yes
serverError COMPLETE: Bug 2023800 already surfaces the HTTP status code and text in the intro. Yes
invalidHeaderValue Useful for web devs diagnosing malformed response headers Yes
deniedPortAccess Firefox security policy. not actionable by the user or support. Bug 2024150 (currently reverted) also removed whatCanYouDoL10nId from this config, treating it as having no remediation steps at all No
malformedURI User typed an invalid URL. "malformedURI" is semantically identical to the page title and doesn't help them fix it No
captivePortal Single clear action (open login portal). code has no actionable or diagnostic value No
contentEncodingError Identifies server-side encoding misconfigurations. useful for reporting to site owners Yes
corruptedContentErrorv2 Distinguishes corruption from other transfer errors TBD
fileAccessDenied Local file permission error. code restates the title with no additional diagnostic value No
fileNotFound COMPLETE: Bug 2018850 added file-specific messaging (actual file path, file-oriented advice). Yes
inadequateSecurityError Identifies weak TLS configuration specifically. useful for tech support No
netOffline Distinguishes browser offline mode from actual connectivity failures Yes
networkProtocolError Identifies HTTP/2 or HTTP/3 protocol-level failures No
notCached Informational only. code doesn't help the user or support take any action No
nssFailure2 Helps support identify NSS library failures No
proxyConnectFailure Useful for proxy configuration diagnosis No, because error page already has proxy-specific language
vpnFailure Useful for IT support troubleshooting VPN connectivity No, because error page already has VPN-specific language
proxyResolveFailure Distinguishes proxy DNS failures from proxy connection failures No
redirectLoop Helps users report the specific condition to site owners No
sslv3Used Identifies the specific obsolete protocol. useful for tech support No
unknownProtocolFound Identifies unrecognised URI scheme issues No
unknownSocketType Useful for tech support diagnosing misconfigured socket types No
unsafeContentType Identifies a MIME-type safety issue. useful for web devs No
cspBlocked Useful for web devs debugging CSP configurations No
xfoBlocked Useful for web devs debugging X-Frame-Options configurations No
Severity: -- → S2
Priority: -- → P2

Catalog of errors to update, how to reproduce them, and screenshots of each page before/after:
https://docs.google.com/document/d/1J3i8-qtXiYlXDuIXf-RoUMBr6fPXChG6rWxJGWgcuCo/edit?usp=sharing

Run an old version of Firefox, such as mach mozregression --launch 2025-11-01, to check old pages.

Attachment #9569515 - Attachment description: WIP: Bug 2027209 - Show error code on customNetError pages → Bug 2027209 - Show error code on customNetError pages - r=niklas
Attached image content-encoding.png β€”

I was just about to open a bug about contentEncodingError, but saw that it is getting at least partly addressed in this bug, so adding information here:

Like HTTP error that were updated in Bug 2023800, the error contentEncodingError happens after establishing the connection to the server. It is also somewhat later due to being an error about the HTTP body, not HTTP headers. We should both:

  1. Show the HTTP status code if it is an error (similar to Bug 2023800) and
  2. Replace the phrase "can’t connect to the server at" with something that describes the situation more correctly.

I'm attach a screenshot of how it looks like now/before. Sorry, I'm unable to share the website, because it is a private one. And I haven't found a good test website / haven't setup one yet.

I see that (2) is currently getting addressed here. However, I was wondering whether (1) could get addressed here too, or whether I should open a separate bug for that. This might be true for other errors too.

@manuel, can you please open a new bug for the status code? Since that might affect other errors, I don't want to slow down the momentum here while we research each code to update. I want to get the changes in this bug in for 151 and the window for string changes closes today.

Attachment #9570845 - Attachment is obsolete: true
Pushed by jbrown@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8a540e7c99aa https://hg.mozilla.org/integration/autoland/rev/267da15baa9d Update invalidHeaderValue and contentEncodingError Felt Privacy error page content - r=fluent-reviewers,bolsson,mkaply
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch

Reopening as we have two more patches we want to land for this work. We just landed the strings in advance.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → ASSIGNED
Whiteboard: [keep-open]
No longer blocks: 2032997
See Also: → 2032997
Attachment #9570830 - Attachment is obsolete: true
Pushed by jbrown@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/614d04d43008 https://hg.mozilla.org/integration/autoland/rev/c90127341954 Update netInterrupt Felt Privacy error page content - r=rking,desktop-theme-reviewers,sfoster
Pushed by jbrown@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1c1b301235b6 https://hg.mozilla.org/integration/autoland/rev/5a3498e16523 Update connectionFailure and netTimeout Felt Privacy error page content - r=rking
Whiteboard: [keep-open]

Affected errors:

NS_ERROR_OFFLINE
NS_ERROR_DOM_COOP_FAILED (blockedByCOOP)
NS_ERROR_DOM_COEP_FAILED (blockedByCOEP)
NS_ERROR_NET_EMPTY_RESPONSE (netReset)

Original Revision: https://phabricator.services.mozilla.com/D294024

Attachment #9574702 - Flags: approval-mozilla-beta?
Attachment #9574703 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: The Felt Privacy error page redesign shipped with terse or missing error messages/codes for several common network failures (connectionFailure, netTimeout, netInterrupt). Users and support staff rely on these codes to diagnose issues. Declining means Firefox 151 users see less informative error pages.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Changes are confined to the error page rendering path. Normal browsing is completely unaffected. Automated tests cover each affected error type.
  • String changes made/needed?: N/A
  • Is Android affected?: no
Attachment #9574704 - Flags: approval-mozilla-beta?
Target Milestone: 151 Branch → 152 Branch
Status: ASSIGNED → RESOLVED
Closed: 3 months ago3 months ago
Resolution: --- → FIXED
Attachment #9574704 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9574703 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9574702 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: