Bug #25764
UpgradePipeline Not Reading Newest File Version?
0%
Description
Implementing an `UpgradeScript` for .craft files. The script updates some PartModule ConfigNodes and deletes others. Appears to work correctly in a Windows environment, but in a Linux environment the changes are written to the .craft file but not applied during the craft load when the UpgradeScript runs. The ConfigNode passed to the PartModule's OnLoad(ConfigNode node) method is from before the UpgradeScript's changes were applied.
Immediately loading the .craft file again resolves the issue -- assuming a player does not save the craft in the un-updated state.
Log excerpt, showing OS and KSP version, triggers for the Upgrade Pipeline, debug statement of the resulting ConfigNode after upgrading, and debug statement of the ConfigNode as seen by the PartModule's OnLoad method. Full log and example craft files attached.
--
[LOG 18:42:07.354] *** Log Initiated for Kerbal Space Program - 1.10.0.2917 (LinuxPlayer) en-us ***
Kerbal Space Program - 1.10.0.2917 (LinuxPlayer) en-us
OS: Linux 5.4 Linuxmint 20 64bit
...
[LOG 18:44:48.952] [PF] UpgradePipeline OnTest() context Craft for KzInterstageAdapter2_4294542018. Upgrade requested: Upgradeable
[LOG 18:44:48.952] [PF] UpgradePipeline OnTest() context Craft for KzProcFairingSide2_4294543114. Upgrade requested: Pass
[LOG 18:44:48.952] [PF] UpgradePipeline OnTest() context Craft for KzResizableFairingBase_4294544232. Upgrade requested: Upgradeable
...
[LOG 18:44:48.958] [PF] Updated ProceduralFairingBase with Adapter data to MODULE { name = ProceduralFairingBase isEnabled = True extraRadius = 0 autoStrutSides = True autoShape = True manualMaxSize = 1.14999998 manualCylStart = 0 manualCylEnd = 2 stagingEnabled = True baseSize = 1.25 topSize = 1.25 height = 2 extraHeight = 0 autoDecoupleTopNode = False mode = Adapter EVENTS { } ACTIONS { } UPGRADESAPPLIED { } }
...
[ERR 18:44:49.033] [PF] OnLoad did not find mode param, requesting legacy load. ConfigNode= MODULE { name = ProceduralFairingBase isEnabled = True extraRadius = 0 autoStrutSides = True autoShape = True manualMaxSize = 1.14999998 manualCylStart = 0 manualCylEnd = 2 stagingEnabled = True EVENTS { } ACTIONS { } UPGRADESAPPLIED { } }