UE5 Crash on building streaming texture

The editor crash when building Streaming Texture :

Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           === Critical error: ===
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           Assertion failed: StreamingTextures.Num() == StreamingTextureGuids.Num() [File:D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp] [Line: 1894] 
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffde91c16a8 UnrealEditor-Engine.dll!ULevel::RegisterStreamableTexture() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp:1894]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffde91c171a UnrealEditor-Engine.dll!ULevel::RegisterStreamableTexture() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Level.cpp:1882]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffdea120167 UnrealEditor-Engine.dll!FStreamingTextureBuildInfo::PackFrom() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Streaming\TextureStreamingBuild.cpp:432]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffde8cec6ed UnrealEditor-Engine.dll!UStaticMeshComponent::BuildTextureStreamingDataImpl() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\StaticMeshComponent.cpp:927]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffde8c2742c UnrealEditor-Engine.dll!UPrimitiveComponent::BuildTextureStreamingData() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Components\PrimitiveComponent.cpp:481]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffdea0f0666 UnrealEditor-Engine.dll!BuildTextureStreamingComponentData() [D:\build\++UE5\Sync\Engine\Source\Runtime\Engine\Private\Streaming\TextureStreamingBuild.cpp:299]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffde669c54c UnrealEditor-UnrealEd.dll!FEditorBuildUtils::EditorBuildTextureStreaming() [D:\build\++UE5\Sync\Engine\Source\Editor\UnrealEd\Private\EditorBuildUtils.cpp:1460]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffdde586608 UnrealEditor-LevelEditor.dll!FLevelEditorActionCallbacks::BuildTextureStreamingOnly_Execute() [D:\build\++UE5\Sync\Engine\Source\Editor\LevelEditor\Private\LevelEditorActions.cpp:814]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffdde5a99d7 UnrealEditor-LevelEditor.dll!TBaseStaticDelegateInstance<void __cdecl(void),FDefaultDelegateUserPolicy>::ExecuteIfSafe() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:731]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28b6b018 UnrealEditor-Slate.dll!FUICommandList::ExecuteAction() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Commands\UICommandList.cpp:99]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28c4d421 UnrealEditor-Slate.dll!SMenuEntryBlock::OnClicked() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:1148]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28c4e3f0 UnrealEditor-Slate.dll!SMenuEntryBlock::OnMenuItemButtonClicked() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:1108]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28c30814 UnrealEditor-Slate.dll!TBaseSPMethodDelegateInstance<0,SMenuEntryBlock,1,FReply __cdecl(void),FDefaultDelegateUserPolicy>::Execute() [D:\build\++UE5\Sync\Engine\Source\Runtime\Core\Public\Delegates\DelegateInstancesImpl.h:290]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28ccb90b UnrealEditor-Slate.dll!SButton::ExecuteOnClick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:464]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28cf2cc6 UnrealEditor-Slate.dll!SButton::OnMouseButtonUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Widgets\Input\SButton.cpp:389]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28c4e4dc UnrealEditor-Slate.dll!SMenuEntryButton::OnMouseButtonUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\MultiBox\SMenuEntryBlock.cpp:434]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28a94034 UnrealEditor-Slate.dll!<lambda_51e270ca99ea7ce852539efd04dd453f>::operator()() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:4961]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28a76fc6 UnrealEditor-Slate.dll!FEventRouter::Route<FReply,FEventRouter::FToLeafmostPolicy,FPointerEvent,<lambda_51e270ca99ea7ce852539efd04dd453f> >() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:405]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28af02de UnrealEditor-Slate.dll!FSlateApplication::RoutePointerUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:4947]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28ad91b1 UnrealEditor-Slate.dll!FSlateApplication::ProcessMouseButtonUpEvent() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5495]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe28acd5dc UnrealEditor-Slate.dll!FSlateApplication::OnMouseUp() [D:\build\++UE5\Sync\Engine\Source\Runtime\Slate\Private\Framework\Application\SlateApplication.cpp:5460]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe5287a92e UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessDeferredMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2210]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe52869247 UnrealEditor-ApplicationCore.dll!FWindowsApplication::DeferMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:2699]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe5287ce51 UnrealEditor-ApplicationCore.dll!FWindowsApplication::ProcessMessage() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:1078]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe528649a7 UnrealEditor-ApplicationCore.dll!FWindowsApplication::AppWndProc() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsApplication.cpp:916]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe6cb91c4c USER32.dll!UnknownFunction []
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe6cb90ea6 USER32.dll!UnknownFunction []
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe5287e148 UnrealEditor-ApplicationCore.dll!FWindowsPlatformApplicationMisc::PumpMessages() [D:\build\++UE5\Sync\Engine\Source\Runtime\ApplicationCore\Private\Windows\WindowsPlatformApplicationMisc.cpp:138]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ff647e67114 UnrealEditor.exe!FEngineLoop::Tick() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\LaunchEngineLoop.cpp:5139]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ff647e80d9c UnrealEditor.exe!GuardedMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Launch.cpp:183]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ff647e80e8a UnrealEditor.exe!GuardedMainWrapper() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:147]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ff647e83c4d UnrealEditor.exe!LaunchWindowsStartup() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:283]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ff647e95534 UnrealEditor.exe!WinMain() [D:\build\++UE5\Sync\Engine\Source\Runtime\Launch\Private\Windows\LaunchWindows.cpp:330]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ff647e986e6 UnrealEditor.exe!__scrt_common_main_seh() [d:\a01\_work\6\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288]
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe6cad54e0 KERNEL32.DLL!UnknownFunction []
Thu Apr 07 05:45:54 CEST 2022 Error        LogWindows           [Callstack] 0x00007ffe6d9e485b ntdll.dll!UnknownFunction []

The map is a dense map (but not something too high).

2 Likes

Its happening to me too, after I started to run my project in the UE5 I can’t Build All Levels anymore. Any clues or fixes?

Edit1: I’ve found that even hiding all Levels and skipping them on Build All Levels gives the same crash.

Edit2: I’ve rolled back to a commit before any changes made after UE5 and the crash still happens, so either the problem is in the UE5 or with my projectS that were made in UE4.26 .

look like happening on only one map on my project.

But only since migration to UE5

I found a reason to the crash and a workaround

Reason:
I was using some assets from the Old Brick House pack and I .gitignore thirdparty packs. I copy used assets to my project folder so I only version the used assets to reduce git size. I’ve found that 2 assets were using materials still in the pack folder and deleting them from the map made the Build go without crash. I downloaded again the pack and replaced the old folder with the new but the crash would still happens if the assets were points to the pack, so I found a work around and a theory.

Workaround:
Re-Download (or not) and copy/paste used assets from pack folders including any material or texture into a new folder.

Theory:
Maybe the pack that isn’t 5.0 ready need to be rebuilded by the owner and copy/pasting the assets converts them to 5.0 ready.

1 Like

Thanks for this help !

I had the same issue. It seems the issue is with some project textures sharing the same guid. I have no idea how Unreal expects users to track down the problematic textures, but I found a way to fix it via running a bit of code.

Simply run this code somewhere in the editor:

TMap<FGuid, UTexture*> guids;

for (TObjectIterator<UTexture> it; it; ++it)
{
	if (!it->GetLightingGuid().IsValid())
	{
		continue;
	}
	
	UTexture** result = guids.Find(it->GetLightingGuid());
	if (result == nullptr)
	{
		guids.Add(it->GetLightingGuid(), *it);
	}
	else
	{
		UE_LOG(LogTemp, Warning, TEXT("%s: Texture has had its Guid updated."), *it->GetName());
		it->SetLightingGuid();
		it->Modify();
	}
}

FText DialogText = FText::FromString("Done, save all to save all");
FMessageDialog::Open(EAppMsgType::Ok, DialogText);

It’s a modified bit of code from a plugin that does something similar for Materials.

I’ll have a plugin up in a few hours that uses this code to fix the issue.

3 Likes

Great work!

1 Like

Here’s the fix I mentioned a bit cleaned up in a plugin format!

The plugin also includes a fix for conflicting material GUIDs, which is something I ran into in an earlier version.

5 Likes

Thank you for the effort!
Your plugin fixed a texture and a material in my project, unfortunately that did not fix my crash on building streaming textures.

I will try this, if it work, you are an absolute master.

1 Like

Working like a charm, thanks a lot !
@Majusbear are you sure you use save all before building ? what is the error code ?

1 Like

As @Aherys said, make sure you save all first, and make sure the error you get when building includes Assertion failed: StreamingTextures.Num() == StreamingTextureGuids.Num(), otherwise it’s likely a different error.

If it is that error, try running the plugin, saving all, and restarting the editor. Run the plugin again and let me know if it still is saying it’s changing ids. If so that likely means it’s trying to change the GUID of something it can’t edit. If that’s the case, please let me know, and I should be able to make an edit to the plugin to account for that.

Also, if possible, open up the output log after running the plugin and let me know the name of the textures that it reports have changed.

Thank you for the detailed response! I will come back to you on monday, when I can test this.

Your plugin fixed in my project the crash on building streaming textures thank for your work.

1 Like

First of all, unfortunately it still won’t work for me.
I can confirm that I have the “correct” error (copy & pasted from the crash message: Assertion failed: StreamingTextures.Num() == StreamingTextureGuids.Num() ).
When I try to use the plugin again it just tells me “No duplicate texture/material GUIDs found.”

I dug a bit in the logs to find the materials/textures that the plugin did change the first time I tried it, which where the following:
https://pastebin.com/iUeQfZv7

You may be running low on VRAM is my best guess?

Does it tell you “No duplicate texture GUIDs found.” even after restarting the editor and running it again?

Yes, it does.

I tried to find the problematic assets inside the map, by deleting a bunch of assets at a time and rerunning the Build streaming textures until it worked, but I couldn’t pin point the problem. It did build after I deleted a whole bunch of assets but after I recovered the original map and only deleted the last chunk of assets I deleted the last time around it still didn’t work.

I think the issue tends to stem from duplicating textures in a way Unreal doesn’t handle well, so multiple textures end up with the same GUID. I’m not too sure why it would be giving you an error of duplicate texture GUIDs when all your textures are still reporting unique GUIDs.

  • My first idea would be that my program updated a GUID it couldn’t, so it thought there’s no conflict even though there is. In that case, I would expect the GUID to revert on an editor restart, so I don’t see that as too likely.

    • To address this, I could change my plugin to update the GUID of all textures with a matching GUID, rather than letting the first texture retain its GUID. However, to do this, you’d need to reset the textures to a state before my plugin previously updated them, so the program could know which ones to update.
  • My second idea I have is that my plugin doesn’t update the GUID of textures that have an empty GUID. The reason I have it this way is that otherwise, the plugin ends up trying to update a bunch of engine textures, but I haven’t had any actual issues when the plugin includes textures with empty GUIDs.

    • A simple change to the plugin should allow you to hit any textures that don’t have a GUID, although this will also result in the plugin always telling you that a texture has changed, since it will always attempt to fix the engine plugins (at least each time you restart the editor).
  • My last remaining idea would be that TObjectIterator (what my plugin uses to find all the textures) “does not include any class default objects.” Maybe if the problematic texture is an improperly copied version of whatever Unreal is considering to be a “class default object,” that could cause the issue? I’m not really sure.

    • With a bit more work, I could probably figure out how to get all class default textures, but I’m not too sure how to do that offhand. I’d assume they’d have an empty GUID anyways, so I’d assume the second solution fixes it. Otherwise, if you’d duplicated a “class default object” multiple times, solution one would also be enough.

I’ve made a version of my plugin on a new branch that has the fix for the first and second idea. It also includes the full path name of updated textures, which should help make debugging a tad easier.

2 Likes

Wow! You are absolutely awesome! The newest version of your plugin fixed my errors!
Thank you so much, I really appreciate you going the extra mile in helping out.

If you are interested in which GUIDs where updated this time around, here is the relevant part of the log.

1 Like