Crashing when saving specific blueprint - "Illegal call to StaticConstructObject() while serializing object data! (Object will not be saved!)"

294020-critical-save-error.png

Last time this file was saved was a month ago in version 4.22.3 (source code). Then I upgraded to 4.23.1 (source code) the day after, and have been running it ever since without any other issues. I haven’t attempted to save the file since then so this may be due to the upgrade.

This only happens when saving a specific file (custom player state blueprint). No crash report window pops up, only this error message, which crashes the engine completely. It compiles fine with no warnings, and I can still package the project as well without any issues, but whenever I try to save that particular file, unreal freezes at 50% on the saving progress bar, then throws the error at me. Happens with 100% consistency. Restarting the engine or Windows has no effect.

Here’s a snippet from UObjectGlobals.cpp:

UObject* StaticConstructObject_Internal
(
	UClass*			InClass,
	UObject*		InOuter								/*=GetTransientPackage()*/,
	FName			InName								/*=NAME_None*/,
	EObjectFlags	InFlags								/*=0*/,
	EInternalObjectFlags InternalSetFlags /*=0*/,
	UObject*		InTemplate							/*=NULL*/,
	bool bCopyTransientsFromClassDefaults	/*=false*/,
	FObjectInstancingGraph* InInstanceGraph				/*=NULL*/,
	bool bAssumeTemplateIsArchetype	/*=false*/
)
{
	LLM_SCOPE(ELLMTag::UObject);

	SCOPE_CYCLE_COUNTER(STAT_ConstructObject);
	UObject* Result = NULL;

#if WITH_EDITORONLY_DATA
	UE_CLOG(GIsSavingPackage && InOuter != GetTransientPackage(), LogUObjectGlobals, Fatal, TEXT("Illegal call to StaticConstructObject() while serializing object data! (Object will not be saved!)"));

Relevant lines from crash log:

[2019.12.15-23.07.56:953][365]Cmd: OBJ SAVEPACKAGE PACKAGE="/Game/Dynamic/Blueprints/Kernel/PS_Core" FILE="../../../../../repos/X/Content/Dynamic/Blueprints/Kernel/PS_Core.uasset" SILENT=true
[2019.12.15-23.07.57:090][365]LogOutputDevice: Warning: 

Script Stack (0 frames):

[2019.12.15-23.07.57:090][365]LogWindows: Windows GetLastError: The operation completed successfully. (0)

As far as I know, every other file works and saves fine. I can’t share much as this is part of a large project. I have the option of back tracking in source control, but I’d be much more comfortable understanding and fixing the issue separately before resorting to that. Especially because the last time this file was saved was about a month ago, so this potentially could have been an issue ever since.

Any help in tracking down this issue would be greatly appreciated.

Thanks

Edit: Tried deleting the rebuildable content (.vs, binaries, DerivedDataCache, Intermediate, Saved, and the .sln). Rebuilt project, but no luck with the file.

Edit2: I have a couple of duplicate version of my project that I checked (both are running the standard engine version through Epic launcher, not the source code). The 4.22.3 duplicate project can save the file (which I believe is identical/ unchanged since upgrading), but the 4.23.1 one crashes same as the original project.

Unfortunately didn’t find an answer to why this is happening. But I managed to recreate the file from scratch, and simply copy all the logic over piece by piece to the new file (had to be a separate new file, duplicating resulted in crashes as well), resulting in an identical blueprint. Took about 3 hours to rip out the old file and reconnect the new file to all linked blueprints (fixing all bad cast nodes, etc.), but we are back up and running. File must’ve become corrupt at some point.

I have the exact same issue, verbatim as you. One file (in my case the primary character blueprint for my citybuilder) will not save, and when attempting to save will crash with the error “Illegal call to StaticConstructObject() while serializing object data!”

I took a backup of my project from several months ago & converted this old project from 4.22 to 4.23. Low & behold, in 4.23 the file that is causing the crash cannot save.

I’m convinced that this is a bug or issue being introduced by 4.23, as same as you my file causing the issue can save in versions saved back in 4.22. I only upgraded to 4.23 about 5 days ago, and encountered this crashing issue yesterday after attempting to modify & save the character blueprint for the first time since upgrading to 4.23.

I’m going to try to upgrade the project to 4.24 & see if that fixes the issue. My blueprint has a ton of code on it and I want to avoid building it all again by copying all the nodes & fixing the casts to a new blueprint as you had to do.

I too tried duplicating the file same as you with no luck. That duplicate will also crash when saved. It appears the issue is somehow linked intrinsically with whatever is in that file when used with engine version 4.23.

Like I mentioned, a two month old project from 4.22 and which worked when saving that file converted to 4.23 results in the engine crashing all of a sudden upon saving that file.

I had the exact same issue, verbatim. Updating to 4.24 fixed this for me, making me suspect it was an engine issue with 4.23.

My file that was causing a crash every-time upon saving it only started doing this after updating to 4.23. Older versions of the project converted for & opened in 4.23 all of a sudden would crash when the same file was saved.

So, solution would be to update to 4.24 for anyone getting the same error: “Illegal call to StaticConstructObject() while serializing object data!”

Hi!
Late reply to help those having the same issue.

On my side it was a macro from a macro library that was crashing my blueprint when saved. It seemed corrupted.
Deleting this macro and creating a new one from scratch with the exact same content fixed it.

I’ve been faced to this problem twice in the recent months and it was the fix both time.

Hope this’ll help people before Epic makes a fix.