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

Unable to use readnextasync on feediterator in Version 3.45.2, getting error: unable to load assembly system.diagnostics.diagnosticsource 8.0.0.0 #4903

Open
Chays21 opened this issue Nov 23, 2024 · 5 comments
Labels
customer-reported Issue created by a customer needs-investigation

Comments

@Chays21
Copy link

Chays21 commented Nov 23, 2024

We are continuously addressing and improving the SDK, if possible, make sure the problem persist in the 3.45.2.

Describe the bug
FeedIterator.ReadNextAsync method throws System.IO.IO for System.Diagnostics.DiagnosticSource 8.0.0.0. however I did not face this issue with older version 3.40.0.

To Reproduce
Create a function app project that runs in process functions, targeting framework net 6.0. Install Microsoft.Azure.Cosmos 3.45.2. Create a Cosmos Client and container. try with the below code.
Image

Expected behavior
ReadNextAsync should not throw this exception

Actual behavior
FeedIterator.ReadNextAsync method throws System.IO.IO for System.Diagnostics.DiagnosticSource 8.0.0.0

Environment summary
SDK Version: Microsoft.NET.SDK.Functions 4.2.0
OS Version (e.g. Windows, Linux, MacOSX) : Windows

Additional context
Add any other context about the problem here (for example, complete stack traces or logs).

Package references in my project:

Image

Exception details:

Image

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issue created by a customer label Nov 23, 2024
@Chays21 Chays21 changed the title Unable to user readnextasync on feediterator in Version 3.45.2, unable to load assembly system.diagnostics.diagnosticsource 8.0.0.0 Unable to use readnextasync on feediterator in Version 3.45.2, unable to load assembly system.diagnostics.diagnosticsource 8.0.0.0 Nov 23, 2024
@Chays21 Chays21 changed the title Unable to use readnextasync on feediterator in Version 3.45.2, unable to load assembly system.diagnostics.diagnosticsource 8.0.0.0 Unable to use readnextasync on feediterator in Version 3.45.2, getting error: unable to load assembly system.diagnostics.diagnosticsource 8.0.0.0 Nov 23, 2024
@Pilchie
Copy link
Member

Pilchie commented Nov 25, 2024

Can you include the rest of ex.Message and ex.StackTrace?

@sourabh1007
Copy link
Contributor

I am not sure why you are getting error for 8.0.0 version but for your information, In SDK 3.45.0, We upgraded to System.Diagnostics.DiagnosticSource 8.0.1 version.

Can you please make sure, DiagnosticSource library is getting loaded correctly with cosmosdb SDK

@threedot14
Copy link

threedot14 commented Dec 11, 2024

We are experiencing practically the same problem. (Our failure is on an UpsertAsync. not ReadNextAsync.)
The Full error message for us

Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)

We tested the recent release versions one by one, and all else being equal:

  • 3.40.0 (confirmed by OP), 3.43.0. 3.44.0, and 3.44.1 work. We have locked in the version at 3.44.1 as a workaround for now.
  • 3.45.0, 3.45.2, 3.46.0 do not work

I submit that it is not the user's responsibility to provide the correct version of DiagnosticsSource to Cosmos sdk, because our programs do not have a direct dependency to DiagnosticsSource. There is some problem when 3.45.0 was released, that introduced the dependency issue, because 3.44.1 works for us all else being equal.

@Pilchie
Copy link
Member

Pilchie commented Dec 11, 2024

Can you include the callstack of the exception so that we can see what is trying to load the 8.0.0.0 version?

@supereddie
Copy link

We run into the same issue. Callstack:

System.IO.FileNotFoundException:
   at Microsoft.Azure.Cosmos.Telemetry.OpenTelemetryRecorderFactory.CreateRecorder (Microsoft.Azure.Cosmos.Client, Version=3.46.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at Microsoft.Azure.Cosmos.ClientContextCore+<RunWithDiagnosticsHelperAsync>d__40`1.MoveNext (Microsoft.Azure.Cosmos.Client, Version=3.46.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.Azure.Cosmos.ClientContextCore+<OperationHelperWithRootTraceAsync>d__30`1.MoveNext (Microsoft.Azure.Cosmos.Client, Version=3.46.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at *my code*
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at *my code*
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at *my code*
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at *my code*
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at *my code*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issue created by a customer needs-investigation
Projects
None yet
Development

No branches or pull requests

5 participants