-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Sentry. Serilog. Envelopes which are constructed from"Serilog style" log messages cause 400 response from server #1523
Comments
I updated libs to: |
@vlaterz - We think this might be a bug. We're looking into it and will get back to you. Thanks! |
@vlaterz after taking a close look at this, i am having trouble reproducing it. Can you capture the full "Failed envelope" text and share it? perhaps by piping the console output to a text file. What Os+version are you using? What .net runtime are you targetting? here is my code that i used to repro
can you try the above and see if it works for you |
can you upload the raw file from you cache directory |
@bruno-garcia @mattjohnsonpint i need some help on this one. I am not able to reproduce, and cannot see any difference in the above attached envelope file that should be causing problems. |
@bruno-garcia @mattjohnsonpint seems that message is coming from the relay https://github.com/getsentry/relay/blob/master/relay-server/src/envelope.rs#L61 |
@vlaterz - can you please see if you can recreate this on sentry.io? |
In self hosted older 20.06 this 400 status code is expected, because it doesn't have |
@bruno-garcia @mattjohnsonpint What does that mean, "testing against sentry.io"? |
@vlaterz from your information above, it looks like you are using sentry in SAAS mode. So to work out if this is a problem specific to SASS, or is reproducible in the cloud hosting mode, we want you to try using the cloud model. See the getting started guide |
@SimonCropp I tested once again, also using cloud sentry. I think i figured it out. It looks like the 400 error was because of DateTime.Now, which was sent like that:
I tested sending messages with this method:
So, in Console with Sentry Debug on: The second message: The last two are successes: The problem is that i missed "ToString()" in DateTime.Now.
|
UPD: Error happens when you send DateTime with DateTimeKind.Local. |
I've figured this out, and since it's not related specifically to Serilog, I've opened a new issue. Please follow #1956 for updates. Closing this one. Thanks. |
Environment
How do you use Sentry?
Sentry SaaS
Which SDK and version?
.NET 5, Sentry.Serilog 3.14.1, Sentry sdk 3.13.0
Steps to Reproduce
I use Serilog with Sentry to write real time logs with caching (if connection is lost).
Full error: Error: Sentry rejected the envelope afc2b865ade74406bf7aa914c5095a95. Status code: BadRequest. Error detail: invalid event envelope. Error causes: missing newline after header or payload.
At the same time Sentry Debug says Debug: Successfully sent cached envelope: afc2b865ade74406bf7aa914c5095a95.
I tested sending simple strings as messages and envelopes were successfully received by server.
Like that:
Expected Result
Envelopes which are constructed from "Serilog style" logging messages are successfully sent to server
Actual Result
The text was updated successfully, but these errors were encountered: