Prefs.txt File being reset

dapanda

Member
I know there is a bug report with this but I have a tangent question and I wanted to give the background. I run mafia on Windows and use Chrome to run the relay browser.

Bug report:

In the past my _prefs.txt file has been reset to default a few times and I don't know what would cause it. In the past 6 months, not counting today, it has happened probably 3 times. My computer is pretty stable with no power loses and when the script is done running it runs cli_execute("quit"); to exit. Each time it happened in the past I would update to the latest build and rebuild the preferences by hand as I remembered them.

In the last 24 hours my _pref.txt has been reset twice. Below are the details:
-Running r27334 after rollover last night, I boot up mafia and discover that all my preferences are gone. There was no issue the previous kol day that I know of (as my scripts will fail if the prefs file gets reset.)
-I go to download the latest version of mafia off of ci.kolmafia.us: r27410
-I move the new version to my kolmafia file and I set the pref file as best I could when my script runs into a problem.
-I run probably 50% of the script and keep running into my script aborting because of prefs not being set so I decide to finish it up tomorrow.
-I leave mafia open and I come back this morning to finish my turns, (computer was on all night, no power outages or program crashes)
-I clicked on the map icon in the browser window (I run kolmafia with chrome) to have kolmafia reconnect. I had it at http://127.0.0.1:60080/game.php.
-Nothing happens so I click on the map in the kolmafia window.
-kol opens in a new browser window and upon loading "Ezandora guide relay" I notice that all my tasks have reset as if I could use them again.
-Checking the pref file and kolmafia in program settings, it has returned everything to default, from my breakfast settings to zone adventuring choices as it normally does.
-Checking the settings folder a dapanda_prefs.bak file was created but it only had one line in it: lastKingLiberation=174

Is there a script or command that will check and update your prefs file with the iotms and areas you have access to along with skill count (like manual of numberologys)? I haven't been able to find this and maybe I am not just looking in the right area of the site.
 

MCroft

Developer
Staff member
Yes, this is helpful. It tells me that when it read the preferences, it found one item.


I'm trying to find a set of steps to blow up the preferences, and it seems that leaving KoLmafia running and having KoL log you out for inactivity is part of the pattern.

The odd thing is that that pref is only set in conjunction with another pref, KingLiberated = False. So how did you get one but not both?
 

dapanda

Member
I have been in this run for a very long time and the prefs.txt file definitely is missing some general values you would have from just playing the game. Checking that through, I do have KingLiberated = True. Another thing that mafia started doing recently is all my scripts are missing from the dropdown of the main mafia window when loading it up. If I load another window like items or the scripts window itself I can see all my scripts and folders but normally the primary window will not show them.
 

fronobulax

Developer
Staff member
I have been in this run for a very long time and the prefs.txt file definitely is missing some general values you would have from just playing the game. Checking that through, I do have KingLiberated = True. Another thing that mafia started doing recently is all my scripts are missing from the dropdown of the main mafia window when loading it up. If I load another window like items or the scripts window itself I can see all my scripts and folders but normally the primary window will not show them.

There are some known but unfixed issues with the scripts menus. If it is important I can find an open Bug Report or two. That said, the display issue doesn't seem to depend upon selected preferences being set, changed or absent.
 

Lacey Jones

New member
I am having this exact same issue, any steps to solve it? My breakfast is not getting pocketwishes or casting daily skills, and even numberology is always saying it already used today even with zero uses. Also seems to have missed my chit configs and all that.
And as it was mentioned, I think it might have to do with leaving mafia open for a long period of time, or leaving it open during rollover, that is the kind of behavior I had in the last few days before the bug happened to me.
 
Last edited:

fronobulax

Developer
Staff member
I am having this exact same issue, any steps to solve it? My breakfast is not getting pocketwishes or casting daily skills, and even numberology is always saying it already used today even with zero uses. Also seems to have missed my chit configs and all that.
And as it was mentioned, I think it might have to do with leaving mafia open for a long period of time, or leaving it open during rollover, that is the kind of behavior I had in the last few days before the bug happened to me.

I'm running 27740. For the past few days I have been seeing issues with preferences. I tend to log out, shut down and log back in and I am running more than one character at once. The clip art and request sandwich preferences are either not being set when used or the preference is not being saved. Mafia sometimes thinks I have not finished Breakfast when I have. I have seen no evidence of file corruption. I did have some problems possibly related to Dropbox. My mafia directories had been sync'd by Dropbox. I had to reinstall it and started seeing preference concerns. I also created a new file, edited it, ran it, and then could not find it. I moved mafia out of Dropbox but I want to eliminate that as a problem before I look more at this. I am reporting it because there have been recent changes that might have unintentionally introduced some issues with some preferences and so someone else might know where to look.
 

heeheehee

Developer
Staff member
The only change to src/net/sourceforge/kolmafia/preferences in the past 2 months added some string constants to an array, so I'm skeptical that something changed in Mafia recently.

Is Crimbo lag still a thing? I know sometimes the server responds with a timeout and then proceeds to finish processing the request.
 

fronobulax

Developer
Staff member
The only change to src/net/sourceforge/kolmafia/preferences in the past 2 months added some string constants to an array, so I'm skeptical that something changed in Mafia recently.

Is Crimbo lag still a thing? I know sometimes the server responds with a timeout and then proceeds to finish processing the request.

If I were going to look at a mafia change it would be the one that added which Crimbo2023 areas were available based on "state". New preferences and new parsing so there was at least a possibility something interfered with another preference being updated. But I often think theoretically possible is probable enough to worry about what it isn't so this may be one of those times.

I sorted out my Dropbox issues and don't recall seeing any preference related problems today so maybe Crimbo Lag is still a thing.
 

dapanda

Member
I am probably calling the problem down onto myself but since the backup pref file was created, in the bug report I linked, I haven't had any problems.

The main thing I was looking for with this was a command that could be run that would check ALL skills and abilities access areas to make sure kolmafia had the right prefs for them. It wouldn't be something that would be run a lot because of the massive number of things but it was to just fixes issue with the pref file. My pref file is 3,399 lines long so doing a recreate by memory/by hand is impossible. I just look at my snapshot when I need to set settings in it.
 
Last edited:

fronobulax

Developer
Staff member
The main thing I was looking for with this was a command that could be run that would check ALL skills and abilities access areas to make sure kolmafia had the right prefs for them.

That is not going to be an easy thing to build.

Mafia is somewhat self healing because it will check things as a side effect of something it is already doing. It has to be that way because players can do things that effect the preferences outside of mafia.

There may be opportunities for mafia to be a bit more robust. For example I had a script that went into an infinite loop because request sandwich had already succeeded but the preference was wrong and failures did not change that. It might be that there is more than one failure message and mafia could use it to reset the preference. Then I would not have to fix my script :)
 

fronobulax

Developer
Staff member
I have a couple of debug logs that indicate a connection problem so Crimbo lag is certainly a thing. have not investigated to see whether the log is "informational" or whether mafia needs to handle an exception.
 

dapanda

Member
Yea this was more of a "does this thing exist" than a "please build this thing". I am very thankful for all the hard work everyone puts in with this.
 
Top