# Cant cook content for windows or package game

**URL:** <https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762>\
**Category:** Platform & Builds\
**Tags:** Cooking, Behavior-Tree, decorator, unreal-engine, packaging-projects, question\
**Created:** [January 3, 2017, 6:35am UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762 "2017-01-03T06:35:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_50dbe045](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_50dbe045](https://forums.unrealengine.com/u/anonymous_user_50dbe045)\
**Post date:** [January 3, 2017, 6:35am UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/1 "2017-01-03T06:35:03Z")

</div>

Hello. I have been working on a project for quite some time now and recently have been unable to cook or compile my project for testing and distribution. After several waves of looking through the error logs and eliminating issues i have been left with one which i cant determine the cause and it seems to be the reason that i am unable to compile/cook.

This line appears in the log, however i never dabbled in C++ for this project. It is all in blueprint.  
“Ensure condition failed: ObservedKeyNames.Num() \> 0 [File:D:\Build++UE4+Release-4.13+Compile\Sync\Engine\Source\Runtime\AIModule\Private\BehaviorTree\Decorators\BTDecorator\_BlueprintBase.cpp] [Line: 67]”

I do however use behavior trees and decorators, though after looking through them i cant identify what the issue could possibly be. If anyone could provide some input or advice on what could be the issue I would be grateful.

Here is a copy of the cook log that contains the error  
link text

Oh i should probably add that i have tried creating new projects and they compile just fine.

After some more testing i noticed that this appears in the output log every time i open the project up

```
LogStats: FPlatformStackWalk::StackWalkAndDump - 0.540 s
LogOutputDevice:Error: === Handled ensure: ===
LogOutputDevice:Error: Ensure condition failed: ObservedKeyNames.Num() > 0 [File:D:\Build\++UE4+Release-4.13+Compile\Sync\Engine\Source\Runtime\AIModule\Private\BehaviorTree\Decorators\BTDecorator_BlueprintBase.cpp] [Line: 67]
LogOutputDevice:Error: Stack: 
LogOutputDevice:Error: UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:183]
LogOutputDevice:Error: UE4Editor-Core.dll!FDebug::EnsureFailed() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:297]
LogOutputDevice:Error: UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\core\private\misc\outputdevice.cpp:432]
LogOutputDevice:Error: UE4Editor-AIModule.dll!UBTDecorator_BlueprintBase::PostLoad() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\aimodule\private\behaviortree\decorators\btdecorator_blueprintbase.cpp:67]
LogOutputDevice:Error: UE4Editor-CoreUObject.dll!UObject::ConditionalPostLoad() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\obj.cpp:810]
LogOutputDevice:Error: UE4Editor-CoreUObject.dll!EndLoad() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1553]
LogOutputDevice:Error: UE4Editor-CoreUObject.dll!LoadPackageInternalInner() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1228]
LogOutputDevice:Error: UE4Editor-CoreUObject.dll!LoadPackage() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\coreuobject\private\uobject\uobjectglobals.cpp:1400]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!UEditorEngine::Map_Load() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\editorserver.cpp:2399]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!UEditorEngine::HandleMapCommand() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\editorserver.cpp:5998]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!UEditorEngine::Exec() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\editorserver.cpp:5479]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!UUnrealEdEngine::Exec() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\unrealedsrv.cpp:624]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!FEditorFileUtils::LoadMap() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\filehelpers.cpp:2252]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!FEditorFileUtils::LoadDefaultMapAtStartup() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\filehelpers.cpp:3480]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!FUnrealEdMisc::OnInit() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\unrealedmisc.cpp:302]
LogOutputDevice:Error: UE4Editor-UnrealEd.dll!EditorInit() [d:\build\++ue4+release-4.13+compile\sync\engine\source\editor\unrealed\private\unrealed.cpp:89]
LogOutputDevice:Error: UE4Editor.exe!GuardedMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\launch.cpp:140]
LogOutputDevice:Error: UE4Editor.exe!GuardedMainWrapper() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
LogOutputDevice:Error: UE4Editor.exe!WinMain() [d:\build\++ue4+release-4.13+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
LogOutputDevice:Error: UE4Editor.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
LogOutputDevice:Error: KERNEL32.DLL
LogOutputDevice:Error: ntdll.dll
LogOutputDevice:Error: ntdll.dll
LogStats: SubmitErrorReport - 0.000 s
LogStats: SendNewReport - 0.581 s
LogStats: FDebug::EnsureFailed - 1.122 s
LogAIModule: Creating AISystem for world SurvivalMapV2
LogEditorServer: Finished looking for orphan Actors (0.000 secs)

```

---

<div class="post-metadata">

**Author:** ![MieszkoZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MieszkoZ](https://forums.unrealengine.com/u/MieszkoZ)\
**Post date:** [January 3, 2017, 12:51pm UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/2 "2017-01-03T12:51:30Z")

</div>

This means you have a BP-implemented BT decorator, that uses BB keys, its instance is set to abort lower priority or self or both, but the BB key is not set. Go through your BT decorators and validate the setup.

Cheers,

–mieszko

---

<div class="post-metadata">

**Author:** ![Gomo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gomo](https://forums.unrealengine.com/u/Gomo)\
**Post date:** [August 22, 2017, 5:12pm UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/3 "2017-08-22T17:12:00Z")

</div>

with about 30 BTs it should be some log mentioning in which BT it actually breaks up this ensure condition.

---

<div class="post-metadata">

**Author:** ![Narg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/narg/32/870597_2.png) [@Narg](https://forums.unrealengine.com/u/Narg)\
**Post date:** [September 15, 2017, 12:22am UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/4 "2017-09-15T00:22:19Z")

</div>

I’ve just found this problem as well, we really need a log of extra information to tell us at least what BT is causing the issue.

---

<div class="post-metadata">

**Author:** ![Gomo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Gomo](https://forums.unrealengine.com/u/Gomo)\
**Post date:** [December 7, 2018, 10:53pm UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/5 "2018-12-07T22:53:19Z")

</div>

OK, it is almost 2 years since this issue was brought up. Is there any movement in that department?

---

<div class="post-metadata">

**Author:** ![zlspradlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@zlspradlin](https://forums.unrealengine.com/u/zlspradlin)\
**Post date:** [August 1, 2020, 3:21pm UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/6 "2020-08-01T15:21:27Z")

</div>

Just added bots to our game, now have this issue, can’t find 1 answer that solves the issue.

---

<div class="post-metadata">

**Author:** ![glaucobacchi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@glaucobacchi](https://forums.unrealengine.com/u/glaucobacchi)\
**Post date:** [September 13, 2020, 11:17am UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/7 "2020-09-13T11:17:34Z")

</div>

I have found a different scenario that can cause the same error when packaging:

I was using a blueprint Decorator which used zero Blackboard Keys and I kept getting the same error.

When I added a dummy Blackboard Key Selector variable to my Decorator and made it editable I was able to package my game.

I could find no easy way to track down which Decorator was giving the error and it worked fine in Play In Editor so I resorted to creating a minimal level with one bot and a minimal Behavior Tree. I then tested each Decorator in turn until one failed to package.

---

<div class="post-metadata">

**Author:** ![Klian](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/klian/32/1207571_2.png) [@Klian](https://forums.unrealengine.com/u/Klian)\
**Post date:** [January 19, 2023, 6:12am UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/8 "2023-01-19T06:12:52Z")

</div>

> [@glaucobacchi](#):
>
> I added a dummy Blackboard Key Selector variable to my Decorator and made it editable I was able to package my game

You saved my day, even on UE5.1 this bug still exist.  
Thank you so much

---

<div class="post-metadata">

**Author:** ![jacksonnexhip](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jacksonnexhip/32/494650_2.png) [@jacksonnexhip](https://forums.unrealengine.com/u/jacksonnexhip)\
**Post date:** [September 2, 2023, 5:17am UTC](https://forums.unrealengine.com/t/cant-cook-content-for-windows-or-package-game/380762/10 "2023-09-02T05:17:33Z")

</div>

> [@glaucobacchi](#):
>
> When I added a dummy Blackboard Key Selector variable to my Decorator and made it editable I was able to package my game.

Solved it for me too (UE5.2)
