microsoft / ApplicationInsights-Profiler-AspNetCore

Application Insights Profiler sample and documentation
MIT License
66 stars 23 forks source link

UnsupportedPayloadTypeException when try to profile the app #169

Closed jvitor83 closed 2 years ago

jvitor83 commented 2 years ago

Hi, I'm having a UnsupportedPayloadTypeException when try to "Profile now" at Azure App Insights.

The Exception:

[16:02:30 ERR] Trace upload failed. Exit code: 255
[16:02:30 ERR] Unexpected error happens on stopping service profiler.
Microsoft.ApplicationInsights.Profiler.Core.IPC.UnsupportedPayloadTypeException: Can't deserialize message over the named pipe.
at Microsoft.ApplicationInsights.Profiler.Core.IPC.DuplexNamedPipeService.ReadAsync[T](TimeSpan timeout, CancellationToken cancellationToken)
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.<>c__DisplayClass4_0.<<PostStopProcessAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.PostStopProcessAsync(PostStopOptions e, CancellationToken cancellationToken)
[16:02:30 ERR] Unexpected error happens on stopping service profiler tracing.
Microsoft.ApplicationInsights.Profiler.Core.IPC.UnsupportedPayloadTypeException: Can't deserialize message over the named pipe.
at Microsoft.ApplicationInsights.Profiler.Core.IPC.DuplexNamedPipeService.ReadAsync[T](TimeSpan timeout, CancellationToken cancellationToken)
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.<>c__DisplayClass4_0.<<PostStopProcessAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.PostStopProcessAsync(PostStopOptions e, CancellationToken cancellationToken)
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.StopServiceProfilerAsync(IProfilerSource source, CancellationToken cancellationToken)
[16:02:30 ERR] Unexpected exception in the last circle.
Microsoft.ApplicationInsights.Profiler.Core.IPC.UnsupportedPayloadTypeException: Can't deserialize message over the named pipe.
at Microsoft.ApplicationInsights.Profiler.Core.IPC.DuplexNamedPipeService.ReadAsync[T](TimeSpan timeout, CancellationToken cancellationToken)
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.<>c__DisplayClass4_0.<<PostStopProcessAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.PostStopProcessAsync(PostStopOptions e, CancellationToken cancellationToken)
at Microsoft.ApplicationInsights.Profiler.Core.ServiceProfilerProvider.StopServiceProfilerAsync(IProfilerSource source, CancellationToken cancellationToken)
at Microsoft.ApplicationInsights.Profiler.Core.Orchestration.OrchestratorEventPipe.StopProfilingAsync(SchedulingPolicy policy, CancellationToken cancellationToken)
at Microsoft.ServiceProfiler.Orchestration.SchedulingPolicy.StartPolicyAsync(CancellationToken cancellationToken)

The csproj:

    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.17.0" />
    <PackageReference Include="Microsoft.ApplicationInsights.Profiler.AspNetCore" Version="2.4.0-beta1" />
    <PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="2.0.3-beta2" />

It is a dockerized application running on netcoreapp3.1.

Any clues about what can be happening?

xiaomi7732 commented 2 years ago

Hi @jvitor83, Thanks for the report. We have had some major refactoring for 2.4.0-beta1 that's related to serialization and might caused some issue. Give us some time to investigate it.

At the same time, would you mind try it on 2.3.1 and see if that works for you?

jvitor83 commented 2 years ago

Hi @xiaomi7732,

The 2.3.1 worked just fine.

Thank you!

xiaomi7732 commented 2 years ago

@jvitor83 I am glad to hear that. A bit progress: I reproduced the exception on my box with mcr.microsoft.com/dotnet/aspnet:3.1-alpine, we haven't reach the bottom of the investigation yet. News will be posted here.

JacobBovee commented 2 years ago

Hey @jvitor83 just wanted to keep you updated, we worked out a fix and will be deploying 2.4.0-beta2 after a bit of testing and verification. I'll let you know when it's released, hopefully in the next few days. Thanks again for spotting this! We really appreciate it.

JacobBovee commented 2 years ago

Hey @jvitor83 just released a new version of profiler with this fix included: 2.4.0-beta2.

Please let me know if this works for you. Thanks again for taking the time to work with us on this.

xiaomi7732 commented 2 years ago

No update for a while. Feel free to reopen if there's further issue found.