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

Logger error should be reported to other loggers #6564

Open
KirillOsenkov opened this issue Jun 15, 2021 · 1 comment
Open

Logger error should be reported to other loggers #6564

KirillOsenkov opened this issue Jun 15, 2021 · 1 comment
Labels
Area: Logging needs-design Requires discussion with the dev team before attempting a fix. triaged

Comments

@KirillOsenkov
Copy link
Member

Have two loggers: /bl and a misbehaving logger that throws on, say, ProjectStarted.

The build will fail with 0 errors, 0 warnings and this message:

Build FAILED.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:05.94
MSBUILD : error MSB4017: The build stopped unexpectedly because of an unexpected logger failure.
Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at MSBuild.Logger.BuildConfiguration.Equals(Object obj)
   at System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
   at System.Collections.Generic.List`1.Contains(T item)
   at MSBuild.Logger.ProjectTrees.AddTopLevelProject(ProjectStartedEventArgs startedEvent, BuildConfiguration platformConfiguration)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseProjectStartedEvent(Object sender, ProjectStartedEventArgs buildEvent)
   --- End of inner exception stack trace ---
   at Microsoft.Build.Exceptions.InternalLoggerException.Throw(Exception innerException, BuildEventArgs e, String messageResourceName, Boolean initializationException, String[] messageArgs)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseProjectStartedEvent(Object sender, ProjectStartedEventArgs buildEvent)
   at MSBuild.Logger.ForwardingLogger.ForwardEvent(Object sender, BuildEventArgs e)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseProjectStartedEvent(Object sender, ProjectStartedEventArgs buildEvent)

This message is missing from the binlog, so we should probably have a better design around continuing to log into other loggers when one logger crashes. Right now the binlog just contains build failed but no indication of the other logger fault.

@KirillOsenkov KirillOsenkov added Area: Logging needs-design Requires discussion with the dev team before attempting a fix. labels Jun 15, 2021
@KirillOsenkov
Copy link
Member Author

Discovered while investigating microsoft/azure-pipelines-tasks#14904

@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Logging needs-design Requires discussion with the dev team before attempting a fix. triaged
Projects
None yet
Development

No branches or pull requests

2 participants