Content is missing from cook. Source package referenced an object in target package but the object was stripped out of the target package when saved.

Hello,

We are having, first random, now constant, cooking error in the build machines, of this nature:

LogCook: Error: Content is missing from cook. Source package referenced an object in target package but the object was stripped out of the target package when saved.

           Source package: /Game/Main/GPE/Breachable/BP\_GPE\_BreachableSoft\_P

           Target package: /Game/Main/GPE/Breachable/BP\_GPE\_BreachableBase

           Referenced object: /Game/Main/GPE/Breachable/BP\_GPE\_BreachableBase.BP\_GPE\_BreachableBase\_C:BP\_DestructibleComponent\_GEN\_VARIABLE

It always involves this BP_DestructibleComponent, but the source and target packages differ, although target package uses to be BP_GPE_BreachableBase.

If it helps somehow, this is the hierarchy of these elements:

[Image Removed]

On local devs machines, this happens very very rarely, and in my particular case, I can never repro locally despite running the cooking process exactly as the build machine does.

We have tried to disable DDC, delete saved and intermediate folders in the build machine, etc, with no success.

The very interesting fact is that we have tried to cook a different branch that has not been updated for more than a month and we are getting now the same cooking errors.

Do you have any ideas please?

We are pretty blocked with this issue.

Thank you,

Jose

There were known issues in 5.4 and 5.5 with deprecated blueprint variables that existed on disk and would be stripped by the blueprint compiler on load, but the information that they were stripped was lost during garbage collection that removed some of the objects in the package, and they would be readded by LinkerLoad code when imported from other packages, without asking the blueprint compiler whether they were still valid. This occurred more frequently in MPCook because garbage collection frequency is higher, and MultiProcessCook also uses soft GC (deletion of packages that have been saved but keeping the ones that are still pending) and SingleProcessCook does not. The objects would therefore be correctly deleted when saving the package that contained them, but then would be available for reference from the packages that import the package, and cause these Content is missing from cook warnings.

We made a series of fixes to blueprint compiler and LinkerLoad code to preserve the information that the objects should be deleted across garbage collections. Please cherrypick these changes and let me know if it is still occurring.

Fixes made in 5.6:

Big change that if not present causes merge errors for 37873150:

CL 37201310, aka github commit bfee6496384d9a4e54d9b9b115ca8d8f4be0c255

Removed some implicit dependencies on instanced property flags during reference property value iteration…

CL 37873150 aka github commit a9ba4d5c0570ee7df56a8c096fdb6ff95cf93797

Cooker: Blueprints: Fix Content missing from cook warnings for packages that refer to a target blueprint’s template subobjects…

Hello Matt,

Thank you very much for your answer.

We will try those.

FYI - in BP_DestructibleComponent we changed “Editable when inherited” flag to false, I had the suspicion this could be a cause, put it back to the default true, and the cooking error dissapeared.

We will try with those CLs to see if that does not happen.

Thank you,

Jose

Hi ~ I don’t want to hijack someone else’s thread, but this looks similar to something we are running into; with this error only occurring during MPCook:

LogCook: Warning: Content is missing from cook. Source package referenced an object in target package but the object was stripped out of the target package when saved.

Source package: /Game/Materials/Utils/Blueprint/BP_Sky_SeasonAutumn

Target package: /Game/Materials/Utils/Blueprint/BP_Sky

Referenced object: /Game/Materials/Utils/Blueprint/BP_Sky.Default__BP_Sky_C:NiagaraLensFlare:NiagaraDataInterfaceOcclusion_0

We merged in the two change lists that you mentioned and picked up an additional error:

LogCook: Warning: Content is missing from cook. Source package referenced an object in target package but the object was stripped out of the target package when saved.

Source package: /Game/Entities/Harvestables/Brambles/Festivals/BP_RainbowCornStalk_01

Target package: /Game/Entities/_Templates/BP_BaseActivity

Referenced object: /Game/Entities/_Templates/BP_BaseActivity.BP_BaseActivity_C:DefaultStateSFX_GEN_VARIABLE

We started from 5.4.4, I’m wondering if there might be another change missing/other things we might try.

In case the information is helpful, we also saw these errors on some properties marked with UPROPERTY(Transient) ~ adding DefaultToInstanced to the class definitions seemed to clear out those cases.

Thank you,

Richard

If starting from 5.4, you also need the changes below from 5.5.

I’m not sure whether these will fix the missing Default object for Niagara; it’s possible that will require a different fix. Let me know if the problem still occurs after taking these changes and I will do some research to see if we have another fix.

CL 34009034, aka github commit 05918d7e5c08cff86829867cc550a96e6d1fed64

InvalidateExport: When an export is invalidated, also invalidate all of its subobjects…

CL 35663741, aka github commit 693eac7ce2299942483f104ea80be1f62d532978

Relax ClassWithin constraint while reinstancing and avoid marking discarded ICH templates as garbage…

CL 35706135, aka github commit 1c0fed0b9d064d579aad4c2bbb222667dd9a1120

Remove redundant remapping of CDO subobjects

CL 35760739, aka github commit dd4dc9d7c55eb0fcec80a7d778ccba4fb54f6848

… In cases where the template object is a blueprint generated class, we may have only created the archetype export as part…

Thanks :slight_smile: We also have a 5.5 update in progress, I’ll check in and see how far along that is and either patch from that or add these four.