Cant cook content for windows or package game

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)

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

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

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.

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

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

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.

3 Likes

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

2 Likes

Solved it for me too (UE5.2)