Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Automationtool error: failed to delete AutomationUtils.Automation.dll

We updated our engine to 4.21 and face the following error, when building from commandline:

Failed to delete file 'S:\Unreal\UE_4.21\Engine\Binaries\DotNET\AutomationUtils.Automation.dll' It seems strange that the very process which loaded the file, tries to delete it.

Our commandline:

 call RunUAT BuildCookRun -project="%Projectfile%" -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -compile -build -stage -pak

There is no antivirus installed (this system is windows 10,and disabled windowsdefender for testing purposes after error occured first time. no difference). We use VS 2017 with WIndows 10 SDK: We tested on 2 machines(Both windows 10, same vs and sdk) and had that behaviour on both.

We did not have that issue in 4.19 (we had to skip 4.20). The full log.txt:

 Automation.ParseCommandLine: Parsing command line: BuildCookRun -project=S:\Git\ProjContDev\ProjCont.uproject -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -cook -compile
 Automation.Process: Setting up command environment.
 InternalUtils.SafeFileExists: SafeFileExists S:\Unreal\UE_4.21\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=S:/Unreal/UE_4.21/Engine/Programs/AutomationTool/Saved
 InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_EngineSavedFolder=S:/Unreal/UE_4.21/Engine/Programs/AutomationTool/Saved
 InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_CSVFile=
 InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_LogFolder=
 CommandUtils.SetEnvVar: SetEnvVar uebp_LogFolder=S:/Unreal/UE_4.21/Engine/Programs/AutomationTool/Saved/Logs
 InternalUtils.SafeDeleteFile: SafeDeleteFile S:\Unreal\UE_4.21\Engine\Programs\AutomationTool\Saved\Logs\Log.txt
 InternalUtils.GetEnvironmentVariable: GetEnvironmentVariable uebp_FinalLogFolder=
 CommandUtils.SetEnvVar: SetEnvVar uebp_FinalLogFolder=S:/Unreal/UE_4.21/Engine/Programs/AutomationTool/Saved/Logs
 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 S:\Unreal\UE_4.21\Engine\Binaries\DotNET\AutomationScripts
 InternalUtils.SafeDeleteFile: SafeDeleteFile S:\Unreal\UE_4.21\Engine\Binaries\DotNET\AutomationUtils.Automation.dll
 InternalUtils.SafeDeleteFile: WARNING: Failed to delete file S:\Unreal\UE_4.21\Engine\Binaries\DotNET\AutomationUtils.Automation.dll in 10 attempts.
 InternalUtils.SafeDeleteFile: WARNING: Exception in mscorlib: Der Zugriff auf den Pfad "S:\Unreal\UE_4.21\Engine\Binaries\DotNET\AutomationUtils.Automation.dll" wurde verweigert.
 InternalUtils.SafeDeleteFile:          Stacktrace:    bei System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
 InternalUtils.SafeDeleteFile:             bei System.IO.File.InternalDelete(String path, Boolean checkHost)
 InternalUtils.SafeDeleteFile:             bei AutomationTool.InternalUtils.SafeDeleteFile(String Path, Boolean bQuiet) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:Zeile 100.
 Log.WriteException: ==============================================================================
 Log.WriteException: ERROR: Failed to delete file 'S:\Unreal\UE_4.21\Engine\Binaries\DotNET\AutomationUtils.Automation.dll'
 Log.WriteException:        (see S:\Unreal\UE_4.21\Engine\Programs\AutomationTool\Saved\Logs\Log.txt for full exception trace)
 Log.WriteException: AutomationException: Failed to delete file 'S:\Unreal\UE_4.21\Engine\Binaries\DotNET\AutomationUtils.Automation.dll'
 Log.WriteException:    bei AutomationTool.CommandUtils.DeleteFile(String FileName) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandUtils.cs:Zeile 488.
 Log.WriteException:    bei AutomationTool.ScriptCompiler.CleanupScriptsAssemblies() in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\ScriptCompiler.cs:Zeile 325.
 Log.WriteException:    bei AutomationTool.ScriptCompiler.FindAndCompileAllScripts(String ScriptsForProjectFileName, List`1 AdditionalScriptsFolders) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\ScriptCompiler.cs:Zeile 69.
 Log.WriteException:    bei AutomationTool.Automation.Process(String[] Arguments, StartupTraceListener StartupListener) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:Zeile 502.
 Log.WriteException:    bei AutomationTool.Program.MainProc(String[] Arguments, StartupTraceListener StartupListener) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\Program.cs:Zeile 173.
 Log.WriteException:    bei AutomationTool.Program.<>c__DisplayClass1_0.<Main>b__2() in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\Program.cs:Zeile 99.
 Log.WriteException:    bei AutomationTool.InternalUtils.RunSingleInstance(Func`1 Main) in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:Zeile 725.
 Log.WriteException:    bei AutomationTool.Program.Main() in D:\Build\++UE4\Sync\Engine\Saved\CsTools\Engine\Source\Programs\AutomationTool\Program.cs:Zeile 99.
 Log.WriteException: ==============================================================================
 Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)

Product Version: UE 4.21
more ▼

asked Feb 11 '19 at 07:50 PM in Packaging & Deployment

avatar image

135 4 12 15

avatar image andrearuggeri.sp Mar 15 '19 at 11:20 AM

Hello, I have the same problem, have you fixed it?

avatar image Memnarch Mar 18 '19 at 01:56 AM

Yes, added my solution as answer.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

we fixed it by removing the "-compile" switch which should result in it not recompiling itself. If the sourceversion is used or the problem still occurs, replacing the switch with "-nocompile" should do the trick.

more ▼

answered Mar 18 '19 at 01:56 AM

avatar image

135 4 12 15

avatar image Remi.B12 Mar 18 '19 at 10:58 AM

Also, I ran into the same problem and I had to recover the AutomationUtils folder that had been removed by a previous "-compile" command in order to make the "-nocompile" command run succesfully

avatar image andrearuggeri.sp Mar 18 '19 at 11:08 AM

How did you managed to recover the AutomationUtils folder?

avatar image Remi.B12 Mar 18 '19 at 11:12 AM

We are building our own InstalledBuild so we have archives of our engine files. I recovered it from there.

If you can't do that, I guess that rebuilding an installed build, or if you are using launcher version, hitting some repair button or redownloading your engine version should do the trick.

avatar image andrearuggeri.sp Mar 18 '19 at 11:15 AM

Oh ok, we are on a custom build too, I can recover files from the archive. I thoung tehre was a way to recreate it from the RunUAT for example

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question