LGTM extraction failure for C# ASP.NET 5.0 application

We’ve been working on upgrading to .NET 5 for an ASP. NET application, but are having issues getting LGTM to build our project successfully.

The repo/PR is here: Upgrade backend to .NET 5 by johnthagen · Pull Request #1198 · sillsdev/TheCombine · GitHub

Locally and within Docker, a simple dotnet build BackendFramework.sln works. This even builds within GitHub Actions.

But within LGTM, we consistently get MSBUILD errors similar to:

[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout] MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout] Microsoft.Build.BackEnd.NodeFailedToLaunchException: No such file or directory
[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout]  ---> System.ComponentModel.Win32Exception (2): No such file or directory
[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout]    at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout]    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout]    at System.Diagnostics.Process.Start()
[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout]    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
[2021-06-18 20:03:30] [build-stdout] [2021-06-18 20:03:30] [build-stdout]    at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)

We’ve tried explicitly setting the build steps in lgtm.yml:

        - dotnet clean BackendFramework.sln
        - dotnet build --no-incremental BackendFramework.sln

Without more knowledge/control over the VM that LGTM runs on, it’s difficult to try to debug what is going on. Are there any recommendations for how to debug a failing ASP. NET 5 application build?

Full build log: LGTM


I am seeing exactly the same issue for GitHub - HaveIBeenPwned/PwnedPasswordsAzureFunction: APIs for the k-anonymity Pwned Passwords implementation as well (see log).

Maybe NodeFailedToLaunchException thrown from Codespaces container · Issue #5355 · dotnet/msbuild · GitHub is related to this, though it appears they were not able to consistently reproduce it, a Kernel update might help? (But to be honest I have no experience with .NET at all, I was just curious whether the above mentioned project can be build).

I created a discussion for this at the github/codeql repository: LGTM.com: C# extraction fails with "MSBUILD : error MSB1025: An internal failure occurred while running MSBuild" · Discussion #6221 · github/codeql · GitHub

One of the maintainers answered, but they don’t know either what is causing this build failure.