Question about error message in the logs

Noxempire

Chieftain
Joined
May 18, 2020
Messages
19
I have modded a bit of stuff already, I am not completely new to the concept of reading the logs and fixing problems, but:

Sometimes I am really confused by them. There is stuff that is completely logical to me like "Couldn't find table/file xy"

But stuff like this puzzles me:
[1782953.893] [Configuration] ERROR: NOT NULL constraint failed: Players.CivilizationType
[1782953.893] [Configuration] ERROR: NOT NULL constraint failed: Players.CivilizationType

It doesn't tell me where, nor does it tell me how I can fix this. The only reference to this error is in Database.log which says:

[1782951.418] ERROR: Database: UNIQUE constraint failed: SettingFiles.SettingRowId, SettingFiles.FileRowId
[1782951.418] Database: While executing - 'INSERT INTO SettingFiles(SettingRowId, FileRowId, Priority) VALUES (?,?,?)'

Why doesn't it tell me a row or any of the text involved with the error? I am very likely missing something here, I'd be glad If someone could explain what this error means. Since INSERT INTO, and CivilizationType, isn't something that sounds really specific to me. Maybe there is something wrong with insert into PlayerItems, since it's saying Players.CivilizationType?
 
Last edited:
UNIQUE constraint failed usually indicates that you're trying to add a row where the specified values for the indicated columns are already used in another row in the table. NOT NULL constraint failed usually indicates an attempt to insert a null value into a column that requires a non-null value. Without knowing how the SettingFiles table is defined, or the actual SQL/XML statements used, it is difficult to diagnose this further, and as you've discovered, the Database and Modding log files are skimpy on the details. You should identify any lines in your mod that insert or replace into the Players and SettingFiles tables, and proceed from there.
 
Top Bottom