Packaging fails for windows in 4.14

When trying to package project in 4.14, packaging fails, this was not the case with 4.13.
It fails on packaging some levels, if I remove the problematic levels from the packaging settings, it works.

LogCook:Display: Cooking /Game/Maps/L_Ranch_TH -> O:/Projects/pcthunder2305/Thunder2305/Saved/Cooked/WindowsNoEditor/Thunder2305/Content/Maps/L_Ranch_TH.umap
LogWindows:Error: begin: stack for UAT
LogWindows:Error: === Critical error: ===
LogWindows:Error: 
LogWindows:Error: Fatal error!
LogWindows:Error: 
LogWindows:Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000818
LogWindows:Error: 
LogWindows:Error: UE4Editor-Engine.dll!operator<<() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\engine\private\components\staticmeshcomponent.cpp:2477]
LogWindows:Error: UE4Editor-Engine.dll!operator<<() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\core\public\containers\array.h:1123]
LogWindows:Error: UE4Editor-Engine.dll!UStaticMeshComponent::Serialize() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\engine\private\components\staticmeshcomponent.cpp:271]
LogWindows:Error: UE4Editor-CoreUObject.dll!FArchiveSaveTagExports::ProcessTaggedObjects() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\coreuobject\private\uobject\savepackage.cpp:994]
LogWindows:Error: UE4Editor-CoreUObject.dll!FPackageExportTagger::TagPackageExports() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\coreuobject\private\uobject\savepackage.cpp:3201]
LogWindows:Error: UE4Editor-CoreUObject.dll!UPackage::Save() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\coreuobject\private\uobject\savepackage.cpp:3784]
LogWindows:Error: UE4Editor-UnrealEd.dll!UEditorEngine::Save() [d:\build\++ue4+release-4.14+compile\sync\engine\source\editor\unrealed\private\editorengine.cpp:3966]
LogWindows:Error: UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::SaveCookedPackage() [d:\build\++ue4+release-4.14+compile\sync\engine\source\editor\unrealed\private\cookontheflyserver.cpp:2962]
LogWindows:Error: UE4Editor-UnrealEd.dll!UCookOnTheFlyServer::TickCookOnTheSide() [d:\build\++ue4+release-4.14+compile\sync\engine\source\editor\unrealed\private\cookontheflyserver.cpp:2166]
LogWindows:Error: UE4Editor-UnrealEd.dll!UCookCommandlet::NewCook() [d:\build\++ue4+release-4.14+compile\sync\engine\source\editor\unrealed\private\commandlets\cookcommandlet.cpp:1553]
LogWindows:Error: UE4Editor-UnrealEd.dll!UCookCommandlet::Main() [d:\build\++ue4+release-4.14+compile\sync\engine\source\editor\unrealed\private\commandlets\cookcommandlet.cpp:850]
LogWindows:Error: UE4Editor-Cmd.exe!FEngineLoop::PreInit() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\launchengineloop.cpp:1843]
LogWindows:Error: UE4Editor-Cmd.exe!GuardedMain() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\launch.cpp:113]
LogWindows:Error: UE4Editor-Cmd.exe!GuardedMainWrapper() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
LogWindows:Error: UE4Editor-Cmd.exe!WinMain() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\launch\private\windows\launchwindows.cpp:202]
LogWindows:Error: UE4Editor-Cmd.exe!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
LogWindows:Error: KERNEL32.DLL
LogWindows:Error: ntdll.dll
LogWindows:Error: ntdll.dll
LogWindows:Error: 
LogWindows:Error: end: stack for UAT
Took 210.1086506s to run UE4Editor-Cmd.exe, ExitCode=3

You need to install Visual Studio.

You can do that by going here:

We’re using Visual Studio.
This happens only if certain levels are set to be packaged, after upgrading to 4.14.

Do the failed packed levels have errors in any of the blueprints they use?

Not at all. All compile just fine.
From the error, it seems like some issue with serialization of some static mesh.

Could be caused by: https://github.com/EpicGames/UnrealEngine/blame/release/Engine/Source/Runtime/Engine/Private/Components/StaticMeshComponent.cpp#L2477

I was able to trace the issue to Child Actor Components, removing these and recreate makes it work.

Edit: Actually no, after recreating all child actors in an actor, put it inside a level and made the level be packaged, error still happens.
But removing all child actors makes it work.

Hello,

After reading over your issue, it appears that it is related to a specific map, if I’m understanding correctly.

I’ve not come across this issue before, and the error you’re seeing does not appear to be logged in our database.

As a result, here’s what I recommend:

Migrate your content piece by piece into a clean project (not the map itself, just the actors and such that exist in that map). If you are able to determine which asset is causing the issue, that will help narrow down the cause of the error. When you have narrowed it down, it would be great if you could provide a simplified test project containing just that asset so that I can see the packaging error on my end.

Thanks

Attach Visual Studio to UE4Editor-Cmd.exe , you can trace the bugged actor.

I have the same error, Visual Studio → Attach To Process → UE4Editor-Cmd.exe , you can trace the bugged actor.

Hi Sean , I have the same problem , my build crash on StaticMeshComponent.cpp line 2477 tellin me I.OwningComponent is NULL.

I tested the asset that cause this crash and in PIE is fine.

I found that Add Child Actor Component with Child Actor Class NONE followed by Set Child Actor Class with In Class that have UStaticMeshComponent as RootComponent will cause this crash on packaging.

Working fine on older ue version and on current version Editor and PIE.

Hi, I have the same problem! Any solution?

Hey NomadMonkey,

I’ve tested this but I’m not seeing the same issue. Is your ChildActorClass that contains the Static Mesh a C++ class or a blueprint class? Does it occur if you just do AddChildActorComponent->SetChildActorClass on BeginPlay?

My ChildActorClass is a C++ class with this setup

AInteractiveObjectActor::AInteractiveObjectActor()
{
	m_rootMeshComponent = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Mesh"));

	//Let's make the meshComponent the RootComponent
	RootComponent = m_rootMeshComponent;

	// Setup trigger
	m_trigger = CreateDefaultSubobject<UBoxComponent>(TEXT("TriggerCollider"));
	m_trigger->SetupAttachment(RootComponent);

	// Both colliders need to have this set to true for events to fire
	m_trigger->bGenerateOverlapEvents = true;
	 
	// Set the collision mode for the collider
	// This mode will only enable the collider for raycasts, sweeps, and overlaps
	m_trigger->SetCollisionEnabled(ECollisionEnabled::QueryOnly);
		
	// Setup raycast sphere
	m_oRaycastedPoint = CreateDefaultSubobject<USphereComponent>(TEXT("VisibilityCollider"));
	m_oRaycastedPoint->SetupAttachment(RootComponent);

	m_oRaycastedPoint->bGenerateOverlapEvents = true;
	m_oRaycastedPoint->SetCollisionObjectType(ECC_GameTraceChannel11);
	m_oRaycastedPoint->SetCollisionResponseToAllChannels(ECR_Ignore);
	m_oRaycastedPoint->SetCollisionResponseToChannel(ECC_GameTraceChannel11, ECR_Block);
	m_oRaycastedPoint->SetSphereRadius(1, false);

  	m_oInteractionIconsLocation = CreateDefaultSubobject<USceneComponent>(TEXT("InteractionIconsLocation"));
  	m_oInteractionIconsLocation->SetupAttachment(RootComponent);
  	m_oInteractionIconsLocation->SetRelativeLocation(FVector::ZeroVector);
}

Thanks for the additional info. I’m still not seeing the same issue on my end unfortunately. Would you be able to create and provide a simple test project that experiences the same issue?

I just ran into the same issue (even the same address). Also, my blueprints are just compiling fine. Had a similar issue recently (Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x00000018 when opening or even right clicking level - Character & Animation - Unreal Engine Forums) when opening a level, but this error doesn’t occur anymore but yet this happens during packaging. I don’t know if this behaviour is connected somehow, but it would be a huge coincidence if so

(in 4.14) I’ve run into this or a similar problem caused by placing a blueprint actor that contains a child actor component inside a level. When the packaging/cooking reaches that level it will fatal crash and fail the build.

I am currently in the process of upgrading to 4.15, if these problems persist I will write a more thorough bug report.

My fatal crash was because StaticMeshComponent.cpp line 2477 I.OwningComponent == null.

I fixed it adding a check before file 2477.

if(!I.OwningComponent)
	bStrippedOverrideColors = true;
else
{
.. old code ...
}