Ensure condition failed: CurrentNum == InitialNum

Hello!

I’ve done some research on this, but everyone seems to have a different opinion, and really, I just want to know exactly what this means, because I do not.

I suspect it has something to do with the NVidia plugins (as, ever since I started using them, I’ve had issues) but I really do not know:

UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: begin: stack for UAT
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: === Handled ensure: ===
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error:
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: Ensure condition failed: CurrentNum == InitialNum [File:D:\build++UE5\Sync\Engine\Source\Runtime\Core\Public\Containers\Array.h] [Line: 256]
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: Array has changed during ranged-for iteration!
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: Stack:
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b886f69b UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b886ea23 UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9aa4975de UnrealEditor-KismetCompiler.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9aa46ae02 UnrealEditor-KismetCompiler.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9aa46f281 UnrealEditor-KismetCompiler.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9aa461f0a UnrealEditor-KismetCompiler.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b5b7c4a4 UnrealEditor-Kismet.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b5b79403 UnrealEditor-Kismet.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9c0781e30 UnrealEditor-CoreUObject.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9c0a48dd2 UnrealEditor-CoreUObject.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9c0a4935b UnrealEditor-CoreUObject.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9c0a7048e UnrealEditor-CoreUObject.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9c0c9d3f5 UnrealEditor-CoreUObject.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9c0c9b918 UnrealEditor-CoreUObject.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9c0c9beb6 UnrealEditor-CoreUObject.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b87a3924 UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b87a3b6c UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b87b6712 UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b87e2903 UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b87e1e97 UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b84cfe50 UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b848f323 UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff9b84adc6f UnrealEditor-UnrealEd.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff70f6f733f UnrealEditor-Cmd.exe!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff70f6ecfb6 UnrealEditor-Cmd.exe!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff70f6ed37a UnrealEditor-Cmd.exe!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff70f6f0854 UnrealEditor-Cmd.exe!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff70f706984 UnrealEditor-Cmd.exe!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ff70f708eb6 UnrealEditor-Cmd.exe!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa6af4e8d7 KERNEL32.DLL!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: [Callstack] 0x00007ffa6c17c5dc ntdll.dll!UnknownFunction
UATHelper: Packaging (Windows): LogInit: Display: LogOutputDevice: Error: end: stack for UAT

(*NOTE: THIS IS A GENERAL SOLUTION FOR MOST PACKAGE ISSUES)

What a nightmare this was:

So, the issue was not anything that I did. Deep within the metadata of one of my Blueprints, there was a corruption. Because this corruption was under the hood, I was not alerted until AFTER a full-project package.

Not only that, but because the corruption was not of my creation, the error message did not point me to any location.

Why?

Because Unreal would have to recognize that it is (itself) corrupted, and it’s almost certainly not going to do that on its own; there’s far too many unique instances of corruption for them to be documented sufficiently (for now…).

THE METHOD:

  1. (And this is VERY poorly documented) Use the “Validate Assets” function to run a validation pass on your assets.

BY FOLDER

BY ASSET

  1. (Again, VERY POOLY documented) When you run that pass, do NOT look at the MESSAGE LOG. You actually need to look at the OUTPUT LOG. They are NOT the same thing. (The MESSAGE LOG kept telling me that the Validation was a “success”, but then I’d see the bug again. The OUTPUT LOG is the KEY.)

  1. Go FOLDER BY FOLDER, until this error pops up.

  2. When it finally does pop up, you MUST restart Unreal Engine, because Validate Assets does not UPDATE. (Again, none of this is DOCUMENTED!!! So, you’ll think the error disappeared when you attempt to rescan.)

  3. After restarting Unreal, narrow your search in those folders for the asset, making sure to restart Unreal every time the error comes up.

  4. When you finally find the corrupt asset, you MUST quarantine it. If it contains code, you CANNOT DUPLICATE it. You must create a completely new Asset/Blueprint, and in SMALL BATCHES, copy the code over, making sure to run a validation pass on your new asset every time you add something.

  5. Once you have an exact REPLICA (NOT COPY!), make sure to DELETE that asset and REPLACE its references with the pop-up prompt.

  1. I CANNOT WAIT until AI takes over documentation, because if I did not have ChatGPT leading me in the right direction, I don’t know how long this would have taken.

PS: You can UPLOAD your ENTIRE LOG to ChatGPT, and it will scan it for you. Amazing stuff! But, in my case, because it was a bug with the Engine, it had no idea what was happening.