Unreal AutomationTool "Failed to delete file" error 4.19 VXGI Build

Hi guys, have run into a bit of an issue with a finished project. When cooking from the editor window or from the project launcher it works just fine, but when trying to sue the command line and AUT (for later patching and updating purposes) I get an error and the command line process simply stops, you can find below the log file

Automation.ParseCommandLine: Parsing command line: BuildCookRun -project=D:/testpatch/02/_20180807/MG_ENV.uproject -noP4 -clientconfig=Shipping -serverconfig=Shipping -nocompileeditor -ue4exe=UE4Editor-Cmd.exe -utf8output -platform=Win64 -targetplatform=Win64 -build -cook -map=MG_ENV_01 -unversionedcookedcontent -pak -createreleaseversion=v1.0 -compressed -stage -package -cmdline=“MG_ENV_01 -Messaging” -addcmdline=“-SessionId=D233A6244A20C241911CCD80F433AF81 -SessionOwner=‘pek_user01’ -SessionName=‘Release’” -compile
Automation.Process: Setting up command environment.
InternalUtils.SafeFileExists: SafeFileExists C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Binaries\DotNET\AutomationTool.exe=True
InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_LOCAL_ROOT=
InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_LOCAL_ROOT=
InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_EngineSavedFolder=
CommandUtils.SetEnvVar: SetEnvVar uebp_EngineSavedFolder=C:/REALTIME/UnrealEngine-VXGI2-4.19/Engine/Programs/AutomationTool/Saved
InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_EngineSavedFolder=C:/REALTIME/UnrealEngine-VXGI2-4.19/Engine/Programs/AutomationTool/Saved
InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_CSVFile=
InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_LogFolder=
CommandUtils.SetEnvVar: SetEnvVar uebp_LogFolder=C:/REALTIME/UnrealEngine-VXGI2-4.19/Engine/Programs/AutomationTool/Saved/Logs
InternalUtils.SafeDeleteFile: SafeDeleteFile C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Programs\AutomationTool\Saved\Logs\UAT_Log.txt
InternalUtils.SafeFileExists: SafeFileExists C:\WINDOWS\system32\robocopy.exe=True
InternalUtils.SafeFileExists: SafeFileExists C:\WINDOWS\system32\mount.exe=False
InternalUtils.SafeFileExists: SafeFileExists C:\WINDOWS\Sysnative\mount.exe=False
InternalUtils.SafeFileExists: SafeFileExists C:\WINDOWS\system32\cmd.exe=True
CommandUtils.SetEnvVar: SetEnvVar MallocNanoZone=0
InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_UATChildInstance=0
InternalUtils.SafeDeleteDirectory: SafeDeleteDirectory C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Binaries\DotNET\AutomationScripts
InternalUtils.SafeDeleteFile: SafeDeleteFile C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Binaries\DotNET\AutomationUtils.Automation.dll
InternalUtils.SafeDeleteFile: WARNING: Failed to delete file C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Binaries\DotNET\AutomationUtils.Automation.dll in 10 attempts.
InternalUtils.SafeDeleteFile: WARNING: Exception in mscorlib: Access to the path ‘C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Binaries\DotNET\AutomationUtils.Automation.dll’ is denied.
InternalUtils.SafeDeleteFile: Stacktrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
InternalUtils.SafeDeleteFile: at System.IO.File.InternalDelete(String path, Boolean checkHost)
InternalUtils.SafeDeleteFile: at AutomationTool.InternalUtils.SafeDeleteFile(String Path, Boolean bQuiet) in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 100
ExceptionUtils.PrintExceptionInfo: ==============================================================================
ExceptionUtils.PrintExceptionInfo: ERROR: Failed to delete file ‘C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Binaries\DotNET\AutomationUtils.Automation.dll’
ExceptionUtils.PrintExceptionInfo: (see C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Programs\AutomationTool\Saved\Logs\UAT_Log.txt for full exception trace)
ExceptionUtils.PrintExceptionInfo:
ExceptionUtils.PrintExceptionInfo: AutomationException: Failed to delete file ‘C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Binaries\DotNET\AutomationUtils.Automation.dll’
ExceptionUtils.PrintExceptionInfo: at AutomationTool.CommandUtils.DeleteFile(String FileName) in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandUtils.cs:line 465
ExceptionUtils.PrintExceptionInfo: at AutomationTool.ScriptCompiler.CleanupScriptsAssemblies() in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\AutomationUtils\ScriptCompiler.cs:line 320
ExceptionUtils.PrintExceptionInfo: at AutomationTool.ScriptCompiler.FindAndCompileAllScripts(String ScriptsForProjectFileName, List1 AdditionalScriptsFolders) in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\AutomationUtils\ScriptCompiler.cs:line 69 ExceptionUtils.PrintExceptionInfo: at AutomationTool.Automation.Process(String] Arguments) in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 496 ExceptionUtils.PrintExceptionInfo: at AutomationTool.Program.MainProc(Object Param) in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\Program.cs:line 132 ExceptionUtils.PrintExceptionInfo: at AutomationTool.InternalUtils.RunSingleInstance(Func2 Main, Object Param) in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 712
ExceptionUtils.PrintExceptionInfo: at AutomationTool.Program.Main() in C:\REALTIME\UnrealEngine-VXGI2-4.19\Engine\Source\Programs\AutomationTool\Program.cs:line 62
ExceptionUtils.PrintExceptionInfo: ==============================================================================
Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)

Seems to fail to delete some files, I tried running the CMD as administrator, but didn’t fix the problem, any ideas are more than welcome!

facing the same issue. did you find any solutions?

Hi, I don’t remember exactly how I fixed this, it was a while ago, it might have been because the engine was on C: drive