Setup Problems

System.IO.IOException on GridNode

Started by alexander_jesner on 2,398 views

With the newest 4.10.0.6 I get the following error on my Grid Node (running as a service under LOCAL_SYSTEM)


System.IO.IOException: Could not find a part of the path 'C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\VisualStudio'.: C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\VisualStudio
   at nCrunch.Common.IO.DirectoryPath.GetDirectories(String wildcardSpec)
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(VisualStudioVersion )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(IList`1 , ProcessLoadParameters , VisualStudioVersion )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(EffectiveProcessorArchitecture , BuildSystemParameters , IList`1 , FilePath )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher..()
   at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.BuildComponentInExternalProcess(ComponentBuildParameters buildParameters, VisualStudioVersion vsVersion, GridClientId client, IList`1 customEnvironmentVariables, Guid taskId, GridAddress clientAddress)
   at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender, Guid taskId, GridAddress clientAddress, Boolean extractCoverageReportStructure)
   at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
   at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
   at nCrunch.GridNode.NodeTaskProcessor..()
   at nCrunch.Common.ErrorHandler.DoWithErrorHandling(Action action, Object context)



I then tried to run the service under a named user account (John.Doe) to rule out problems with the LOCAL_SYSTEM user:

System.IO.IOException: Could not find a part of the path 'C:\Users\John.Doe\AppData\Local\Microsoft\VisualStudio'.: C:\Users\John.Doe\AppData\Local\Microsoft\VisualStudio
   at nCrunch.Common.IO.DirectoryPath.GetDirectories(String wildcardSpec)
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(VisualStudioVersion )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(IList`1 , ProcessLoadParameters , VisualStudioVersion )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(EffectiveProcessorArchitecture , BuildSystemParameters , IList`1 , FilePath )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher..()
   at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.(Action`1 , EffectiveProcessorArchitecture , GridClientId , BuildSystemParameters , IList`1 , Nullable`1 , GridAddress )
   at nCrunch.Core.BuildManagement.BuildProcessLauncher.BuildComponentInExternalProcess(ComponentBuildParameters buildParameters, VisualStudioVersion vsVersion, GridClientId client, IList`1 customEnvironmentVariables, Guid taskId, GridAddress clientAddress)
   at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender, Guid taskId, GridAddress clientAddress, Boolean extractCoverageReportStructure)
   at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
   at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
   at nCrunch.GridNode.NodeTaskProcessor..()
   at nCrunch.Common.ErrorHandler.DoWithErrorHandling(Action action, Object context)


It seems that

  • when I run as a user where this folder exists, everything works fine
  • when I run as a user where this folder does not exist, I get the error BUT when I create an empty folder at the specified path, it starts to work again.


Please have a look at this problem; it was working fine in all the versions of the last 24 months. If you need more information, do not hesitate to contact me.
For now I'm going to work around the problem by creating the folders where necessary.

--- Alex
Hi Alex,

Thanks for taking the time to report this problem. This is a known issue that was introduced in the v4.10 release. It affects systems that have preview versions of the Dotnet SDK installed alongside the gridnode. It is caused by a fix that was introduced to help resolve client-side problems with the underlying system using the wrong version of Dotnet when building projects. Unfortunately, this code doesn't make sense in its current form when executed on the node.

We're planning a fix for this, but for the time being the easiest way to work around this problem is to just create the missing directory so that the code can run without any exceptions. If the grid node uses the wrong version of the Dotnet SDK, you may need to set the DOTNET_MSBUILD_SDK_RESOLVER_SDKS_* environment variables on the node to force it to use the correct SDK version. Right now our plan for this fix is to change the logic of the node so that the client hands it the expected SDK version and it then does its best to use the best match it can find.

Please accept my apologies for any trouble caused by this problem.
Hi,
thanks for the quick reply.
I created the folders for now and everything seems to be fine.

The only remark I have: on my Grid Nodes only the VS2019 Build Tools are installed, no VS2022 Preview and no .NET 6 Preview. The VS2022 Preview is only installed on my developer machine.
Not sure if it makes a difference, but maybe you can draw some conclusions from this to improve nCrunch here.
alexander_jesner wrote:
The only remark I have: on my Grid Nodes only the VS2019 Build Tools are installed, no VS2022 Preview and no .NET 6 Preview. The VS2022 Preview is only installed on my developer machine.
Not sure if it makes a difference, but maybe you can draw some conclusions from this to improve nCrunch here.


Thanks, it's good to know this. Also glad you're up and running again.

Post a reply

Log in to reply.