DevTools in DevEdition crashed unexpectedly
Categories
(DevTools :: Netmonitor, defect, P3)
Tracking
(firefox91 fixed)
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: alex_mayorga, Assigned: claubatista)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug)
User Story
See comment #6 for all details
Attachments
(2 files)
TypeError: can't access property "value", requestHeaders.headers.find(...) is undefined
in TreeView
in div
in div
in PropertiesView
in VisibilityHandler
in Unknown
in Connect(Component)
in bound createElement
in div
in li
in ul
in Accordion
in div
in div
in HeadersPanel
in VisibilityHandler
in Unknown
in Connect(Component)
in div
in Panel
in div
in div
in div
in Tabs
in Sidebar
in div
in Tabbar
in TabboxPanel
in div
in NetworkDetailsBar
in VisibilityHandler
in Unknown
in Connect(Component)
in div
in div
in SplitBox
in div
in MonitorPanel
in VisibilityHandler
in Unknown
in Connect(Component)
in div
in DropHarHandler
in AppErrorBoundary
in div
in App
in VisibilityHandler
in Unknown
in Connect(Component)
in Provider
Reporter | ||
Comment 1•2 years ago
|
||
The Network panel has crashed.
File Bug Report
TypeError: can't access property "value", requestHeaders.headers.find(...) is undefined
React Component Stack
componentStack
in TreeView
in div
in div
in PropertiesView
in VisibilityHandler
in Unknown
in Connect(Component)
in bound createElement
in div
in li
in ul
in Accordion
in div
in div
in HeadersPanel
in VisibilityHandler
in Unknown
in Connect(Component)
in div
in Panel
in div
in div
in div
in Tabs
in Sidebar
in div
in Tabbar
in TabboxPanel
in div
in NetworkDetailsBar
in VisibilityHandler
in Unknown
in Connect(Component)
in div
in div
in SplitBox
in div
in MonitorPanel
in VisibilityHandler
in Unknown
in Connect(Component)
in div
in DropHarHandler
in AppErrorBoundary
in div
in App
in VisibilityHandler
in Unknown
in Connect(Component)
in Provider
Stacktrace
renderRow@resource://devtools/client/netmonitor/src/components/request-details/HeadersPanel.js:358:38
renderRows/<@resource://devtools/client/shared/components/tree/TreeView.js:683:19
renderRows@resource://devtools/client/shared/components/tree/TreeView.js:667:15
renderRows/<@resource://devtools/client/shared/components/tree/TreeView.js:687:34
renderRows@resource://devtools/client/shared/components/tree/TreeView.js:667:15
render@resource://devtools/client/shared/components/tree/TreeView.js:721:23
finishClassComponent@resource://devtools/client/shared/vendor/react-dom.js:10638:31
updateClassComponent@resource://devtools/client/shared/vendor/react-dom.js:10601:44
beginWork@resource://devtools/client/shared/vendor/react-dom.js:11419:16
performUnitOfWork@resource://devtools/client/shared/vendor/react-dom.js:14702:12
workLoop@resource://devtools/client/shared/vendor/react-dom.js:14720:24
renderRoot@resource://devtools/client/shared/vendor/react-dom.js:14803:15
performWorkOnRoot@resource://devtools/client/shared/vendor/react-dom.js:15655:17
performWork@resource://devtools/client/shared/vendor/react-dom.js:15567:24
flushInteractiveUpdates$1@resource://devtools/client/shared/vendor/react-dom.js:15816:16
batchedUpdates@resource://devtools/client/shared/vendor/react-dom.js:1894:7
dispatchEvent@resource://devtools/client/shared/vendor/react-dom.js:4351:19
interactiveUpdates$1/<@resource://devtools/client/shared/vendor/react-dom.js:15803:14
unstable_runWithPriority@resource://devtools/client/shared/vendor/react.js:617:12
interactiveUpdates$1@resource://devtools/client/shared/vendor/react-dom.js:15802:12
interactiveUpdates@resource://devtools/client/shared/vendor/react-dom.js:1901:10
dispatchInteractiveEvent@resource://devtools/client/shared/vendor/react-dom.js:4328:21
Close and reopen the toolbox to clear this error.
Reporter | ||
Comment 2•2 years ago
|
||
Error while processing HAR file: can't access property "pageTimings", pages.get(...) is undefined
Reporter | ||
Comment 3•2 years ago
|
||
This is triggered when trying to see the raw headers of one requests in a HAR file.
I don't believe I can share the HAR file publicly unfortunately.
Comment 4•2 years ago
|
||
Thanks for the report!
The stack trace (comment #0, comment #1) points to this line:
https://searchfox.org/mozilla-central/rev/2bc4e5cdf669cc9de3ed98e38be3e50a27b25332/devtools/client/netmonitor/src/components/request-details/HeadersPanel.js#358
It looks like there is no "Host" request header (the array of request headers could be empty from some reason)
The comment #2 is generated when HAR file is being parsed:
https://searchfox.org/mozilla-central/rev/2bc4e5cdf669cc9de3ed98e38be3e50a27b25332/devtools/client/netmonitor/src/har/har-menu-utils.js#79
I guess the HAR is wrongly generated since the state of the Network panel is wrong (consequence of the bug above)
Any chance to get a test case we could use to see the problem on our machines?
Honza
Reporter | ||
Comment 5•2 years ago
|
||
¡Hola Jan!
I've sent you a test case via e-mail.
¡Gracias!
Alex
Comment 6•2 years ago
|
||
Thank you for the HAR file Alex. I was able to reproduce the bug on my machine.
I am attaching my own HAR file to make it possible to reproduce the bug for others.
I am marking this as good first bug and here are some information about how to fix it.
STR:
- Open DevTools Toolbox and select the Network panel
- Remove all requests in the panel and drop the attached HAR File
- Select the only request in the panel
- Go to the Headers panel and show "Raw" headers for Request headers
- The pane should crash
Note that there is also an error in the Console panel saying:
Error while processing HAR file: can't access property "pageTimings", pages.get(...) is undefined
Both problems should be fixed in this bug
#1) Raw headers
The problem is that "Host" request header isn't in the HAR file
There are two places in the code where we are expecting the "Host" header to exist
We need to return empty "" result from the getHeadersTitle
if Host isn't available
We need to replace the host name by <unknown>
and generate e.g. this string for the raw headers text area GET <unknown> HTTP/1.1
string
#2) Page Timings
The problem is that pages
array in the HAR file doesn't contain specific page_id
used by an entry (request) in the HAR file
The related code:
https://searchfox.org/mozilla-central/rev/5359952d8b0be3e706e8c943c2bef2674723b8a9/devtools/client/netmonitor/src/har/har-importer.js#136-138
pageTimings
might be undefined and so, we need to secure such case and avoid NPE.
Doing something as follows should help:
const pageTimings = pages.get(entry.pageref)?.pageTimings;
let onContentLoad = pageTimings && pageTimings.onContentLoad || 0;
let onLoad = pageTimings && pageTimings.onLoad || 0;
Honza
Updated•2 years ago
|
Updated•2 years ago
|
Updated•2 years ago
|
Assignee | ||
Comment 7•2 years ago
|
||
Hi [:Honza], I'd like to work on this bug. :)
I was able to reproduce the crash.
Updated•2 years ago
|
Assignee | ||
Comment 9•2 years ago
|
||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
Pushed by jodvarko@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/45bd7bb1b10b [devtools] Do not crash when the Host Header is not there. r=Honza
Comment 11•2 years ago
|
||
bugherder |
Description
•