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

System.NullReferenceException Microsoft.AspNetCore.Routing.Matching.DfaMatcher.<SelectEndpointWithPoliciesAsync> (Intermittent Issue) #1263

Open
shama-ak opened this issue Jun 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working investigating

Comments

@shama-ak
Copy link

Describe the bug
There is an intermittent System.NullReferenceException. The exception occurs in the SelectEndpointWithPoliciesAsync method. There are no specific steps to reproduce the issue, but telemetry data has shown the occurrence of this exception.

Expected behavior
The method should execute without throwing a NullReferenceException.

Stack Trace
ODataExceptionHandlerMiddleware: Unexpected error Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.AspNetCore.Routing.Matching.DfaMatcher.d__13.MoveNext() +0xcc
at Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware.<g__AwaitMatch|10_1>d.MoveNext() +0x65
at Microsoft.AspNet.OData.Batch.ODataBatchMiddleware.d__2.MoveNext() +0x15f

@shama-ak shama-ak added the bug Something isn't working label Jun 17, 2024
@habbes
Copy link
Contributor

habbes commented Jun 18, 2024

Given that it's an intermittent error, it could be a race condition in the batch handler or shared state that's getting mutated in different threads. Do you have any information about the kind of requests where you observed this behaviour?

@habbes habbes self-assigned this Jun 18, 2024
@shama-ak
Copy link
Author

Our telemetry shows these 6 requests being processed within same timeframe:

TIMESTAMP Request HttpStatus
2024-06-11 15:56:08.1761397 https://foo.com/api/data/v9.0/accounts(GUID_Value)/new_acc_con0611241/$ref 204 No Content
2024-06-11 15:56:08.2972903 https://foo.com/api/data/v9.0/accounts 204 No Content
2024-06-11 15:56:08.3907339 https://foo.com/api/data/v9.0/accounts(GUID_Value) 200 OK
2024-06-11 15:56:08.5140539 https://foo.com/api/data/v9.0/accounts 204 No Content
2024-06-11 15:56:08.5376303 https://foo.com/api/data/v9.0/accounts?$filter=length(name) eq 19 501 Not Implemented
2024-06-11 15:56:08.5643568 https://foo.com/api/data/v9.0/accounts?$filter=trim(name) eq 'firstname lastname' 500 Internal Server Error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigating
Projects
None yet
Development

No branches or pull requests

2 participants