dotnet / dotnet/msbuild

MSBuild stops because of logger failure

Open
#4,322 13 comments 0 reactions 0 assignees View on GitHub
triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

Build failed because of a logger failure in MSBuild. Happened in corefx official builds on RedHat6-x64: https://dnceng.visualstudio.com/internal/_build/results?buildId=159160&view=logs&jobId=7cbf968d-26f0-55c8-fa2c-bd900b311c34&taskId=b2aeb635-23e9-595d-82a3-8f619fe45749&lineStart=913&lineEnd=929&colStart=1&colEnd=30

A binary log file is available in the artifacts page but could contain secrets therefore I'm not uploading it here. Pls make sure to save it somewhere before retention policy deletes it.

```
Time Elapsed 00:03:34.47
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 System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
at System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& value)
at Microsoft.Build.Collections.CopyOnWritePropertyDictionary`1.get_Item(String name)
at Microsoft.Build.Execution.ProjectItemInstance.TaskItem.GetMetadataEscaped(String metadataName)
at Microsoft.Build.Execution.ProjectItemInstance.TaskItem.GetMetadata(String metadataName)
at Microsoft.Build.Logging.BuildEventArgsWriter.Write(ITaskItem item)
at Microsoft.Build.Logging.BuildEventArgsWriter.WriteItems(IEnumerable items)
at Microsoft.Build.Logging.BinaryLogger.Write(BuildEventArgs e)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs 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.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
Build failed (exit code '1').
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Microsoft.Build.Logging.BuildEventArgsWriter.Write and the related WriteItems call shown in the stack trace, then inspect the saved binary log from the RedHat6-x64 official build if available. Reproduce the logger failure and verify that the build no longer stops with the NullReferenceException or MSB4017 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.