question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SkyApm Log exception

See original GitHub issue

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion
  • [* ] Bug
  • Requirement
  • Feature or performance improvement

Question

  • What do you want to know?

Bug

  • Which version of SkyWalking, OS and .NET Runtime?

  • Which company or project?

  • What happen? If possible, provide a way for reproducing the error. e.g. demo application, component version.

Unhandled exception. System.AggregateException: An error occurred while writing to logger(s). (Object reference not set to an instance of an object.)
 ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at SkyApm.Transport.SegmentContextMapper.Map(SegmentContext segmentContext)
   at SkyApm.Transport.LoggerContextContextMapper.Map(LoggerContext loggerContext)
   at SkyApm.Transport.AsyncQueueSkyApmLogDispatcher.Dispatch(LoggerContext loggerContext)
   at SkyApm.Diagnostics.MSLogging.SkyApmLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.Logger.<Log>g__LoggerLog|12_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func`3 formatter, List`1& exceptions, TState& state)
   --- End of inner exception stack trace ---
   at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List`1 exceptions)
   at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.Logger`1.Microsoft.Extensions.Logging.ILogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
   at Microsoft.Extensions.Logging.LoggerExtensions.Log(ILogger logger, LogLevel logLevel, EventId eventId, Exception exception, String message, Object[] args)
   at Microsoft.Extensions.Logging.LoggerExtensions.LogInformation(ILogger logger, String message, Object[] args)
   at DotNetCore.CAP.Processor.CapProcessingServer.Dispose()
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.DisposeAsync()
--- End of stack trace from previous location ---
   at Microsoft.Extensions.Hosting.Internal.Host.<DisposeAsync>g__DisposeAsync|16_0(Object o)
   at Microsoft.Extensions.Hosting.Internal.Host.DisposeAsync()
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)
   at Microsoft.AspNetCore.Builder.WebApplication.Run(String url)

Requirement or improvement

  • Please describe about your requirements or improvement suggestions.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
liuhaoyangcommented, Sep 16, 2022

I have removed the 2.1.0 release until this issue is fixed.

0reactions
liuhaoyangcommented, Sep 16, 2022

it seem like a critical fault it make logger broken when we do not have init EntrySegment Just happen Like:

  1. some module that do not use skyapm like quartz,hangfire and so on
  2. BackgroundService、HostService

@liuhaoyang @GeorGeWzw any suggestions?

I just re-reviewed the code LoggerContextContextMapper.cs#L34 should check if SegmentContext is null before mapping SegmentContext to segmentRequest

Read more comments on GitHub >

github_iconTop Results From Across the Web

SkyAPM C#/.NET instrument agent
SkyAPM -dotnet provides the native support agent in C# and .NETStandard platform, with the helps from Apache SkyWalking committer team.
Read more >
Issues · SkyAPM/SkyAPM-dotnet
A large number of httpclients and tcp are created when the oap server is unavailable bug Something isn't working enhancement New feature or...
Read more >
How to tolerate custom exceptions | Apache SkyWalking
Skywalking provides 2 ways to tolerate an exception which is traced in a span. Set the names of exception classes in the agent...
Read more >
Documentation | Apache SkyWalking
Apache SkyWalking Client-side JavaScript exception and tracing library. ... closing to the target monitored system, to collect metrics, traces, and logs.
Read more >
Newest 'skywalking' Questions - Stack Overflow
No logs generated: Skywalking OAP and Webapp won't start on Windows 10 with ... I'm facing a classCastException issue while using grpc netty ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found