[NFP] [Database] ERROR: FOREIGN KEY constraint failed

bostonbongrips

Chieftain
Joined
Mar 30, 2016
Messages
54
Location
Chicago
I'm getting crash to desktop about 160 turns in. Database log is clear except for 4 instances of the below error:

[Database] ERROR: FOREIGN KEY constraint failed

I am running a bunch of mods but when I looked at the Modding log, there was no errors at or near the corresponding time-stamps.

Any ideas what is causing this?
 
Error messages with [Database] leaders don't actually refer to anything that is being done to the actual gameplay database, they refer to stuff such as adding icons to the game. Errors coming from attempts to add stuff to the ingame localization text will have headers of [Localization].

A foreign key constraint error means that someone (Firaxis or a modder) attempted to refer to something that was never defined anywhere within the same system. So for a [Database] foreign key constraint the usual culprit is that a modder added for example an atlas of images they called "ALTAS_CHEESEBURGERS" but then when assigning the images in the atlas to units and the like, they refered to it as "ATLAS_CHEESEBURGERS". Or they just never defined the atlas for example and merely attempted to use it. Or (and this is also a pretty common cause) their code has syntax errors which are not allowing everything from the mod's xml or sql files to load, and the missing pieces are the things the foreign key constraint errors are referring to.

This sort of error could be the source of the crash since at some point the game's User Interface files are going to try to find the needed image texture and they'd likely come up "empty" on that image. Usually though the game just randomly displays an icon image rather than crashing, or else shows an empty image or a question-mark.
 
After taking a quick look tonight, there's a few mod warnings in your modding.log. The first group appears to be related to the City Lights mod (lines 5012~5023 & lines 5056~5057). The other warnings looks like something to do with one of the R.E.D Total War mods (lines 1833 & 6232), whichever one has the REDTWScoutCat & REDTWBerbers dep files in it. I can't guarantee either of them are the source for the FC error, but that's at least a place to start looking for the problem.
 
Back
Top Bottom