Can't Package my project (Error_UnknownCookFailure)

Hello,
I have errors in the Output Log when I open my project. I’ve been trying to package my game for Windows x64 for the last 3 or 4 days and couldn’t find the solution. I’ve already tried deleting Binaries, Build, Intermediate and Saved folders from the project before launching it again to let Unreal recreate these folders from blank. I also tried packaging a way simpler project using the same engine version (4.12.5) and plugins and it worked straight away.
The build configuration in the Packaging settings is Development.
Everything works perfect in editor but I cannot find a way to package successfully.
Our project uses more than 4700 assets so trying and verify them one by one would be suicide.

When I open the project I get these errors:

LogAutoReimportManager:Warning: Unable to watch directory ../../../../../Unreal Projects/ShatteredMankind/Content/ as it will conflict with another watching ../../../../../Unreal Projects/ShatteredMankind/Content/.

,

LogOutputDevice:Warning: === Handled error: ===
Ensure condition failed: DestinationExpression->AssociatedVarProperty [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Editor\KismetCompiler\Private\KismetCompilerVMBackend.cpp] [Line: 1045]

and

LogUObjectGlobals:Warning: Failed to find object 'Class None.'

And when I try to package it I get this:

begin: stack for UAT
LogWindows:Error: === Critical error: ===

Fatal error: [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Runtime\Foliage\Private\FoliageInstanceBase.cpp] [Line: 90] 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: Instance base cache - integrity verification(3): Counter: 60 Size: 17, InvSize: 15 (L:1 S:0 T:0)

MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: [2016.08.15-16.18.48:670][  0]LogOutputDevice:Error: 
MainFrameActions: Packaging (Windows (64-bit)): UE4Editor-Cmd: end: stack for UAT

[Cook Log] (MEGA)

[Output Log] (MEGA)

We can’t start our Kickstarter campaign until we can package the game.

Anyone who helps will get a free copy of the game when it hits Steam and his name in the credits :slight_smile:

Hey BlackHawk17,

The issue here looks related to: Unreal Engine Issues and Bug Tracker (UE-32774)

This issue was fixed in 4.13 and you can grab the commit on the issues page as well.

Give that a shot and let me know if it resolves the issue. If not, please post the new output log after attempting to package with that fix in and I’ll take a look at the other errors.

Thanks!

Thanks for the incredibly fast answer!
I’m downloading 4.13.0 Preview 1 and will try to package the project using this version of the engine.
I’ll keep you up to date but this might not work already since there also is an Ensure error:

Ensure condition failed: DestinationExpression->AssociatedVarProperty [File:D:\Build++UE4+Release-4.12+Compile\Sync\Engine\Source\Editor\KismetCompiler\Private\KismetCompilerVMBackend.cpp] [Line: 1045]

Hello.
We found the map that was causing this fatal error of foliage. We couldn’t open this map or even right click it without having the project crashing so we made a backup of it and deleted it until we can update the project to 4.13.
Now when we open or package the project we run into another error that was already mentioned above.

Ensure condition failed: DestinationExpression->AssociatedVarProperty [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Editor\KismetCompiler\Private\KismetCompilerVMBackend.cpp] [Line: 1045]

[Cook Log] (MEGA)

[Output Log] (MEGA)

I’m investigating the ensure that you’re receiving. However, in the meantime, take a look at the block of error messages below and see if you can work on resolving those:

LogInit:Display: LogSubstanceCore:Error: No parent instance found for this SubstanceTexture2D (SubstanceTexture2D /Game/Substance/CeramicTiles/lol/CeramicTile_INST_ao.CeramicTile_INST_ao). You need to delete the texture.
    
LogInit:Display: LogSubstanceCore:Error: No parent instance found for this SubstanceTexture2D (SubstanceTexture2D /Game/Substance/CeramicTiles/lol/CeramicTile_INST_basecolor.CeramicTile_INST_basecolor). You need to delete the texture.
    
LogInit:Display: LogSubstanceCore:Error: No parent instance found for this SubstanceTexture2D (SubstanceTexture2D /Game/Substance/CeramicTiles/lol/CeramicTile_INST_roughness.CeramicTile_INST_roughness). You need to delete the texture.
    
LogInit:Display: LogSubstanceCore:Error: No parent instance found for this SubstanceTexture2D (SubstanceTexture2D /Game/Substance/CeramicTiles/lol/CeramicTile_INST_normal.CeramicTile_INST_normal). You need to delete the texture.
    
LogInit:Display: LogSubstanceCore:Error: No parent instance found for this SubstanceTexture2D (SubstanceTexture2D /Game/Substance/CeramicTiles/lol/CeramicTile_INST_height.CeramicTile_INST_height). You need to delete the texture.
    
LogInit:Display: LogSubstanceCore:Error: No parent instance found for this SubstanceTexture2D (SubstanceTexture2D /Game/Substance/CeramicTiles/lol/CeramicTile_INST_curvature.CeramicTile_INST_curvature). You need to delete the texture.

Hi,
We managed to get rid of these Substance Textures errors, thus reducing the number of packaging errors from 14 to 2.
I searched for keywords like “error”, “fail”, etc but couldn’t find a clue about the last 2 errors. I assume it’s related to the Ensure that you’re investigating.

Here are the logs
[Cook Log] (MEGA)
[Output Log] (MEGA)

Thanks alot for the amazing support.

Awesome, glad to hear you were able to resolve those other error messages.

Do me a favor, go ahead and run a debug crash (open the console and type ‘debug crash’ without the quotes) (even on a clean project, if you’d like) and when the project crashes and the CR window appears, copy your Machine ID and paste it into a comment here. I’d like to see if I can look up the ensure in our system using your Machine ID.

Oddly the CR window won’t show up in a 4.12.5 project.
However I managed to make it appear by making a 4.10 project crash.
Maybe I should report this as a bug?

Here’s my machine ID:
F2B0387949775C9989998484B77B5FC3

As far as the CR window not appearing, take a look at this post, as this has already been reported and resolved by several users: https://answers.unrealengine.com/questions/453736/engine-crashes-instantly-what-to-do.html

Unfortunately, the ensure was not showing up in our database. I’ll go ahead and continue to investigate the issue. If you would be able to provide a copy of the project that I can download off of Dropbox, that would be extremely helpful in the investigation. You can PM me a link on the forums: https://forums.unrealengine.com/member.php?160394-Sean-Flint

The project takes 8 gb and Dropbox only allows for 2 gb. Can i upload it on [MEGA] (https://mega.nz/) like I did previously with the logs?
I already deleted the Saved folder which reduced the project’s size to half so I can’t do much except zipping it

That should be fine, thanks!

By the way,
I found these posts where someone ran into the same ensure problem

Ensure condition failed: DestinationExpression->AssociatedVarProperty [File:D:\Build\++UE4+Release-4.12+Compile\Sync\Engine\Source\Editor\KismetCompiler\Private\KismetCompilerVMBackend.cpp] [Line: 1045]

and apparently found a solution.

[Post 1] (https://answers.unrealengine.com/questions/431204/begin-stack-for-uat-packaging-error.html)
[Post 2] (https://answers.unrealengine.com/questions/418856/how-can-i-narrow-down-the-cause-of-this-handled-er.html)
In post 1 the person gets redirected to post 2.
I tried reproducing it but got stuck at the stage where I have to set a breakpoint on the line 1045 of KismetCompilerVMBackend.cpp
I couldn’t understand the following steps.

If you’re unable to find the error by setting that breakpoint and stepping through the code, I’d recommend trying the other method the user mentioned:

The other approach I see people take with these issues is to start a new empty Blueprint project, and start migrating their Content over, one by one, until the error comes back, or they are fully migrated and have escaped the issue. If the error comes back, then just note which Uasset was migrated when the error returned, and you’ve at least narrowed it down to a single asset.

I actually couldn’t find the error by setting the breakpoint because I didn’t know how to test that breakpoint. I set the breakpoint but don’t know how to make it find the error.
Could you help me find the error through this breakpoint?
By the way, I just sent you a PM with a link to the project.
Thanks

When you set the breakpoint, you’ll need to step through the code until your error is triggered. Here is some good documentation that will help you understand how to do this: Navigating through Code with the Debugger - Visual Studio 2015 | Microsoft Docs

If you’re unfamiliar with debugging code in this manner, I’d recommend using the other approach that was mentioned, meaning start to migrate your content into a clean project until you get that error to appear. It’s tedious, but it’s the best way to determine which asset is causing the error in your project.

OK I found the issue.
Whenever i change the default GameMode to a custom GameMode (be it in the project settings or in the world settings of any map) the “ensure 1045” error shows up.
This error also appears when I open up the Maps & Modes section in the Project Settings if the GameInstance of that Maps & Modes section is set to a custom class.
The project always freezes for a good 5 seconds before this error pops up.
I tried migrating the content to a new empty project to make sure but same result.
How can i fix it?

Glad to hear that you narrowed down the cause.

  • Does this only occur with the game mode you migrated from your previous project?
  • Can you reproduce the ensure in a clean project without using your migrated assets?
  • If so, please provide a detailed list of repro steps.

Hello,
That ensure 1045 error appears even with a new empty GameMode. But if this new empty GameMode is set to use default classes for the HUD, PlayerController, GameState and PlayerState the error doesn’t appear. Yet as soon as I set one of these properties to a custom one the error shows up.
However if I create a new empty project and create a custom empty GameMode with its custom empty classes, the ensure error doesn’t appear.

I see that you’re working with some external plugins. Have you attempted to make a copy of your project, remove the plugins, and see if you are able to get the same results?

Since you’re unable to reproduce the issue in a clean project, this leads me to believe there could be some issue with the plugins.

Hello,
I tried deactivating all plugins used in this project. It then asks me to relaunch the project. I accept and it closes the project but then crashes when trying to launch it again.
Could you try to debug the Ensure 1045 error? I sent you a PM with a link to the project as you asked some days ago.
I really think trying to solve it by checking the assets one by one like I’m doing is not working. So far all I’ve got is the engine to crash :frowning:
You seem to know alot more than me about debugging.