question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid TraceId field in the ProblemDetails response

See original GitHub issue

Hi!

I’m using ASP.NET Core 3.0 with the last version of Hellang.Middleware.ProblemDetails (3.1.0). In my Startup.ConfigureServices method I have added the following line:

services.AddProblemDetails();

And the corresponding

app.UseProblemDetails();

At the beginning of the Configure method.

With this setup, I have noticed that the output is something like this:

{
  "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
  "title": "Bad Request",
  "status": 400,
  "traceId": "|ce3cd73b-4af1db1e8a67d40f."
}

In particular, you can note that the traceId field seems to be invalid. Can you please investigate on this behavior?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
khellangcommented, Oct 3, 2019
0reactions
khellangcommented, Oct 3, 2019

It depends on where your request is coming from and whether it includes a Request-Id or a Correlation-Context header, I think.

Activity also supports different formats, where “hierarchical” is the default. See https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HierarchicalRequestId.md.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How I can adjust which fields I will have in the response ...
Now validation response looks like: { "status": 400, "errors": { "name": [ "The Name field is required." ] } } No traceId ,...
Read more >
How I can adjust which fields I will have in the response ...
Hi, I have the following response when there is a validation ... How to remove for each response the fields: type , title...
Read more >
Beware of potential XSS injections when using ...
The default behaviour of ProblemDetails in ASP.NET Core does not escape the user input, this can lead to XSS injections.
Read more >
Problem Details for Better REST HTTP API Errors
Do you wish there was a standard way to return errors from a REST HTTP API? There is, it's called Problem Details. Here's...
Read more >
Problem Details responses everywhere with ASP.NET ...
It was possible to return the Problem Details response manually, or the framework could generate it automatically in several specific cases.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found