Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multipart/form-data submissions on native crashes in Linux #278

Conversation

implausible
Copy link

Fixes #200. I think what was not mentioned in the issue is that currently Sentry does not handle these submissions at all, and so native crash reports on Linux are currently being labeled as corrupted submissions in Sentry. We need this solved ASAP so that we can adopt the product.

This adds the ability to detect whether a crash report is a multipart/form-data submission body and to switch minidump upload behavior to accommodate that on Linux. I have the multipart/form-data being sent to the /api/{projectId}/minidump route instead of the /api/{projectId}/envelope route, as when I tried uploading the minidump with the sentry event attached to it, sentry's servers returned a 400 status code, causing the system to throw. If it was intended to allow the envelope route to accept the multipart/form-data submission, it might need to be fixed server side to return a 200 OK in response.

I have adjusted the multipart/form-data submission to include the event payload under the name sentry as suggested in the issue. From testing against sentry, I can confirm that this produces the desired behavior where the full sentry event and minidump attachment are properly received on sentry.

Due to the changes introduced here, I went ahead and adjusted the test server to accept minidump multipart/form-data submissions. I also reenabled all tests as well as addressed the blocking issues from running tests on 10 and up. I was able to reproduce the issues that caused the team to disable specs on 9.0.5. I traced the failure to this issue electron/electron#24788. This was addressed in 9.2.0. I would advise that for anyone affected by that issue, the team suggests to the affected user to move their Electron target.

Please let me know if there is anything I can do to speed up the process of getting this merged / released. My team is looking to adopt Sentry for crash reporting and need this solved.

@implausible
Copy link
Author

I've disabled testing on Electron < 4 due to some stability issues that exist in the windows e2e tests. While it's not really my decision what your minimum support is, Electron has a much smaller support target than it maintained in the past, with versions < 9 no longer being supported by the team.

@timfish
Copy link
Collaborator

timfish commented Dec 8, 2020

I was doing some Electron v11 testing locally today and saw the same test onFatalError test failure on macOS too.

3.1.13 has multiple test issues, it's unlikely that support needs to be maintained for any of these versions. Especially now that everything < 9 is deprecated and no longer receiving support.
@implausible implausible force-pushed the fix/correctly-send-linux-stack-traces branch from 7ffec5c to 7184c98 Compare December 16, 2020 18:02
@implausible
Copy link
Author

I was doing some Electron v11 testing locally today and saw the same test onFatalError test failure on macOS too.

I am not sure that this is a fault of this branch though. From an improvement perspective, I believe this branch covers a condition that the sentry electron sdk currently does not support without introducing regressions. Are there any changes you would like me to make? I'd love to see this merged and released, so that I can stop relying on a fork for sentry support in Electron 10.

test/e2e/index.test.ts Outdated Show resolved Hide resolved
@timfish
Copy link
Collaborator

timfish commented Dec 18, 2020

The preload tests are failing due to this erroneous line which I think was left on master by mistake. I've removed it in my recent un-merged PRs and it fixes the failures.

@implausible implausible force-pushed the fix/correctly-send-linux-stack-traces branch from 13b09cc to 97b3689 Compare December 18, 2020 17:25
@timfish
Copy link
Collaborator

timfish commented Feb 3, 2021

@implausible if you can rebase this to master I can get it merged!

@implausible
Copy link
Author

I will get to this today

@timfish
Copy link
Collaborator

timfish commented Feb 4, 2021

I managed to do the merge via GitHub web UI. Just looking into tests...

@implausible
Copy link
Author

I managed to do the merge via GitHub web UI. Just looking into tests...

Oh, awesome!

@timfish
Copy link
Collaborator

timfish commented Feb 16, 2021

@implausible it looks like there are many failing tests for minidumps.

Some debugging shows that the envelope body is not parsed correctly by the test server and this looks to be caused by the changes to net.ts passing the content type.

@timfish
Copy link
Collaborator

timfish commented Jun 16, 2021

Closing in favour of #343 but thank you for your efforts!

@timfish timfish closed this Jun 16, 2021
@implausible implausible deleted the fix/correctly-send-linux-stack-traces branch June 16, 2021 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minidumps on Linux are Multipart Bodies
2 participants