Unable to create a new user process.

cshorler's Avatar

cshorler

02 Nov, 2019 11:14 AM

I'd like to understand how to debug this issue, part of my appveyor learning curve.

Is there some way to attach to the running build after RDP to the VM? or to retrieve it's environment? Currently I can only see how to run dev tools, which doesn't always reproduce issues because they're running with a new environment.

Edit: I found a way to retrieve the environment - see https://github.com/appveyor/ci/issues/1904
Although not sure what to do with it

I'm testing a new build setup in this project
https://ci.appveyor.com/project/cshorler/stepcode

I've explicitly disabled the git repos .appveyor.yaml , although eventually I'll return to a matrix build.

After the VM completes the before build_build script I see this error when the appveyor build agent attempts to execute msbuild

-- Configuring done
-- Generating done
-- Build files have been written to: C:/projects/stepcode/build
before_build: (done)
msbuild "C:\projects\stepcode\build\SC.sln" /m /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
Unable to create a new user process.

As indicated above, I've used RDP to have a look at running msbuild in the Powershell ISE. I can't reproduce the Unable to create a new user process. Manually executing the same msbuild command line the build proceeds. Although, it then fails due to the appveyor logger not having an appropriate environment / endpoint - I guess expected.

As a workaround, I moved all the commands to a single build script. Which works as expected, so I guess the problem is in my before_build step?

Here's the original (I can create another project for debugging this if desired):

The sources:
branch: simplify_std_msvc_fixes
repo: https://github.com/cshorler/stepcode.git

before_build:

New-Item -Path $env:APPVEYOR_BUILD_FOLDER -Name "build" -ItemType "directory" -ErrorAction "stop" | Set-Location
$mkargs = @("..", 
            "-G", "Visual Studio 15 2017", "-A", "x64",
            "-DSC_ENABLE_TESTING=ON",
            "-DSC_BUILD_SCHEMAS=ifc2x3;ap214e3;ap209")
%{cmake $mkargs} 2>&1 | %{ "$_" }
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "before_build: (done)"

What should I do next to find the root cause of Unable to create a new user process.

full build log attached.

  1. 1 Posted by cshorler on 02 Nov, 2019 03:03 PM

    cshorler's Avatar
  2. 2 Posted by cshorler on 16 Nov, 2019 05:55 PM

    cshorler's Avatar

    Added Appveyor exception from windows event logger (retrieved by moving the RDP to the end of the build, after the failure)

    Event number                    : 73
    Written time                    : Nov 10, 2019 20:41:14.974657700 UTC
    Event level                     : Information (4)
    Computer name                   : appveyor-vm
    Source name                     : AppVeyor Build Agent
    Event identifier                : 0x00000000 (0)
    Number of strings               : 1
    String: 1                       : Run CMD: msbuild "C:\projects\stepcode-m6l8m\build\SC.sln" /verbosity:normal /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
    
    Event number                    : 74
    Written time                    : Nov 10, 2019 20:41:14.974657700 UTC
    Event level                     : Error (2)
    Computer name                   : appveyor-vm
    Source name                     : AppVeyor Build Agent
    Event identifier                : 0x00000000 (0)
    Number of strings               : 1
    String: 1                       : Build exception: System.ComponentModel.Win32Exception (0x80004005): Unable to create a new user process.
       at Appveyor.Utilities.ExternalProcess.Start(String commandLine, String workingDirectory, Boolean redirectStdErr, Action`1 consoleWrite, Dictionary`2 environmentVariables)
       at Appveyor.Utilities.ExternalProcess.ThreadedStart(Object obj)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at Appveyor.BuildAgent.BuildRunner.<RunScript>d__74.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Appveyor.BuildAgent.BuildRunner.<Build>d__23.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Appveyor.BuildAgent.BuildRunner.<StartAsync>d__16.MoveNext()
    
  3. 3 Posted by cshorler on 17 Nov, 2019 04:51 PM

    cshorler's Avatar

    monitoring the build agent from before the exception until the failure with procmon, just before the failure the following failure can be observed.

    3:53:05.5127205 PM   Appveyor.BuildAgent.Interactive.exe 4020    QueryOpen   C:\Windows\system32\Microsoft.PowerShell.Core\FileSystem::C:\projects\stepcode-m6l8m\build  NAME INVALID
    

    To me it looks like there's a missing conversion of the path to string

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • stepcode_build_1.0.29.txt 5.84 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

05 Dec, 2019 09:12 PM
04 Dec, 2019 07:46 PM
04 Dec, 2019 12:01 AM
04 Dec, 2019 12:00 AM
03 Dec, 2019 11:00 PM