Open Bug 1924879 Opened 2 years ago Updated 1 year ago

Attempting to load a HAR file causes a crash in network panel

Categories

(DevTools :: Netmonitor, defect, P3)

Firefox 132
defect

Tracking

(Not tracked)

People

(Reporter: me, Unassigned)

Details

Error:
TypeError: a.name.toLowerCase is not a function

React Component Stack:
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:
HeaderList/<@resource://devtools/client/netmonitor/src/utils/headers-provider.js:77:19
HeaderList@resource://devtools/client/netmonitor/src/utils/headers-provider.js:76:16
getProperties@resource://devtools/client/netmonitor/src/components/request-details/HeadersPanel.js:244:22
render@resource://devtools/client/netmonitor/src/components/request-details/HeadersPanel.js:603:24
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
performSyncWork@resource://devtools/client/shared/vendor/react-dom.js:15541:14
interactiveUpdates$1@resource://devtools/client/shared/vendor/react-dom.js:15808:7
interactiveUpdates@resource://devtools/client/shared/vendor/react-dom.js:1901:10
dispatchInteractiveEvent@resource://devtools/client/shared/vendor/react-dom.js:4328:21

I'm not sure if this is a problem that other people have experienced, and I'm not sure I can share the HAR file as I think it may contain some application credentials. Still, Firefox (Developer Edition 132.0b6 (aarch64)) prompted me to file a report, so I did.

I'm running macOS Sonoma 14.7 (23H124), if that helps.

Thanks for filing, from the logs it seems like a header is missing a name, or the name has an unexpected value?

Where did you create the HAR file? Was it from Firefox DevTools or some other tool?

Flags: needinfo?(me)

(ni myself to try and modify a har file manually to trigger the error)

Flags: needinfo?(jdescottes)

Redirect a needinfo that is pending on an inactive user to the triage owner.
:Honza, since the bug doesn't have a severity set, could you please set the severity or close the bug?

For more information, please visit BugBot documentation.

Flags: needinfo?(me) → needinfo?(odvarko)

So I can indeed reproduce with a HAR file containing a header with no name, only a value.

Without having feedback from the reporter I'm not sure if the HAR came from DevTools and if we have something to fix there.
But overall it sounds like we should:

  • when exporting to HAR: skip incomplete headers (but I don't think this can happen!?)
  • when importing from HAR: skip incomplete headers (the HAR file might be corrupted/missing information)
  • on the frontend: avoid the crash by falling back to a default string? (although again, I don't think we should run into this normally)

I think we should do the minimum here, ie skip during import.

Flags: needinfo?(odvarko)
Flags: needinfo?(jdescottes)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Severity: -- → S3
Priority: -- → P3

(In reply to Julian Descottes [:jdescottes] from comment #2)

Thanks for filing, from the logs it seems like a header is missing a name, or the name has an unexpected value?

Where did you create the HAR file? Was it from Firefox DevTools or some other tool?

Hello all,

It was a HAR generated by a debug tool that my company put together in-house, so you needn't worry about DevTools creating invalid HAR files. DevTool's HAR exports work just fine for me.

I'm sorry for my lack of response. I forgot to respond when I saw this last. I did see the email notifications for the messages from a day ago, however.

No worries and thanks a lot for the feedback!

Can you tell us a bit more about your use case for generating HAR? Is this because you are generating a HAR outside of a browser and therefore can't use the existing devtools (chrome or firefox) to do so? Or is it because browser automation of HAR generation is not fitting your needs at the moment. For info we're trying to make that better via WebDriver BiDi, although we are currently missing response bodies. See github.com/firefox-devtools/bidi-har-export

Re-adding a needinfo for my question above :)

Flags: needinfo?(me)

Clear a needinfo that is pending on an inactive user.

Inactive users most likely will not respond; if the missing information is essential and cannot be collected another way, the bug maybe should be closed as INCOMPLETE.

For more information, please visit BugBot documentation.

Flags: needinfo?(me)
You need to log in before you can comment on or make changes to this bug.