Lighting build crashes, error (PhotonMapping.cpp [Line:893])?

Hi, I tried building lighting in a level for the first time and it failed with the error below. After some research I tried adding a Lightmass Importance Volume around the entire level and deleting my Saved, Build, and Intermediate folders but the issue continues.

Any help would be great appreciated.

*** CRITICAL ERROR! Crash report:

LightingResults:Error: Error  === Lightmass crashed: ===
Assertion failed: QuantizedLightIndex >= 0 && QuantizedLightIndex < Lights.Num() [File:D:\Build\++UE4+Release-4.12+Full\Sync\Engine\Source\Programs\UnrealLightmass\Private\Lighting\PhotonMapping.cpp] [Line: 893] 

I’m not sure if something from this second section is what’s causing the errors or just happening after the error since it’s related to source control.

*** CRITICAL ERROR! Machine: 
*** CRITICAL ERROR! Logfile: 
*** CRITICAL ERROR! Crash report: 
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/Level2_HallwayRoom1.umap" --non-interactive --trust-server-cert --username  --password ********"
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/Level2_HallwayRoom2.umap" --non-interactive --trust-server-cert --username  --password ********"
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/Level2_HallwayRoom3.umap" --non-interactive --trust-server-cert --username  --password ********"
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/Level2_WarehouseCloset.umap" --non-interactive --trust-server-cert --username  --password ********"

LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/HLOD/Level2_HallwayRoom2_HLOD.uasset" --non-interactive --trust-server-cert --username  --password ********"
SourceControl: Info svn: warning: W155007: 'C:\Users\\Music\delirium-alpha\Workshop_Project\Content\Workshop\Levels\Level2\HLOD\Level2_HallwayRoom1_HLOD.uasset' is not a working copy
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/HLOD/Level2_HallwayRoom3_HLOD.uasset" --non-interactive --trust-server-cert --username  --password ********"
SourceControl: Info svn: warning: W155007: 'C:\Users\\Music\delirium-alpha\Workshop_Project\Content\Workshop\Levels\Level2\HLOD\Level2_HallwayRoom2_HLOD.uasset' is not a working copy
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/HLOD/Level2_WarehouseCloset_HLOD.uasset" --non-interactive --trust-server-cert --username  --password ********"
SourceControl: Info svn: warning: W155007: 'C:\Users\\Music\delirium-alpha\Workshop_Project\Content\Workshop\Levels\Level2\HLOD\Level2_HallwayRoom3_HLOD.uasset' is not a working copy
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/HLOD/Level2_MiddleHall_HLOD.uasset" --non-interactive --trust-server-cert --username  --password ********"
SourceControl: Info svn: warning: W155007: 'C:\Users\\Music\delirium-alpha\Workshop_Project\Content\Workshop\Levels\Level2\HLOD\Level2_WarehouseCloset_HLOD.uasset' is not a working copy

SourceControl: Info svn: warning: W155007: 'C:\Users\\Music\delirium-alpha\Workshop_Project\Content\Workshop\Levels\Level2\HLOD\Level2_Office_HLOD.uasset' is not a working copy
LogSourceControl: Attempting "svn status --show-updates --verbose --xml "C:/Users//Music/delirium-alpha/Workshop_Project/Content/Workshop/Levels/Level2/HLOD/Level2_SideRoom_HLOD.uasset" --non-interactive --trust-server-cert --username  --password ********"
SourceControl: Info svn: warning: W155007: 'C:\Users\\Music\delirium-alpha\Workshop_Project\Content\Workshop\Levels\Level2\HLOD\Level2_Exit_HLOD.uasset' is not a working copy
SourceControl: Info svn: warning: W155007: 'C:\Users\\Music\delirium-alpha\Workshop_Project\Content\Workshop\Levels\Level2\HLOD\Level2_SideRoom_HLOD.uasset' is not a working copy
Job has failed! Job executable didn't exit cleanly. Exit code: -1066598273

HI Makldiz,

With the information provided there isn’t much to go off of that I can see.

Typically with lightmass crashes and not very clear error messaging, which we have a ticket in for this to be improved, you’ll likely have to brute force some testing to see what is causing the crash. I’ve not seen this specific error before either.

The error log above doesn’t really indicate much other than some files showing “…is not a working copy.” which could be something for you to look at on your end.

If you had specific steps to reproduce this issue that would be worth looking into on my end, but I doubt that it will be reproducible for you with a new project and that I wouldn’t be able to reproduce on my end either with a fresh project. But if you do, please post the steps here!

In Swarm Agent you can try running a “Super Verbose” log and posting here and by going through your project and removing assets in clumps from the level to see if the light build completes. Sometimes there can be an asset that causes the build to hang or crash in this way that it’s just a brute force method to go through and find.

Sorry I don’t have better news.

Tim

I ran into the same QuantizedLightIndex assert recently (on UE4.25). To track it down I narrowed it down to which sub-level was causing it (I did a hacky/cheesy binary search by unloading half the levels, building lighting, and seeing if it succeeded or not - there might be a better way, but this only took a few builds to find it). Then I entered “lightmassdebug” into the UE4 console, built lightmass in debug, started a light build, and ran lightmass in the debugger so that I could debug it.

In our case, this resulted in a different assert - there’s a checkSlow (debug only) - checkSlow(FLinearColorUtils::AreFloatsValid(PathAlpha)) - that caught the underlying problem earlier, which was that we were introducing an Inf or NaN into PathAlpha. It was fairly easy to track that back, and turned out that we had a bug in our code that was doing a divide by zero for 1 light and sending Brightness==Inf through to lightmass from the editor.

Fixing our code (to not divide by zero) fixed the light bake.

The original assert is quite confusing in this case - the problem wasn’t really to do with the light indices, but because PathAlpha was all NaNs the surrounding logic would keep looping and lead an issue with the indexes. Thankfully in debug that checkSlow makes it a lot clearer what’s really going wrong.