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

OtlpExporter fails with unhandled exception when Google.Protobuf 3.15.6 is referenced by the host #1950

Closed
pcwiese opened this issue Mar 31, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@pcwiese
Copy link
Contributor

pcwiese commented Mar 31, 2021

Bug Report

OtlpExporter fails with unhandled exception when Google.Protobuf 3.15.6 is referenced by the host

Packages and Runtime

OpenTelemetry 1.0.1 packages (including the Otlp exporter)
Runtime is netcoreapp3.1

Symptom

As soon as the exporter attempts to send a batch we are seeing an exception with the following stack trace:

System.TypeInitializationException
  HResult=0x80131534
  Message=The type initializer for 'OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions' threw an exception.
  Source=OpenTelemetry.Exporter.OpenTelemetryProtocol
  StackTrace:
   at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions.ToOtlpSpan(Activity activity) in /_/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs:line 142
   at OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions.AddBatch(ExportTraceServiceRequest request, Resource processResource, Batch`1& activityBatch) in /_/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/ActivityExtensions.cs:line 48
   at OpenTelemetry.Exporter.OtlpTraceExporter.Export(Batch`1& activityBatch) in /_/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpTraceExporter.cs:line 118
   at OpenTelemetry.BatchExportProcessor`1.ExporterProc() in /_/src/OpenTelemetry/BatchExportProcessor.cs:line 222
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state) in /_/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 50
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/System.Private.CoreLib/shared/System/Threading/ExecutionContext.cs:line 172
--- End of stack trace from previous location ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in /_/src/System.Private.CoreLib/shared/System/Runtime/ExceptionServices/ExceptionDispatchInfo.cs:line 63
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) in /_/src/System.Private.CoreLib/shared/System/Threading/ExecutionContext.cs:line 200
   at System.Threading.ThreadHelper.ThreadStart() in /_/src/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs:line 100

  This exception was originally thrown at this call stack:
    System.Reflection.Emit.DynamicILGenerator.Emit(System.Reflection.Emit.OpCode, System.Reflection.ConstructorInfo) in DynamicILGenerator.cs
    OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions.CreateByteStringCtorFunc() in ActivityExtensions.cs
    OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation.ActivityExtensions.ActivityExtensions() in ActivityExtensions.cs

Inner Exception 1:
ArgumentNullException: Value cannot be null. (Parameter 'con')

What is the expected behavior?
The version of Google.Protobuf is not supposed to be a breaking version change, however it might be. If it is a breaking change, we might need to restrict the version range of this package

What is the actual behavior?
See symptom

Reproduce

Just launch any of the sample applications in this repo that use the OtlpExporter and ensure that the host .csproj is pulling in v 3.15.6 of the Google.Protobuf package.

We will close this issue if:

  • The repro project you share with us is complex. We can't investigate custom
    projects, so don't point us to such, please.
  • If we can not reproduce the behavior you're reporting.

Additional Context

Add any other context about the problem here.

@pcwiese pcwiese added the bug Something isn't working label Mar 31, 2021
@cijothomas
Copy link
Member

#1854 Duplicate? Fix is in PR.

@pcwiese
Copy link
Contributor Author

pcwiese commented Apr 1, 2021

Yes this appears to be a dup

@pcwiese pcwiese closed this as completed Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants