Buggy McBugface
I have tracked down the problem, after being sent the Journal files - thanks, Tirello!
In journal file named
Journal.16110155005.01.log at the beginning of the file there is this sequence...
{ "timestamp":"2016-11-01T19:50:05Z", "event":"Fileheader", "part":1, "language":"English\\UK", "gameversion":"2.2", "build":"r125374/r0 " }
{ "timestamp":"2016-11-01T19:52:54Z", "event":"LoadGame", "Commander":"<redacted>", "Credits":<redacted>, "Loan":0 }
{ "timestamp":"2016-11-01T19:52:54Z", "event":"Rank", "Combat":<redacted>, "Trade":<redacted>, "Explore":<redacted>, "Empire":<redacted>, "Federation":<redacted>, "CQC":<redacted> }
{ "timestamp":"2016-11-01T19:52:54Z", "event":"Progress", "Combat":<redacted>, "Trade":<redacted>, "Explore":<redacted>, "Empire":<redacted>, "Federation":<redacted>, "CQC":<redacted> }
{ "timestamp":"2016-11-01T19:54:13Z", "event":"LoadGame", "Commander":"<redacted>", "Ship":"Asp", "ShipID":1, "GameMode":"Group", "Group":"Mobius", "Credits":<redacted>, "Loan":0 }
Notice the two LoadGame event entries.
The one I've highlighted in red is the problematic one.
In my JSON parser, I am expecting there to be the
Ship,
ShipID,
GameMode, and
Group keys, according to the Player Journal documentation as supplied by FDEV.
For whatever reason - there are two entries of the
LoadGame event. The one in red doesn't have these keys. The one in green does.
That errant LoadGame line caused a
KeyError, and CL2 stopped the currently running function, which, in this case, was the import loop.
There is another file which also exhibits this same errant
LoadGame line :
Journal.161201202217.01.log
{ "timestamp":"2016-12-02T01:43:57Z", "event":"LoadGame", "Commander":"<redacted>", "Credits":<redacted>, "Loan":0 }
Your immediate solution is to remove the incorrect
LoadGame lines which I've highlighted in red, from those two files.
I can't see a pattern as to why those lines are added in the nonconforming way they are in those Journal files. At first I thought it was due to the preceding
DockSRV events in front of those, but there are plenty of other
DockSRV events preceding the LoadGame events which are in the correct format.
I also checked the most recent Player Journal documentation and there is nothing to suggest there can be two different versions of the
LoadGame event.
In any case, I should make the import function/loop more robust, in order to make sure that when something unexpected does happen, the loop continues execution.
Also I should file a bug report with FDEV.