capture user-agent and put it in metadata
Categories
(Socorro :: Antenna, task, P2)
Tracking
(Not tracked)
People
(Reporter: willkg, Assigned: bdanforth)
References
Details
Attachments
(1 external file)
The crash reporters do specify a user-agent HTTP header in the HTTP POST request when submitting crash reports.
The collector breakpad_resource.py should capture the user-agent header and stick it in the metadata section of the raw crash that it saves.
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 1•2 years ago
|
||
| Assignee | ||
Comment 2•2 years ago
|
||
| Assignee | ||
Comment 3•2 years ago
•
|
||
After some trials[1], I verified this in stage using socorro-cmd fetch_crash_data using this crash id: 7aa874bf-61c2-4f12-9292-359650240418.
At first, I was surprised to see that it has a metadata.user_agent of "python-requests/2.31.0" rather than "crashreporter/1.0.0" as expected, given it's a Nightly (127.0a1) crash in the parent process[2], but then I remembered that this is stage, so the socorro-submitter sends some percentage of prod crashes to stage, and perhaps the user agent gets overwritten through that process?
Edit: Yes it looks like socorro-submitter removes metadata among other attributes from the crash as part of the resubmission process. So I guess I wouldn't see a user_agent with the "crashreporter/1.0.0" value until I'm looking at prod data.
[1]: It turns out, I didn't need the part that was failing (stackwalker) to verify my patch, but in general, not being able to run the socorro stack locally is problematic.
[2]: Only parent process crashes in Firefox use the crash reporter to submit the crash.
| Reporter | ||
Comment 4•2 years ago
|
||
If we want the user-agent correctly passed to the stage environment in crash reports, we would need to update the socorro-submitter to re-use the user agent from metadata if it exists.
For debugging any collector-based metadata things, you can see it in two places in the Crash Stats site.
-
You can see it in the Debug tab of the crash report:
https://crash-stats.allizom.org/report/index/58bf30c5-9f2c-4913-a4af-7338b0240422#tab-debug
-
You can go to the poorly named Raw Data and Minidumps tab and click on "crash annotations" which is the entire raw crash with the crash annotations and any collector-added data including the metadata section:
https://crash-stats.allizom.org/report/index/58bf30c5-9f2c-4913-a4af-7338b0240422#tab-rawdump
Downloading the raw crash with one of our tools works, too. I sometimes use that method if I'm verifying data in a bunch of crash reports.
| Assignee | ||
Comment 5•2 years ago
|
||
This was deployed in bug #1892791 tag 2024.04.22.
| Assignee | ||
Comment 6•2 years ago
|
||
I can see user_agent for recently submitted crash reports in production. However, when looking at a recent Nightly crash in the parent process on Ubuntu (where I expect the new crash reporter to be submitting the report), the user_agent is Mozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0 and not "crashreporter/1.0.0" based on this comment... gsvelto: Am I missing something about when this is the case? I do see that SubmittedFrom is "Auto", rather than "Client".
| Assignee | ||
Comment 7•2 years ago
|
||
Since I have verified that the user_agent is showing up in crash_report.metadata in prod, I'm going to mark this bug as resolved. If there's any follow up work from gsvelto's NI, that will be a separate bug.
Comment 8•2 years ago
|
||
(In reply to Bianca Danforth [:bdanforth] from comment #6)
I can see
user_agentfor recently submitted crash reports in production. However, when looking at a recent Nightly crash in the parent process on Ubuntu (where I expect the new crash reporter to be submitting the report), theuser_agentisMozilla/5.0 (X11; Linux x86_64; rv:127.0) Gecko/20100101 Firefox/127.0and not"crashreporter/1.0.0"based on this comment... gsvelto: Am I missing something about when this is the case? I do see thatSubmittedFromis"Auto", rather than"Client".
The crash reporter client submission will always have SubmittedFrom set to "Client", all other submissions ("Auto", "Infobar", "AboutCrashes" or "CrashedTab") come directly from Firefox, so the user agent will be Firefox in those cases.
| Assignee | ||
Comment 9•2 years ago
|
||
Thanks! I followed up with the folks in the #crashreporting channel on Matrix for some extra clarification here -- I had wrongly assumed that Process Type: parent was sufficient to conclude that a crash report was submitted by the crash reporter. First, main and parent process mean the same thing here (referring to the main Firefox process crashing). Second, there are multiple ways that Firefox could submit a parent process crash report, including:
- Firefox can prompt users to submit unsubmitted crash reports
- A user can submit them unprompted via
about:crashes
This explains why I was seeing a Firefoxuser-agentfor a parent process crash.
Description
•