hi, we have encount content missing cook error in unreal 5.6。It is a random issue, but it is more likely to occur when multi-process cooking is enabled . I have seen many posts on the forum with similar issues.
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.
The TST_BP_Interact_PushableCrate_CoPush struct: [Image Removed]
The parent bp:
[Image Removed]
After some debugging, i found this maybe related to UInheritableComponentHandler::ValidateTemplates. ValidateTemplates function will remove unnecessary records, lead to all the marklinecomponent subobject template data remove from the child InheritableComponentHandler record, because no override value, and same with the parent template data.
Origin Records:
[Image Removed]
records after ValidateTemplates:
[Image Removed]
.
But harvest export need data from UInheritableComponentHandler. Removing the records will leads to this subobject tempalte data not as export. When some other asset referencing it as import, leads to content missing error. The following is a call stack without content missing error, you can the harvest export is called from UInheritableComponentHandler::serialze records data.
[Image Removed]
Have you encountered this problem in 5.6? How to solve it?
We have had a few reports of Content is Missing from Cook on GEN_VARIABLE objects in 5.6. In one of those we also got a report from the licensee about how it could happen.
The case that occurs involves UInheritableComponentHandler::ValidateTemplates.
ValidateTemplates is intended to remove components from the child class blueprint that are identical to the archetype components present on the parent blueprint. Ordinarily it does this when loading the child class blueprint, both when loading it to save the blueprint and when loading it because it is saving some other package that has a reference to the blueprint. The same components are removed in both cases, so no reference to a missing component is made.
But this can fail in some cases when the child blueprint is loaded, if the child blueprint has a StaticMeshComponent. StaticMeshComponent copies data from the StaticMesh asset onto the StaticMeshComponent during load of the blueprint containing the StaticMeshComponent, but it will skip this copy if the StaticMesh is compiling on another thread, and the StaticMesh can sometimes be compiling depending on chaotic operations that occur during cooking. In that case the data is not copied onto the child blueprint’s StaticMeshComponent by the time that ValidateTemplates executes, and ValidateTemplates now incorrectly thinks that the child component is different from the parent component, and leaves the component present on the child blueprint. This can occur sometimes during save of the child blueprint, and sometimes during save of the referencer, and if it occurs in one and not the other then the Content is Missing error will occur.
This is quite possibly the error that occurs in your place.
We are still working on a robust solution for that error and should have an update for you in a few days.