Can't package my project because of "Ensure condition failed"

Hello! File is deleted, can you attach logs again?

I’ve been trying to package my project for about a week now and i don’t know what to do anymore. here’s some backstory:

I have been working on a project for about a year now and i had a “crunch time” recently that lasted like a month or so. The last time i remember the game was packaging successfully was before that Crunch time. I don’t have a backup for that, but i have one for like 4 months ago.

Everytime i try to backup my project i get a “Ensure condition failed”, not only one but 8 (i did a search for this term on the output log).

I found some forum posts saying that it could be an asset or variable that got corrupted, so i should try to zero in on what this could be. So with this info i made several backups of the game, where on each one i would delete folders and assets, then make notes if the errors would go down from 8.

I found out that 5 of those are coming from my actor health component, if i delete it, they would be gone.

The other 3 where coming out of my enemyAI component.

Now here is the part that is making me a little bit desparate:

if i try to delete or change variables in the component, to see if i can remove the corrupted variable, my error count go from 8 to 22… also, if i try to remove the health component after that the errors would be ever higher (something like 30+)

Also, a bunch of errors were saying that it was because of a behavior tree, specifically a decorator from a behavior tree. Well, i deleted every single behavior tree, task, decorator, service and blackboard i have on the project and i still have the errors, but multiplied.

I guess that by forcefully deleting assets can cause more errors to show up, but why did it go down after deleting it first thing?

I scavenged on every single post on this issue i could find and could not find a solution. Can someone shine some light to help me?

here’s one of the crash logs i had:

thank you so much for your attention

will, do. just give me a sec
also, i am keeping some notes on the errors so i can understand it better:


Debugging

error message - (LogOutputDevice: Error: === Handled ensure: ===)
Results - Total {

2x LogOutputDevice: Error: === Handled ensure: ===
2x Packaging (Windows (64-bit)):   LogOutputDevice: Error: === Handled ensure: ===
1x Packaging (Windows (64-bit)):   LogInit: Display: LogOutputDevice: Error: === Handled ensure: ===
	}
Results - Inside HealthComponent {

	2x LogOutputDevice: Error: === Handled ensure: ===
	1x Packaging (Windows (64-bit)):   LogOutputDevice: Error: === Handled ensure: ===
}

Results - Inside enemy folder { TBD where each error is }

NOTES – If you delete all functions and variables from health component, 5 errors become 7 (probably because other blueprints are referencing
lost variables that were deleted. Maybe the problem is not inside the health component itself, but on actors that may have variables that were
deleted from the health component in the past (check all references to health component to see who references it)

I think i managed to figure it out!
Here’s what i did and some tips, in case you are struggling with this too:

First, make 1 backup of the project you currently have, save it in a folder called “FIX” or something like that. Call it Checkpoint1.
Now, duplicate checkpoint1 and call it “Current”.

Use the Current one, then proceed to slowly delete folders off of your game (Do not delete them inside unreal itself, it’s best if you: Close unreal, delete inside the windows folder for the current project, re-open unreal and try to package again, this way you won’t break anything (or at least not immediately) and make even more errors on your project)
Target a search word on the output log, something like << LogOutputDevice: Error: === Handled ensure: === >> (without the <<>>) that term shows up on the first line for each time this error shows. This way you can keep track if the amount of errors will go down as you delete each folder.

Now, after you find a folder that was causing errors , note that down and try to get as precise as possible (subfolders and/or blueprints)

It’s also worth mentioning that every time you screw up or you make some errors, you can always delete the current folder and make another copy of the checkpoint1 folder.

Now that you know exactly what bp or folder is “corrupted”, make one last current folder for this checkpoint. On this folder, you now need to delete this bp or folder inside unreal itself, but remove every connection this folder has with other assets (everytime you try to delete it, it will say that it has connections with other blueprints, go inside each one and remove these connections, could be a node that is calling a function on the blueprint you want to delete, things like that).
After sucessfully deleting it and seeing that the error count is down, congratulations, you just got to checkpoint2.
duplicate the Current folder and call it checkpoint2.
Proceed doing this until you have no more LogOutputDevice: Error: === Handled ensure: === errors.

Now is when the fun part starts, you will have to remake all broken assets you deleted from scratch and re-connect to the references you had before. I’m still doing this part of the process but i’m confident i can re-do it while paying close attention to my logs on packaging.
What i recommend is that you open up your old project on another monitor and re-trace your steps. I won’t be copying and pasting anything because i’m afraid of it causing the issue again.

Here is some tips that i’m going to take in order for this issue to never happen again:

  1. Have a backup tool ready. I’m using Arq6 which makes daily backups of my project for like 5 dollars a month, its the best thing ever if you are looking to have a reliable and good backup.

  2. package your game at least once a week. I had this errors for a while now and i did not notice them, since the game runs fine in the editor. If i had been packaging the game i would have found the error a lot sooner and i would be able to even roll back some days using the backup tool i told you about.

That’s it, i hope i can help if someone is as desperate as i was after facing an issue like this.

1 Like

This doesn’t solve your immediate goal, but look into version control in the future to alleviate coping projects