Skip to content

Profiler fails with some S3 Errors #7364

@guynamedneil

Description

@guynamedneil

When trying to trace an endpoint, we had an error uploading an S3 file (permissions) and it caused the endpoint trace not to appear in datadog at all. Turning on the trace debugging, I found this in the logs:

025-08-07 14:08:28.275 -04:00 [ERR] Exception occurred when calling the CallTarget integration continuation. System.NullReferenceException: Object reference not set to an instance of an object.
   at AWSSDK_S3__885C28607F98E604.Amazon_S3_Model_PutObjectResponse.Datadog_Trace_ClrProfiler_AutoInstrumentation_AWS_S3_IS3EtagResponse_30.get_ETag()
   at Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.S3.ObjectManagement.PutObjectAsyncIntegration.OnAsyncMethodEnd[TTarget,TReturn](TTarget instance, TReturn returnValue, Exception exception, CallTargetState& state) in /_/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/S3/ObjectManagement/PutObjectAsyncIntegration.cs:line 54
   at PutObjectAsyncIntegration.OnAsyncMethodEnd.AmazonS3Client.PutObjectResponse(AmazonS3Client, PutObjectResponse, Exception, CallTargetState&)
   at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state)
 { MachineName: ".", Process: "[1209 Seeds.EntryPoin]", AppDomain: "[1 Seeds.EntryPoints.Api]", AssemblyLoadContext: "\"\" Datadog.Trace.ClrProfiler.Managed.Loader.ManagedProfilerAssemblyLoadContext #1", TracerVersion: "3.23.0.0" }

It looks like returnValue is a nullable object in the method signature below, but there's no guard against a null reference in the method itself, and that's what I seem to be running into.

https://github.com/DataDog/dd-trace-dotnet/blame/015d21801674f10d8d72c17276723ec9c322df69/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/S3/ObjectManagement/PutObjectAsyncIntegration.cs#L54

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions