dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.21k stars 1.35k forks source link

BuildRequestEngine unhandled exception #10549

Open JanKrivanek opened 3 weeks ago

JanKrivanek commented 3 weeks ago

Reported by @CyrusNajmabadi

Got this error in latst main:

Build started at 3:15 PM...
1>------ Build started: Project: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost, Configuration: Debug Any CPU ------
2>------ Build started: Project: InteractiveHost64, Configuration: Debug Any CPU ------
3>------ Build started: Project: Roslyn.VisualStudio.Setup, Configuration: Debug Any CPU ------
3>MSBUILD : error MSB4166: Child node "4" exited prematurely. Shutting down. Diagnostic information may be found in files in "C:\Temp\msbuild" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
3>MSBUILD : error MSB4166: C:\Temp\msbuild\MSBuild_pid-19808_1cd305da86ad4e10867611eb73032c12.failure.txt:
3>MSBUILD : error MSB4166: UNHANDLED EXCEPTIONS FROM PROCESS 19808:
3>MSBUILD : error MSB4166: =====================
3>MSBUILD : error MSB4166: 8/21/2024 3:15:26 PM
3>MSBUILD : error MSB4166: System.AggregateException: One or more errors occurred. ---> Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166: =============
3>MSBUILD : error MSB4166: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)

Link to diagnostics: internal link

JanKrivanek commented 3 weeks ago
Build started at 3:15 PM...
1>------ Build started: Project: Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost, Configuration: Debug Any CPU ------
2>------ Build started: Project: InteractiveHost64, Configuration: Debug Any CPU ------
3>------ Build started: Project: Roslyn.VisualStudio.Setup, Configuration: Debug Any CPU ------
3>MSBUILD : error MSB4166: Child node "4" exited prematurely. Shutting down. Diagnostic information may be found in files in "C:\Temp\msbuild" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
3>MSBUILD : error MSB4166: C:\Temp\msbuild\MSBuild_pid-19808_1cd305da86ad4e10867611eb73032c12.failure.txt:
3>MSBUILD : error MSB4166: UNHANDLED EXCEPTIONS FROM PROCESS 19808:
3>MSBUILD : error MSB4166: =====================
3>MSBUILD : error MSB4166: 8/21/2024 3:15:26 PM
3>MSBUILD : error MSB4166: System.AggregateException: One or more errors occurred. ---> Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166: =============
3>MSBUILD : error MSB4166: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0, Object arg1)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass42_0.<SubmitBuildRequest>b__0()
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass72_0.<QueueAction>b__0()
3>MSBUILD : error MSB4166: 
3>MSBUILD : error MSB4166:  ---> Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0, Object arg1)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass42_0.<SubmitBuildRequest>b__0()
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass72_0.<QueueAction>b__0()
3>MSBUILD : error MSB4166:    --- End of inner exception stack trace ---
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass72_0.<QueueAction>b__0()
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Dataflow.ActionBlock`1.ProcessMessage(Action`1 action, KeyValuePair`2 messageWithId)
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Dataflow.ActionBlock`1.<>c__DisplayClass6_0.<.ctor>b__0(KeyValuePair`2 messageWithId)
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Dataflow.Internal.TargetCore`1.ProcessMessagesLoopCore()
3>MSBUILD : error MSB4166:    --- End of inner exception stack trace ---
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.CleanupForBuild()
3>MSBUILD : error MSB4166:    at Microsoft.Build.Execution.OutOfProcNode.HandleShutdown(Exception& exception)
3>MSBUILD : error MSB4166:    at Microsoft.Build.Execution.OutOfProcNode.Run(Boolean enableReuse, Boolean lowPriority, Exception& shutdownException)
3>MSBUILD : error MSB4166:    at Microsoft.Build.CommandLine.MSBuildApp.StartLocalNode(CommandLineSwitches commandLineSwitches, Boolean lowpriority)
3>MSBUILD : error MSB4166:    at Microsoft.Build.CommandLine.MSBuildApp.ProcessCommandLineSwitches(CommandLineSwitches switchesFromAutoResponseFile, CommandLineSwitches switchesNotFromAutoResponseFile, String& projectFile, String[]& targets, String& toolsVersion, Dictionary`2& globalProperties, ILogger[]& loggers, LoggerVerbosity& verbosity, LoggerVerbosity& originalVerbosity, List`1& distributedLoggerRecords, Boolean& needToValidateProject, String& schemaFile, Int32& cpuCount, Boolean& enableNodeReuse, TextWriter& preprocessWriter, TextWriter& targetsWriter, Boolean& detailedSummary, ISet`1& warningsAsErrors, ISet`1& warningsNotAsErrors, ISet`1& warningsAsMessages, Boolean& enableRestore, Boolean& interactive, ProfilerLogger& profilerLogger, Boolean& enableProfiler, Dictionary`2& restoreProperties, ProjectIsolationMode& isolateProjects, GraphBuildOptions& graphBuild, String[]& inputResultsCaches, String& outputResultsCache, Boolean& reportFileAccesses, Boolean& lowPriority, Boolean& question, Boolean& isBuildCheckEnabled, String[]& getProperty, String[]& getItem, String[]& getTargetResult, String& getResultOutputFile, Boolean recursing, String commandLine)
3>MSBUILD : error MSB4166:    at Microsoft.Build.CommandLine.MSBuildApp.Execute(String commandLine)
3>MSBUILD : error MSB4166:    at Microsoft.Build.CommandLine.MSBuildApp.Main()
3>MSBUILD : error MSB4166: ---> (Inner Exception #0) Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166: =============
3>MSBUILD : error MSB4166: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0, Object arg1)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass42_0.<SubmitBuildRequest>b__0()
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass72_0.<QueueAction>b__0()
3>MSBUILD : error MSB4166: 
3>MSBUILD : error MSB4166:  ---> Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0, Object arg1)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass42_0.<SubmitBuildRequest>b__0()
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass72_0.<QueueAction>b__0()
3>MSBUILD : error MSB4166:    --- End of inner exception stack trace ---
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Exception innerException, Object[] args)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass72_0.<QueueAction>b__0()
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Dataflow.ActionBlock`1.ProcessMessage(Action`1 action, KeyValuePair`2 messageWithId)
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Dataflow.ActionBlock`1.<>c__DisplayClass6_0.<.ctor>b__0(KeyValuePair`2 messageWithId)
3>MSBUILD : error MSB4166:    at System.Threading.Tasks.Dataflow.Internal.TargetCore`1.ProcessMessagesLoopCore()<---
3>MSBUILD : error MSB4166: 
3>MSBUILD : error MSB4166: ===================
3>MSBUILD : error MSB4166: 
3>MSBUILD : error MSB4166: 
3>MSBUILD : error MSB4166: C:\Temp\msbuild\MSBuild_pid-19808_9ce1fbe1b7404f3199519cd09f026a6d.failure.txt:
3>MSBUILD : error MSB4166: UNHANDLED EXCEPTIONS FROM PROCESS 19808:
3>MSBUILD : error MSB4166: =====================
3>MSBUILD : error MSB4166: 8/21/2024 3:15:26 PM
3>MSBUILD : error MSB4166: Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: Request 16 refers to configuration 205 which is not known to the engine.
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
3>MSBUILD : error MSB4166:    at Microsoft.Build.Shared.ErrorUtilities.VerifyThrow(Boolean condition, String unformattedMessage, Object arg0, Object arg1)
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass42_0.<SubmitBuildRequest>b__0()
3>MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.BuildRequestEngine.<>c__DisplayClass72_0.<QueueAction>b__0()
3>MSBUILD : error MSB4166: ===================
3>MSBUILD : error MSB4166: 
3>MSBUILD : error MSB4166:
4>------ Build started: Project: ExpressionEvaluatorPackage, Configuration: Debug Any CPU ------
5>------ Build started: Project: RoslynDeployment, Configuration: Debug Any CPU ------
6>------ Build started: Project: Microsoft.VisualStudio.IntegrationTest.Setup, Configuration: Debug Any CPU ------
7>------ Build started: Project: Microsoft.VisualStudio.LanguageServices.New.IntegrationTests, Configuration: Debug Any CPU ------
8>------ Build started: Project: IntegrationTestBuildProject, Configuration: Debug Any CPU ------
========== Build: 1 succeeded, 7 failed, 199 up-to-date, 0 skipped ==========
========== Build completed at 3:15 PM and took 23.109 seconds ==========
JanKrivanek commented 3 weeks ago

https://github.com/dotnet/msbuild/pull/10172 was operating in that area. On the other hand SubmitBuildRequest (which got the exception) was untouched by the refactoring

Edit: running through the SubmitBuildRequest and all the code populating _configCache - all that seems to be untouched (neiter indirectly) by recent changes. So it might not be a regression. Still should be understood though.