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

Possible null reference issue 1.1.32 #466

Open
krselvaer opened this issue Sep 4, 2024 · 4 comments
Open

Possible null reference issue 1.1.32 #466

krselvaer opened this issue Sep 4, 2024 · 4 comments
Labels
Investigating We are looking into this issue at this time.

Comments

@krselvaer
Copy link

krselvaer commented Sep 4, 2024

Hi,

We recently tried to upgrade our Dataverse package quite a few "notches" from 1.0.26 to the latest release 1.1.32. After this upgrade we saw an irregular amount of NullReferenceExceptions. We were unable to figure out a consistency for when this error occurred in terms of reproducing it etc. We eventually downgraded again and our problems disappeared. We haven't looked too much into this issue. But I figured I'd report it in case it is an issue with the newest release that is not specific to us.

Let me know if you need more details :)

Part of the Stack trace:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Microsoft.PowerPlatform.Dataverse.Client.ServiceClient.Execute(OrganizationRequest request)
   at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request)
   at Microsoft.Xrm.Sdk.Linq.QueryProvider.RetrieveEntityCollection(OrganizationRequest request, NavigationSource source)
   at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List1 linkLookups, String& pagingCookie, Boolean& moreRecords)
   at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List1 linkLookups)
   at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](Expression expression)
   at Microsoft.Xrm.Sdk.Linq.QueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
@krselvaer krselvaer changed the title Possible null refrence issue Possible null refrence issue 1.1.32 Sep 4, 2024
@MattB-msft
Copy link
Member

Given the error your seeing it looks like this is coming up out of the Linq provider included in the most recent release.
can you provide a sample / repro we can use to debug this?

@krselvaer
Copy link
Author

Hi again :)

I have tried to do some more digging and these seem to be the steps we do to create this error, I have only been able to recreate it for system users and it isn't every run where the error happens. The process we do is:

  1. Create a SingleOrDefault for the SystemUserSet
  2. Our Queryable looks like crmContext.SystemUserSet.SingleOrDefault(x => x.Id == Guid.Parse(key))
  3. Creates a query for SystemUser
  4. As far as I can tell this looks fine in ServiceClient up until Command_Execute(...)
  5. Here it looks like DataverseService is null (sometimes the request was also suddenly null here). But this is obviously deconstructed from the Nuget package etc. So I'm not confident in the details at this point. Especially as I could see that this service wasn't null just before?

I will note that it looks like we do two identical async calls about the same time for two different system users (or sometimes the same). The way this is handled from our side looks a bit weird.

Some more details:
Example

The criteria for this screenshot is Equals systemuserid with a Guid.

This is how we instantiate the ServiceClient: new ServiceClient(connectionString, clientId, clientSecret, false);

@MattB-msft
Copy link
Member

Thanks.. this helps... we will see if we can run it down.

@MattB-msft MattB-msft added the Investigating We are looking into this issue at this time. label Oct 24, 2024
@krselvaer
Copy link
Author

Hi,

I was wondering if there was any update on this issue? Or if there is an estimate for when this will be looked at? :)

@krselvaer krselvaer changed the title Possible null refrence issue 1.1.32 Possible null reference issue 1.1.32 Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigating We are looking into this issue at this time.
Projects
None yet
Development

No branches or pull requests

2 participants