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

Enabling BuildCheck causes error MSB4166: Child node "1" exited prematurely #11326

Open
YuliiaKovalova opened this issue Jan 23, 2025 · 2 comments

Comments

@YuliiaKovalova
Copy link
Member

Issue Description

Enabling BuildCheck on runtime and other repos caused

 error MSB4166: Child node "1" exited prematurely. Shutting down. Diagnostic information may be found in files in "C:\Users\cloudtest\AppData\Local\Temp\MSBuildTemp\" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: ContextID 415 should have been in the ID-to-project file mapping but wasn't!
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
   at Microsoft.Build.BackEnd.Logging.LoggingService.GetAndVerifyProjectFileFromContext(BuildEventContext context)
   at Microsoft.Build.BackEnd.Logging.LoggingService.LogBuildEvent(BuildEventArgs buildEvent)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildCheckManagerProvider.BuildCheckManager.StartProjectRequest(ICheckContext checkContext, String projectFullPath)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildCheckBuildEventHandler.HandleProjectStartedRequest(ProjectStartedEventArgs eventArgs)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildCheckConnectorLogger.EventSource_AnyEventRaised(Object sender, BuildEventArgs e)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.<Consume>b__81_9(ProjectStartedEventArgs args)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.<Consume>b__81_9(ProjectStartedEventArgs args)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.Consume(BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(BuildEventArgs eventArg)
   at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(Object loggingEvent)
   at Microsoft.Build.BackEnd.Logging.LoggingService.LoggingEventProcessor(Object loggingEvent)

or

##[error]Child node "1" exited prematurely. Shutting down. Diagnostic information may be found in files in "/tmp/MSBuildTempcloudtest/" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.Microsoft.Build.Framework.InternalErrorException: MSB0001: Internal MSBuild Error: ContextID 61 should have been in the ID-to-project file mapping but wasn't!
   at Microsoft.Build.Shared.ErrorUtilities.ThrowInternalError(String message, Object[] args)
   at Microsoft.Build.BackEnd.Logging.LoggingService.GetAndVerifyProjectFileFromContext(BuildEventContext context)
   at Microsoft.Build.BackEnd.Logging.LoggingService.LogBuildEvent(BuildEventArgs buildEvent)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildCheckManagerProvider.BuildCheckManager.Microsoft.Build.Experimental.BuildCheck.Infrastructure.IResultReporter.ReportResult(BuildEventArgs eventArgs, ICheckContext checkContext)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.CheckWrapper.ReportResult(BuildCheckResult result, ICheckContext checkContext, CheckConfigurationEffective config)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildEventsProcessor.ReportResult(CheckWrapper checkWrapper, ICheckContext checkContext, CheckConfigurationEffective[] configPerRule, BuildCheckResult result)
   at Microsoft.Build.Experimental.BuildCheck.Checks.PropertiesUsageCheck.DoneWithProject(BuildCheckDataContext`1 context)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildCheckCentralContext.<>c__DisplayClass25_0`1.<RegisterAction>g__WrappedHandler|0(BuildCheckDataContext`1 context)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildCheckCentralContext.RunRegisteredActions[T](List`1 registeredCallbacks, T checkData, ICheckContext checkContext, Action`4 resultHandler)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildEventsProcessor.ProcessProjectDone(ICheckContext checkContext, String projectFullPath)
   at Microsoft.Build.Experimental.BuildCheck.Infrastructure.BuildCheckBuildEventHandler.HandleBuildEvent(BuildEventArgs e)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
   at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(BuildEventArgs eventArg)
   at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(Object loggingEvent)
   at Microsoft.Build.BackEnd.Logging.LoggingService.LoggingEventProcessor(Object loggingEvent)

It fails randomly but for sure caused by the feature.

Steps to Reproduce

navigate to the repo and observe the issue https://github.com/dotnet/extensions/pull/5810/checks?check_run_id=35940423010 or check the binlog attached (change .zip -> .binlog)

Build_runtime_windows.zip

Expected Behavior

BuildCheck runs smootly.

Actual Behavior

enabling the feature causes build crash.

Analysis

No response

Versions & Configurations

No response

@baronfel
Copy link
Member

I think we just merged a PR hardening this check this morning, so maybe this has already been fixed?

@YuliiaKovalova
Copy link
Member Author

I thought the same but @JanKrivanek claims it's still the issue :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants