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

Bug: Batch Processing breaks Tracing #630

Closed
CoreySchnedl opened this issue Aug 8, 2024 · 5 comments · Fixed by #632
Closed

Bug: Batch Processing breaks Tracing #630

CoreySchnedl opened this issue Aug 8, 2024 · 5 comments · Fixed by #632
Assignees
Labels
bug Unexpected, reproducible and unintended software behaviour

Comments

@CoreySchnedl
Copy link

CoreySchnedl commented Aug 8, 2024

Expected Behaviour

Tracing show show segments within x-ray when the batch processing utility is used.

I am unable to get Tracing to work (previously worked fine before converting to using the Batch Processing Powertools functionality).

Current Behaviour

Receiving this error on invocation:

{
  "errorType": "NullReferenceException",
  "errorMessage": "Object reference not set to an instance of an object.",
  "stackTrace": [
    "at System.Object.GetType()",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 693",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 836",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 828",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 836",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 767",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 767",
    "at Amazon.XRay.Recorder.Core.Internal.Emitters.JsonSegmentMarshaller.WriteEntityFields(Entity entity, JsonWriter writer) in /_/sdk/src/Core/Internal/Emitters/JsonSegmentMarshaller.cs:line 153",
    "at Amazon.XRay.Recorder.Core.Internal.Emitters.JsonSegmentMarshaller.EntityExporter(Entity entity, JsonWriter writer) in /_/sdk/src/Core/Internal/Emitters/JsonSegmentMarshaller.cs:line 65",
    "at ThirdParty.LitJson.JsonMapper.WriteValue(Object obj, JsonWriter writer, Boolean writer_is_private, Int32 depth) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 790",
    "at ThirdParty.LitJson.JsonMapper.ToJson(Object obj) in /_/sdk/src/Core/ThirdParty/LitJson/JsonMapper.cs:line 851",
    "at Amazon.XRay.Recorder.Core.Internal.Emitters.JsonSegmentMarshaller.Marshall(Entity segment) in /_/sdk/src/Core/Internal/Emitters/JsonSegmentMarshaller.cs:line 58",
    "at Amazon.XRay.Recorder.Core.Internal.Emitters.UdpSegmentEmitter.Send(Entity segment) in /_/sdk/src/Core/Internal/Emitters/UdpSegmentEmitter.cs:line 73",
    "at Amazon.XRay.Recorder.Core.Strategies.DefaultStreamingStrategy.Stream(Entity entity, ISegmentEmitter emitter) in /_/sdk/src/Core/Strategies/DefaultStreamingStrategy.cs:line 80",
    "at Amazon.XRay.Recorder.Core.Strategies.DefaultStreamingStrategy.Stream(Entity entity, ISegmentEmitter emitter) in /_/sdk/src/Core/Strategies/DefaultStreamingStrategy.cs:line 65",
    "at Amazon.XRay.Recorder.Core.Strategies.DefaultStreamingStrategy.Stream(Entity entity, ISegmentEmitter emitter) in /_/sdk/src/Core/Strategies/DefaultStreamingStrategy.cs:line 65",
    "at Amazon.XRay.Recorder.Core.AWSXRayRecorder.EndFacadeSegment() in /_/sdk/src/Core/AWSXRayRecorder.netcore.cs:line 408",
    "at Amazon.XRay.Recorder.Core.AWSXRayRecorder.ProcessEndSubsegmentInLambdaContext(Nullable`1 timestamp) in /_/sdk/src/Core/AWSXRayRecorder.netcore.cs:line 371",
    "at Amazon.XRay.Recorder.Core.AWSXRayRecorder.EndSubsegment(Nullable`1 timestamp) in /_/sdk/src/Core/AWSXRayRecorder.netcore.cs:line 328",
    "at AWS.Lambda.Powertools.Tracing.Internal.XRayRecorder.EndSubsegment()",
    "at CoolFunction.Function.FunctionHandler(SQSEvent sqsEvent, ILambdaContext _context)",
    "at lambda_method1(Closure, Stream, ILambdaContext, Stream)",
    "at Amazon.Lambda.RuntimeSupport.HandlerWrapper.<>c__DisplayClass8_0.<GetHandlerWrapper>b__0(InvocationRequest invocation) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/HandlerWrapper.cs:line 54",
    "at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InvokeOnceAsync(CancellationToken cancellationToken) in /src/Repo/Libraries/src/Amazon.Lambda.RuntimeSupport/Bootstrap/LambdaBootstrap.cs:line 185"
  ]
}

Code snippet

Function.cs

public class Function
{
    private readonly IServiceProvider _serviceProvider;

    public Function(IServiceProvider serviceProvider)
    {
        _serviceProvider = serviceProvider;
    }

    public Function()
    {
        Tracing.RegisterForAllServices();
        _serviceProvider = InitServices.Provider;
    }

    [Logging(ClearState = true)]
    [Tracing]
    public async Task<BatchItemFailuresResponse> FunctionHandler(SQSEvent sqsEvent, ILambdaContext _context)
    {
        var batchProcessor = _serviceProvider.GetRequiredService<ISqsBatchProcessor>();
        var recordHandler = _serviceProvider.GetRequiredService<ISqsRecordHandler>();
        var result = await batchProcessor.ProcessAsync(sqsEvent, recordHandler);

        return result.BatchItemFailuresResponse;
    }
}


### Possible Solution

Unable to triage this issue.

### Steps to Reproduce

Write a lambda function that utilizes both batch processing and tracing via annotations. 

### Powertools for AWS Lambda (.NET) version

latest

### AWS Lambda function runtime

dotnet6

### Debugging logs

_No response_
@CoreySchnedl CoreySchnedl added bug Unexpected, reproducible and unintended software behaviour triage Pending triage from maintainers labels Aug 8, 2024
Copy link

boring-cyborg bot commented Aug 8, 2024

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #dotnet channel on our Powertools for AWS Lambda Discord: Invite link

@CoreySchnedl
Copy link
Author

I have created this MVP sample repository to demonstrate the issue. The code is pretty simple, but is throwing the exception noted above. What am I doing wrong, or is this a bug?

https://github.com/CoreySchnedl/dotnet-powertools-issue-630-sample

@leandrodamascena
Copy link
Contributor

Hi @CoreySchnedl! Thank you for opening this issue and providing a small project to reproduce the bug, that is really helpful! We will work on reproducing the bug this week and see if we need to create a bugfix to resolve this issue or if there is something we can change in this project that will fix the problem.

We will update this issue as soon as we have more information.

@hjgraca
Copy link
Contributor

hjgraca commented Aug 20, 2024

Hi @CoreySchnedl as a workaround while we do a release to fix this bug, if you are not using the Metadata in X-Ray you could change the POWERTOOLS_TRACER_CAPTURE_RESPONSE environment variable to false. This will stop Tracing from trying to add the RecordHandlerResult to the Metadata field in X-Ray which is the cause for the exception you are seeing.

Another approach if you don't want to lose the Metadata from other methods that have the Tracing decorator you could manually add a Tracing subsegment.

public class CustomSqsRecordHandler : ISqsRecordHandler
{
    // [Tracing] -- remove the decorator
    public async Task<RecordHandlerResult> HandleAsync(SQSEvent.SQSMessage record, CancellationToken cancellationToken)
    {
        
        /*
         * Your business logic.
         * If an exception is thrown, the item will be marked as a partial batch item failure.
         */
        Logger.LogInformation($"Handling SQS record with message id: '{record.MessageId}'.");

        Logger.LogInformation($"Handling record with body: {record.Body}");

        var product = JsonSerializer.Deserialize<Product>(record.Body);

        Tracing.WithSubsegment("Custom Record Handler", (subsegment) =>
        {
           // if you uncomment this line you will see that it will fail
            // subsegment.AddMetadata("Data", RecordHandlerResult.FromData(product));

            SomeCoolFunction();
            SomeCoolFunction();
        });

        Logger.LogInformation($"Handling product with id: {product!.SomeCoolField}");
        
        return await Task.FromResult(RecordHandlerResult.FromData(product));
    }

    [Tracing]
    private static bool SomeCoolFunction()
    {
        return true;
    }
}

@github-actions github-actions bot added the pending-release Fix or implementation already in dev waiting to be released label Aug 26, 2024
@dreamorosi dreamorosi moved this from 👀 In review to Comming soon in Powertools for AWS Lambda (.NET) Aug 26, 2024
@hjgraca
Copy link
Contributor

hjgraca commented Aug 29, 2024

Release 1.13
Batch v1.1.2
Tracing v1.5.1

@hjgraca hjgraca removed the pending-release Fix or implementation already in dev waiting to be released label Aug 29, 2024
@hjgraca hjgraca moved this from Comming soon to ✅ Done in Powertools for AWS Lambda (.NET) Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected, reproducible and unintended software behaviour
Projects
Status: Done
3 participants