Hi all,
Our development team has been blocked by this Unknown Cook Failure when packaging for Win64 in the editor for quite a while now and we are really running out of ideas to resolve it. If you google for this issue within the Unreal Forums you will find roughly 8 pages of people struggling with this same vague error. We have pursued a number of avenues to resolve this (highlighted below) but only with marginal success. The issue seems to be resolved when we disable our AWSAPIGateway plugin, which is just the header files and lib/dlls files built from the apigateway part of the aws-cpp-sdk and integrated into Unreal’s build system. We do exactly the same thing for the AWSCore and have no issues. What is really strange is that I must have done 30+ builds with both plugins enabled with exactly the same code interacting with them and had no issues. It just randomly broke. Even weirder is when I rollback our git commits to a time when it was able to build it now gives me the same error. This makes me think that maybe the error is coming from a file git is ignoring.
Attached is the build logs of a failed build with the APIGateway plugin enabled Game_Failure_AfterEngineRebuild.log.txt (349 KB) , the automation tool log from a failed build (from UnrealEngine\Engine\Programs\AutomationTool\Saved\Logs\Log.txt) Game_Failure_UAT_Log.txt (166 KB) , a successful build with the APIGateway plugin disabled (to show that some of the warnings are common in both and have no effect on whether it builds or not) Game_Success_APIGatewayDisabled_AfterEngineAndProjectReClone.log.txt (269 KB) , and the gitignore we are using gitignore.txt (1.26 KB).
I did have to edit the logs slightly for company confidentiality reasons, but all the relevant information should be there.
We are using a source build of UE4.21.2 by the way, as we need to compile dedicated server builds. We are always doing a “Development” package, not “Shipping”. Source Control is git and git lfs.
The best error trace comes from the automation tool log, but we have not had much luck finding the cause of error from it:
Log.WriteException: CommandletException: Editor terminated with exit code -1073741819 while running Cook for C:\MYGAME\MyGame.uproject; see log D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Programs\AutomationTool\Saved\Logs\Cook-2020.02.10-18.22.49.txt
Log.WriteException: at AutomationTool.CommandUtils.RunCommandlet(FileReference ProjectName, String UE4Exe, String Commandlet, String Parameters, String& DestLogFile) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandletUtils.cs:line 424
Log.WriteException: at AutomationTool.CommandUtils.RunCommandlet(FileReference ProjectName, String UE4Exe, String Commandlet, String Parameters) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandletUtils.cs:line 237
Log.WriteException: at AutomationTool.CommandUtils.CookCommandlet(FileReference ProjectName, String UE4Exe, String] Maps, String] Dirs, String InternationalizationPreset, String] CulturesToCook, String TargetPlatform, String Parameters) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\CommandletUtils.cs:line 89
Log.WriteException: at Project.Cook(ProjectParams Params) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\CookCommand.Automation.cs:line 249Wrapped by AutomationException: Cook failed.
Log.WriteException: at Project.Cook(ProjectParams Params) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\CookCommand.Automation.cs:line 263
Log.WriteException: at BuildCookRun.DoBuildCookRun(ProjectParams Params) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 209
Log.WriteException: at BuildCookRun.ExecuteBuild() in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\BuildCookRun.Automation.cs:line 41
Log.WriteException: at AutomationTool.BuildCommand.Execute() in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\BuildCommand.cs:line 242
Log.WriteException: at AutomationTool.Automation.Execute(List1 CommandsToExecute, Dictionary2 Commands) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 563
Log.WriteException: at AutomationTool.Automation.Process(String] Arguments, StartupTraceListener StartupListener) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Automation.cs:line 533
Log.WriteException: at AutomationTool.Program.MainProc(String] Arguments, StartupTraceListener StartupListener) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 173
Log.WriteException: at AutomationTool.Program.<>cDisplayClass1_0.<Main>b2() in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 99
Log.WriteException: at AutomationTool.InternalUtils.RunSingleInstance(Func`1 Main) in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\Utils.cs:line 725
Log.WriteException: at AutomationTool.Program.Main() in D:\Program Files\Unreal-Source-Build\UnrealEngine\Engine\Source\Programs\AutomationTool\Program.cs:line 99
Log.WriteException: ==============================================================================
Program.Main: AutomationTool exiting with ExitCode=25 (Error_UnknownCookFailure)
What we have tried:
- Deleting the “.vs”, “Intermediate”, “Saves”, “Game.sln”, and “DerivedDataCache” files and folders. Then rebuilding the project “DevelopmentEditor” and “DevelopementServer” in VS, booting up editor, hitting the c++ compile button in the editor for good measure, building the maps again, and then packaging. Same error.
- Same as above but also deleting the “Config” folder.
- Cloning the project to a fresh folder and building from the ground up. Same Error.
- Deleting everything in the “Content” folder in the file explorer, recompile editor and server from VS, booting up editor, package… same error.
- Setting the APIGateway “LoadingPhase” to “Default”, rather than “PreDefault”. The APIGateway plugin depends on the AWSCore plugin in its Build.cs file so this makes sense. This seemed to solve the issue temporarily for one of our developers when he was building in a project with no content, but the error came back to haunt him.
- Resolving the APIGateway’s dependency on AWSCore warning that shows in the build log by adding it to the .uplugin text. Same error.
- As mentioned, rolling back to a commit which had the same code and setup for the APIGateway plugin what was packaging many times perfectly previously, now fails to package with the same **** error.
- Rolling back to before I added either plugin. It builds fine as expected.
- Building a different project with the same unreal source engine binaries, packages fine.
- Migrating just the aws plugins + GameServer.Target.cs to a brand new blank c++ project. Failed with same error. So I guess that means the error does not stem from the my C++ code that is interacting with my plugins?
- “Rebuilding” the UE4 source engine “DevelopmentEditor” and “DevelopementServer” in VS, then rebuilding the same in the game project. Same error.
- Removing all Unreal Engine installs (binary versions and source versions), deleting any trace of Unreal in my AppData. Re-cloning and rebuilding the entire engine, re-cloning and rebuilding our project in a clean folder (again editor and server for both engine and project) and I still get the same error. BUT one of our other developers, who did exactly the same process, doesn’t get the error and packages the project fine with the APIGateway plugin enabled. Soooo… the only thing I can think of is that he has or doesn’t have some file that was not deleted in the removal of the engines, what is not tracked by git, that I do or do not have that somehow causing the the build failure? Maybe it a strange driver, os, or compiler issue that only shows itself when building this plugin and only came into existence after the 30+ times that I built it successfully because it was automatically updated or something?
As you can see, I’m grasping at straws at this point so any help would be very much appreciated.
Thank you!