Cook fails in 4.16 preview 1

When upgrading to 4.16 cooking our project stopped working with the following error:

[2017.04.30-00.41.46:086][971]UATHelper: Cooking (Windows): Cook: LogOutputDevice:Error: Ensure condition failed: GetSuperClass() [File:D:\Build++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\Engine\Private\BlueprintGeneratedClass.cpp] [Line: 1236]

Here is a complete cooking log:

I have not managed to reproduce this in a new project so here is our complete project split in to 10 files because it is closer to 10Gb in size:

http://valhalla-game.com/proj/valhalla-2017-04-30.part01.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part02.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part03.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part04.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part05.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part06.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part07.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part08.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part09.rar

http://valhalla-game.com/proj/valhalla-2017-04-30.part10.rar

To reproduce, simply open the project and cook for windows on a 4.16 version of unreal engine.

Hello PhroZenOne,

Thank you for reporting this issue. I downloaded the project and can confirm that I see the same issue when cooking content. From looking at the logs and the source code for the Ensure, the Ensure seems to be related to a null being returned. It seems to be related to certain assets, including but not limited to /Content/Assets/items/activatedItems/activatedItemHandler.uasset. If you still have your 4.15 version of this project, can you attempt migrating your content to a 4.16 project rather than doing a normal conversion? This seems like it could be a conversion issue if you’re unable to reproduce it in a fresh project.

I do have the 4.15 version available. By Migrating do you mean start a new project and then export/import to the new project?

I’m referring to the content migration that is available in the editor. You can right-click assets (or folders) and select “Migrate…” under Bulk Actions. This will let you pick a project’s content folder that you would like to migrate to and take care of the migration for you.

We are having the same issue cooking with 4.16.1 and 4.16.2. It works fine with 4.15.1.

See attached log of relevant ensure errors. We tried deleting all logic inside the functions contained in the BP_ShipDesignManager.uasset without success.

link text

We have temporarily worked around this issue by removing all references in our unit pawn BP to the asset with the ensure errors. It may have been caused by a circular reference, although this hasn’t been a problem in previous engine versions.

Hello Raf,

Is this issue fixed for you then? Have you been able to confirm if it was a circular reference problem?

@PhroZenOne, Have you been able to try migration to see if it can help with your issues?

Hi.

What I have tried so far: migrating the asset (and its about 1000 related assets) you mentioned previously to a blank project and it did not work. The migration failed with errors and due to gui constraints I had a hard time reading the error (se attached image)

Migrating the asset from a 4.15 version to a 4.16 version of the same project did work but without any change I’m afraid. I could send you a 4.15 version of the project as well if you want it?

Hi Matthew, I was able to fix the problem this way:

We had 2 UMG BPs calling a function in our BP_UnitPawn. The function would get custom data component instance variables from BP_ShipDesignManager (which was the uasset just before the ensure message errors during packaging).

Changed so the UMG BPs would instead pass-in the variables to the function in our BP_UnitPawn class. This way BP_UnitPawn would not reference BP_ShipDesignManager (leaving only one way references in the opposite direction).

This in itself did not work on it’s own. I also had to delete and re-create the related functions in BP_UnitPawn. Note also the cooking sometimes fails during this process if the engine isn’t restarted.

@matthew-clark Any news on this? We really want to migrate to 4.16 due to stopping bugs in 4.15 (UE-32568) but we need to be able to cook the game.

Hello PhorZenOne,

I cooked your project again (not sure why this didn’t happen the first time) in 4.16 and it did fail to package. The issue is this:

LogInit:Display: Failure - 149 error(s), 5834 warning(s)

This is the error summary at the end. Your cooking is likely failing due to all of these warnings and the errors are likely just a symptom of them. As Raf did with his project, you’ll like need to fix the issues within your own project. Your cooking overall is failing due to ensures which usually indicates a problem with the project rather than the engine itself.

Hm. That does not make any sense to me. The project cooks fine on 4.15, switching to 4.16 breaks the build on items (like activatedItemHandler you mentioned previously) and those files did not previously produce any warnings.

Is there any way to check blueprints for corruption? Because it is not only a single file that is affected by this problem. activatedItemHandler is just the first problem, removing that one reveals another item and removing that reveals a third etc etc. I ended up removing over a hundred files before giving up,

What we need is to find the actual problem causing this and figure out how to fix the bugs in the engine that are causing the blueprints to fail. Randomly removing and re-create functions like Raf did in hopes that it will magically fix itself is not a reasonable way to work in the long run.

I had this issue to and you wouldn’t guess what it was, for me it was a class reference to an actor in a data table, the referenced actor was the Ensure condition, the error come from a datatable row handle reference within another actor once this reference was cleared to none the error disappeared, so this issue should be looked into because it seems to be looking at class reference to see if its valid or not and its breaking at some point.

I have this issue as well, and the three classes throwing the ensure conditions are children. The parent holds all the logic, and the children just call the logic. If I delete the three children and replace the references to the parent it packages (this unfortunately makes the game unplayable). I will try to update with a more detailed explanation but I have many more tests to run for gameplay to work and still being able to package the game.

This is happening in our game as well. We just updated to 4.16 from 4.15 and now we cannot cook because of the same error (Ensure condition failed: GetSuperClass() [File:D:\Build++UE4+Release-4.16+Compile\Sync\Engine\Source\Runtime\Engine\Private\BlueprintGeneratedClass.cpp] [Line: 1236]). We have far less warnings than PhroZenOne (135 warnings) and still receive this error, so I don’t think that is the solution.

Hey guys, we have same problem too!

We’re developing VR game and really want to migrate our project from 4.13 to 4.16.

The migration process went pretty well and now game is working fine, but we have trouble packaging it.
It doesn’t matter what configuration we build with (development, shipping) we always get those strange cooking errors:

log

Your error is in BP_ClassicPlayer its class is probably being called in another actor.

Fixed it by opening a copy in 4.18.0 and fixed all warnings and errors. There was a crash when opening the project in 4.18.0 and logs revealed it was crashing on 1 generated static mesh from a skeletal mesh to start with.

  1. I regenerated the static mesh in 4.16 suffixed with 2 to make it unique
  2. copy pasted the .uasset file into the 4.18.0 directory on exact same location using Windows Explorer
  3. Deleted the old file in 4.18.0 in Windows Explorer
  4. opened the project again in 4.18.0. No more crashing and it opened nicely.
  5. Wherever the old file was used, I set the new file.
  6. Checked the logs for other warnings and errors and fixed them all.

Afterwards I could package my project fine.
Although it could be if you package from scratch instead of incremental it could work as well. That as my next attempt if this one should have failed but luckily it worked for me at least.

Hope this helps someone!

just to add to this long post -

I originally arrived here a year ago - tried many suggestions from over the net
The bug was so painful.

You could dig deeper and deeper on ue4.16 and clear a few bps and get lost.
For a time I rolled back on git and compiles were fine … then something upset my project again two days ago and this dreaded error popped up!
I decided to attempt to hammer it out again -

I expect there are better debugging techniques … but by far the best solution for me was to install 4.17 - open the project - and immediatley it showed the culprits on the compile test. I believe that the compile manager or error messaging is far better.