Mod problem - Looking for help from someone who can read database log :)

blackbird26

Chieftain
Joined
Sep 6, 2022
Messages
1
Hello, I am totally green when it comes to modding, and could use some help getting my game to run. Here's my database file, what do your elven eyes see?

[304046.122] [Database] ERROR: FOREIGN KEY constraint failed
[304047.977] [FullTextSearch]: FTS - Creating Context
[304222.784] [FullTextSearch]: FTS - Creating Context
[304317.803] [Configuration]: Validating Foreign Key Constraints...
[304317.806] [Configuration]: Passed Validation.
[304331.516] [Configuration]: Validating Foreign Key Constraints...
[304331.519] [Configuration]: Passed Validation.
[304366.031] [Gameplay] ERROR: UNIQUE constraint failed: ExcludedAdjacencies.TraitType, ExcludedAdjacencies.YieldChangeId
[304366.031] [Gameplay] ERROR: UNIQUE constraint failed: ExcludedAdjacencies.TraitType, ExcludedAdjacencies.YieldChangeId
[304366.672] [Gameplay] ERROR: only a single result allowed for a SELECT that is part of an expression
[304394.211] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[304394.211] [Localization]: While executing - 'insert into BaseGameText('Tag', 'Text') values (?, ?);'
[304394.211] [Localization]: In XMLSerializer while inserting row into table insert into BaseGameText('Tag', 'Text') with values (LOC_BTT_URBAN_DEFENSES, Unlocks Urban Defenses, giving all of your cities an automatic 400 Fortification Strength and the ability to perform a ranged attack. All previous wall improvements become obsolete and siege support units are no longer effective., ).
[304394.211] [Localization]: In XMLSerializer while updating table BaseGameText from file 6T_Text_UnlockablesUI.xml.
[304394.211] [Localization] ERROR: UNIQUE constraint failed: LocalizedText.Language, LocalizedText.Tag
[304395.866] [Gameplay] ERROR: FOREIGN KEY constraint failed
[304395.866] [Gameplay] ERROR: FOREIGN KEY constraint failed
[304395.866] [Gameplay]: Validating Foreign Key Constraints...
[304395.902] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "REQUIRES_PLOT_ADJACENT_TO_CITY_CENTER" does not exist in Requirements
[304395.902] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "REQUIRES_PLOT_ADJACENT_TO_CITY_CENTER" does not exist in Requirements
[304395.902] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "UNIT_IN_NOT_OWNER_TERRITORY_REQUIREMENT" does not exist in Requirements
[304395.934] [Gameplay]: Failed Validation.
[304408.075] [Configuration]: Validating Foreign Key Constraints...
[304408.078] [Configuration]: Passed Validation.
[304410.649] [FullTextSearch]: FTS - Creating Context
[304569.928] [FullTextSearch]: FTS - Creating Context
[305070.325] [Configuration]: Validating Foreign Key Constraints...
[305070.328] [Configuration]: Passed Validation.
[305079.247] [Configuration]: Validating Foreign Key Constraints...
[305079.249] [Configuration]: Passed Validation.
[305113.702] [Gameplay] ERROR: UNIQUE constraint failed: ExcludedAdjacencies.TraitType, ExcludedAdjacencies.YieldChangeId
[305113.702] [Gameplay] ERROR: UNIQUE constraint failed: ExcludedAdjacencies.TraitType, ExcludedAdjacencies.YieldChangeId
[305114.342] [Gameplay] ERROR: only a single result allowed for a SELECT that is part of an expression
[305143.341] [Gameplay] ERROR: FOREIGN KEY constraint failed
[305143.341] [Gameplay] ERROR: FOREIGN KEY constraint failed
[305143.341] [Gameplay]: Validating Foreign Key Constraints...
[305143.377] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "REQUIRES_PLOT_ADJACENT_TO_CITY_CENTER" does not exist in Requirements
[305143.377] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "REQUIRES_PLOT_ADJACENT_TO_CITY_CENTER" does not exist in Requirements
[305143.377] [Gameplay] ERROR: Invalid Reference on RequirementSetRequirements.RequirementId - "UNIT_IN_NOT_OWNER_TERRITORY_REQUIREMENT" does not exist in Requirements
[305143.409] [Gameplay]: Failed Validation.
[305155.537] [Configuration]: Validating Foreign Key Constraints...
[305155.540] [Configuration]: Passed Validation.
[305158.109] [FullTextSearch]: FTS - Creating Context
[305160.957] [FullTextSearch]: FTS - Creating Context
 

maconnolly

Warlord
Joined
Jun 3, 2019
Messages
190
Many errors, unfortunately, and some of those (if not all) will be preventing your game from launching.

Do you have an inkling as to which mod is causing the fault? Did you add something new recently? Are you creating your own mod? If the latter, I would recommend you post across in the Mod Creation Help forum, along with sharing your mod as an attachment. If not, read on below.

If you are not sure which mod(s) are the cause, there are still ways to find out. In the same location as the Database.log file, there is a Modding.log file. This catalogues which files/mods are responsible for the errors in Database.log. It's a bit of a roundabout process to link the two, and it goes something like this:

1. Grab the timestamp from the Database.log that is on the same line as the first 'ERROR'. In your case, it is: [304366.031]
2. Search for that same timestamp in Modding.log. If you don't get a match, remove the final digit and search for: [304366.03
3. Look at the lines around there - most likely directly above. There should be a reference to a filename, which should indicate the mod it is coming from.
4. Repeat the process for the other errors.

This should give you a good idea of what is causing the error(s) you're receiving. The less scientific approach is to disable all mods, launch a game and validate it works. Then re-enable the mods you want, one at a time, until it fails. The last mod enabled prior to failure is a culprit. Obviously, it may not be the only culprit.

In terms of the nature of the errors themselves, there's a few different flavours. Some of them are duplicate code entries (the 'UNIQUE constraint failed' ones). These are effectively indicating that the same values are trying to be added a second time where they are not allowed.

Some of them are disallowed values (the 'FOREIGN KEY constraint failed' ones). These are effectively indicating that a value is being used somewhere that it isn't allowed - it is most likely that it is a value of the wrong type.

The 'Invalid reference' errors are indicating that a mod is referencing a value that has not been defined yet. Essentially, the game cannot reconcile the string of text because it hasn't been told about it.

It is also worth noting that lots of errors does not necessarily mean lots of sources of those errors. It could be that one oversight in the code could be generating all of those errors - because when the game fails to execute the code in a file (due to an error), the rest of that file will not be processed, hence the snowball effect.
 
Top Bottom