Nested UChildActorComponent hierarchies error on save during cook (5.5)

Hello,

We have recently upgraded from 5.4 to 5.5 and encountered an intermittent cook error when trying to save non-spatially loaded actors placed in the world that have nested child actor components (specifically, a UChildActorComponent class set to a different BP that has its own internal child actor components).

The child actor at the bottom of the hierarchy hits the ‘EIllegalRefReason::ExternalPackage’ case in ‘ValidateRealms()’ and fails the cook. The error reports that this actor has a reference to its immediate parent - which still has its external package set to the outermost actor (the non-spatially loaded one) in the hierarchy.

Error: Can't save Game/<PROJECT>/Maps/<MAPNAME>: export (Maps/<MAPNAME>.<MAPNAME>:PersistentLevel.<GRANDCHILD_ACTOR>_GEN_VARIABLE_<GRANDCHILD_ACTOR_CLASS>) has a reference to export (Maps/<MAPNAME>.<MAPNAME>:PersistentLevel.<CHILD_ACTOR>_GEN_VARIABLE_<CHILD_ACTOR_CLASS>) which still has its external package set to (/Game/__ExternalActors__/Maps/<MAPNAME>/<EXTERNAL_ACTOR>).

We’ve struggled to reproduce the error consistently, and not at all in isolated test maps, but it is disruptive to our automated builds when content with this setup is present in the map being cooked.

Hey there, I’ve looked through internal bug reports and found a similar cook error in Fortnite in the past that was addressed by CL 39523200 on //UE5/Main.

Can you cherrypick that CL (if it’s compatible) and see if the cook error still occurs?

Hi Zhi,

Thanks for your response and suggestion. Unfortunately, we are still failing on these cook errors even after cherrypicking CL 39523200.

After some more testing today, we managed to repro the errors in an empty WP test map - with just a child actor hierarchy setup between any 3 BP actors (the outermost actor must still be set to non-spatially loaded). This repro varies in consistency across different machines, but might be worth trying on your end.

Hi Lorcan,

Could you attach the test map so that we can test it on our end?

Also, what’s the exact repo? Just keep cooking the test project until the error appears?

Thanks,

Dave

Hi Dave,

Apologies for the delayed response.

I’ve tried to get the repro in a test project using a vanilla 5.5 engine downloaded from the Epic Games Launcher, but haven’t had any success yet (I can update here if that changes).

The repro does just require cooking a map containing a child actor hierarchy setup as described above, until the error eventually crops up.

Thanks,

Lorcan

Hello,

Can you try to cook with a higher frequency of calls to the garbage collector? We are looking for a way to increase the rate of the problem so it is easier to debug.

You can do this by adding this argument to the cooking commandlet: -ini:Editor:[CookSettings]:PackagesPerGC=13

If you are using BuildCookRun, the following will forward the argument to the cooker: -AdditionalCookerOptions="-ini:Editor:[CookSettings]:PackagesPerGC=13"

Martin