Failed to launch cm shell

Jenkins setup:
Desktop Windows 10 Pro 10.0.19045, no docker or anything like that, just a Windows machine.
Jenkins Version 2.513
Jenkins logs in with the only user present which has admin privileges.
Unreal Engine Custom Source Build 5.4.4
Version Control: Unity Version Control

Hi!

We are using Jenkins to build and package our Unreal Engine game, although I think the core issue here does not have to do with UE but rather something Windows security/permissions related.

As of Windows update KB5051974 (release notes), we are getting the following error during the cooking command:

09:07:00 LogSourceControl: Error: RunCommand: ‘version’ TIMEOUT after 180.015s output (0 chars):
09:07:00 LogWindows: Warning: CreateProc failed: The filename, directory name, or volume label syntax is incorrect. (0x0000007b)
09:07:00 LogWindows: Warning: URL: cm shell --encoding=UTF-8 --enablestderr
09:07:00 LogSourceControl: Warning: Failed to launch ‘cm shell’

I used to be able to revert said windows update and the issue would be gone. However, it seems too much time has passed and so I cannot uninstall the update anymore.

This is the command I use to package the game:
"<UEBASEPATH>\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun -nop4 -project=<PROJECTPATH> -cook -stage -archive -archivedirectory=<ARCHIVEDIR> -package -clientconfig=Development -ueeexe=UEEditor-Cmd.exe -pak -prereqs -distribution -targetplatform=Win64 -build -utf8output

The <> have actual values in my command.
If I execute this command manually on the build machine, it works as intended.

I am desperate for help and would appreciate any input.

Thank you!

Do you execute the command as the same user that Jenkins is running as? Is the controller running ON Windows, or is this an agent? Can you output the environment for when you run it manually and also add a dump of the environment in your Jenkins?

Hi and thank you for your response!

Do you execute the command as the same user that Jenkins is running as?

As far as I know, yes. I am using the Execute Windows Batch File build step to execute it. This is all done in the Jenkins GUI, no custom scripts.

Is the controller running ON Windows, or is this an agent?

Unless I misunderstand, yes, the controller is running on Windows. Both Jenkins and the UE project are on the same machine.

Can you output the environment for when you run it manually and also add a dump of the environment in your Jenkins?

Manual:

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\VoodooBuild\AppData\Roaming
CLIENTNAME=JANNICK_LAPTOP
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=DESKTOP-BUILD
ComSpec=C:\Windows\system32\cmd.exe
DriverData=C:\Windows\System32\Drivers\DriverData
HOMEDRIVE=C:
HOMEPATH=\Users\VoodooBuild
LOCALAPPDATA=C:\Users\VoodooBuild\AppData\Local
LOGONSERVER=\\DESKTOP-BUILD
NINTENDO_SDK_ROOT=C:\Nintendo\NativeSDK19.3.11\NintendoSDK
NUMBER_OF_PROCESSORS=12
OneDrive=C:\Users\VoodooBuild\OneDrive
OS=Windows_NT
Path=C:\Program Files\PlasticSCM5\server;C:\Program Files\PlasticSCM5\client;C:\Program Files (x86)\SCE\Prospero SDKs\11.000\host_tools\bin;C:\Program Files (x86)\SCE\Common\SceVSI-VS17\bin;C:\Program Files (x86)\SCE\Prospero\Tools\Publishing Tools\bin;C:\Program Files (x86)\SCE\Prospero\Tools\Target Manager Server\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Nintendo\Nintendo Package Manager;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\SCE\Prospero\Tools\Razor GPU\bin\CommandTools\bin;C:\Program Files (x86)\SCE\Prospero\Tools\PS4 Razor GPU for Prospero\bin\CommandTools\bin;C:\Users\VoodooBuild\AppData\Local\Programs\Python\Python313\Scripts\;C:\Users\VoodooBuild\AppData\Local\Programs\Python\Python313\;C:\Users\VoodooBuild\AppData\Local\Microsoft\WindowsApps;C:\Users\VoodooBuild\.dotnet\tools;C:\Users\VoodooBuild\AppData\Local\GitHubDesktop\bin;C:\Nintendo\NativeSDK19.3.11\NintendoSDK\Tools\CommandLineTools
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL=25
PROCESSOR_REVISION=2102
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SCE_ENABLE_HOST_TOOLS_TELEMETRY=1
SCE_PROSPERO_SAMPLE_DIR=C:\Program Files (x86)\SCE\Prospero SDKs\11.000\target\samples
SCE_PROSPERO_SDK_DIR=C:\Program Files (x86)\SCE\Prospero SDKs\11.000
SCE_ROOT_DIR=C:\Program Files (x86)\SCE
SCE_SCREAM_TOOL=C:\Program Files (x86)\SCE\Prospero\Tools\Scream Tool\screamtool_siei\
SESSIONNAME=RDP-Tcp#29
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\VOODOO~1\AppData\Local\Temp
TMP=C:\Users\VOODOO~1\AppData\Local\Temp
USERDOMAIN=DESKTOP-BUILD
USERDOMAIN_ROAMINGPROFILE=DESKTOP-BUILD
USERNAME=VoodooBuild
USERPROFILE=C:\Users\VoodooBuild
windir=C:\Windows

Jenkins (redacted some info):

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\VoodooBuild\AppData\Roaming
BASE=C:\Program Files\Jenkins
BRANCH=main
bShouldUpload=true
BUILD_DISPLAY_NAME=#774
BUILD_ID=774
BUILD_NUMBER=774
BUILD_TAG=jenkins-CollectorsCove-774
BUILD_URL=REDACTED
CI=true
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=DESKTOP-BUILD
ComSpec=C:\Windows\system32\cmd.exe
CONFIGURATION=Development
DriverData=C:\Windows\System32\Drivers\DriverData
EXECUTOR_NUMBER=1
HOMEDRIVE=C:
HOMEPATH=\Users\VoodooBuild
HUDSON_COOKIE=71e03ca4-c350-4a02-861d-7aee5976fb0c
HUDSON_HOME=C:\Users\VoodooBuild\AppData\Local\Jenkins\.jenkins
HUDSON_SERVER_COOKIE=ab2a09b381f909e0
HUDSON_URL=REDACTED
JENKINS_HOME=C:\Users\VoodooBuild\AppData\Local\Jenkins\.jenkins
JENKINS_SERVER_COOKIE=ab2a09b381f909e0
JENKINS_URL=REDACTED
JOB_BASE_NAME=CollectorsCove
JOB_DISPLAY_URL=REDACTED
JOB_NAME=CollectorsCove
JOB_URL=REDACTED
LOCALAPPDATA=C:\Users\VoodooBuild\AppData\Local
LOGONSERVER=\\DESKTOP-BUILD
NINTENDO_SDK_ROOT=C:\Nintendo\NativeSDK16.2.3\NintendoSDK
NODE_LABELS=built-in
NODE_NAME=built-in
NUMBER_OF_PROCESSORS=12
OneDrive=C:\Users\VoodooBuild\OneDrive
OS=Windows_NT
Path=C:\Program Files\PlasticSCM5\server;C:\Program Files\PlasticSCM5\client;C:\Program Files (x86)\SCE\Prospero SDKs\11.000\host_tools\bin;C:\Program Files (x86)\SCE\Common\SceVSI-VS17\bin;C:\Program Files (x86)\SCE\Prospero\Tools\Publishing Tools\bin;C:\Program Files (x86)\SCE\Prospero\Tools\Target Manager Server\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\dotnet\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Nintendo\Nintendo Package Manager;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\SCE\Prospero\Tools\Razor GPU\bin\CommandTools\bin;C:\Program Files (x86)\SCE\Prospero\Tools\PS4 Razor GPU for Prospero\bin\CommandTools\bin;C:\Users\VoodooBuild\AppData\Local\Programs\Python\Python313\Scripts\;C:\Users\VoodooBuild\AppData\Local\Programs\Python\Python313\;C:\Users\VoodooBuild\AppData\Local\Microsoft\WindowsApps;C:\Users\VoodooBuild\.dotnet\tools;C:\Users\VoodooBuild\AppData\Local\GitHubDesktop\bin;C:\Nintendo\NativeSDK16.2.3\NintendoSDK\Tools\CommandLineTools
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PLASTICSCM_AUTHOR=REDACTED
PLASTICSCM_BRANCH=/main
PLASTICSCM_CHANGESET_GUID=c7da4578-aac9-434a-a2f9-71e6e05a3fb6
PLASTICSCM_CHANGESET_ID=4505
PLASTICSCM_REPSPEC=REDACTED
PLATFORM=Win64
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 2, AuthenticAMD
PROCESSOR_LEVEL=25
PROCESSOR_REVISION=2102
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=%ProgramFiles%\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
RUN_ARTIFACTS_DISPLAY_URL=REDACTED
RUN_CHANGES_DISPLAY_URL=REDACTED
RUN_DISPLAY_URL=REDACTED
RUN_TESTS_DISPLAY_URL=REDACTED
SCE_ENABLE_HOST_TOOLS_TELEMETRY=1
SCE_PROSPERO_SAMPLE_DIR=C:\Program Files (x86)\SCE\Prospero SDKs\11.000\target\samples
SCE_PROSPERO_SDK_DIR=C:\Program Files (x86)\SCE\Prospero SDKs\11.000
SCE_ROOT_DIR=C:\Program Files (x86)\SCE
SCE_SCREAM_TOOL=C:\Program Files (x86)\SCE\Prospero\Tools\Scream Tool\screamtool_siei\
SERVICE_ID=jenkins
STEAM_PASS=REDACTED
STEAM_USER=REDACTED
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\VOODOO~1\AppData\Local\Temp
TMP=C:\Users\VOODOO~1\AppData\Local\Temp
USERDOMAIN=DESKTOP-BUILD
USERDOMAIN_ROAMINGPROFILE=DESKTOP-BUILD
USERNAME=VoodooBuild
USERPROFILE=C:\Users\VoodooBuild
windir=C:\Windows
WINSW_EXECUTABLE=C:\Program Files\Jenkins\jenkins.exe
WINSW_SERVICE_ID=jenkins
WORKSPACE=C:\WS\Jenkins\CollectorsCove
WORKSPACE_TMP=C:\WS\Jenkins\CollectorsCove@tmp

Don’t know if this is relevant
The path to the NintendoSDK is different.
For Jenkins it is
C:\Nintendo\NativeSDK16.2.3\NintendoSDK\Tools\CommandLineTools
And locally it is
C:\Nintendo\NativeSDK19.3.11\NintendoSDK\Tools\CommandLineTools
so a newer version.
If the cm exectuable that fails is from the SDK that might be the cause.

I just changed it back to 16.2.3 so that is identical now and the error persists.
I am building for Windows right now so it shouldn’t matter anyway.

Thank you for your input though!

My question about running the command manually is when you run the command manually on the command line, are you logging in as the same user as Jenkins is running as?

Yes I am. There is only one user on that machine and the Jenkins service is configured to log on as that as well.

The only remaining thing I can think of is that the cm shell requires interacting with the desktop somehow, which generally speaking Windows services are not allowed to do. There used to be a checkbox in the services “Log On” area but that is no longer the case.

There are a couple of options:

  1. You can try bypassing this using this howto Q&A: Why doesn't "Allow service to interact with desktop" work? | The Core Technologies Blog
  2. You could run an agent in a desktop session and then it wouldn’t be running under a service account when the job ran

I would recommend the second approach (though it comes with its own issues, such as starting the agent automatically, etc.).

1 Like

So after creating a second Windows admin user and changing Jenkins to log on with that user, after reconfiguring everything to build there, it worked once. Then, the error started occuring again. I finally found out about the -IgnoreCookErrors flag from UAT and started using it and it worked.

Now, after multiple successful builds, the error doesn’t even show up anymore for some reason. So I have removed that flag again.

I will keep monitoring it but if the error occurs again I will just use the -IgnoreCookErrors flag even though it isn’t a long-term solution.

1 Like