Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot log warnings: "Couldn't flush user prefs: java.util.prefs.BackingStoreException" #3738

Closed
ron-murhammer opened this issue Aug 6, 2018 · 6 comments
Labels
Problem A problem, bug, defect - something to fix

Comments

@ron-murhammer
Copy link
Member

The following warning appears in the logs very frequently:

java.util.prefs.FileSystemPreferences syncWorld
WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.

If this is harmless then it should be removed otherwise we should look into the problem.

@RoiEXLab
Copy link
Member

RoiEXLab commented Aug 6, 2018

Hmm this shouldn't happen for 2 Reasons:

  1. Bots shouldn't store any preferences at all
  2. This error message likely indicates it tried to add a folder in the users home directory but failed doing so due to missing permissions.

@DanVanAtta DanVanAtta changed the title Lots of Warnings in Logs Bot log warnings: "Couldn't flush user prefs: java.util.prefs.BackingStoreException" Nov 10, 2018
@DanVanAtta DanVanAtta added Problem A problem, bug, defect - something to fix and removed Infrastructure labels Nov 10, 2018
@DanVanAtta
Copy link
Member

Changing type to 'bug', considering this a logging bug which would need a code change to fix one way or another.

@stale
Copy link

stale bot commented Sep 15, 2019

The TripleA team regrets this issue was not solved sooner. To keep focus on latest issues and the most pressing tasks, this issue has been automatically marked as stale because it has not had recent activity. If the issue may be closed, please do so. If there are remaining items, we encourage for those items to be resubmitted as new, independent, concise tasks. The strategy is divide and conquer. Thank you for your contributions.

@stale stale bot added the Stale label Sep 15, 2019
@stale stale bot closed this as completed Sep 18, 2019
@DanVanAtta DanVanAtta reopened this Aug 6, 2021
@stale stale bot removed the Stale label Aug 6, 2021
@zlefin
Copy link

zlefin commented Nov 16, 2022

I reviewed the chat logs of all the bots; at the present date, the bug occurs ONLY in the 900 number bots, which are labeled Frankfurt bots. It occurs in all the 90x bots, and none of the bots from other numbers. @RoiEXLab

@zlefin
Copy link

zlefin commented Nov 16, 2022

Based on the explanation of the error at this site:
https://www.ibm.com/support/pages/starting-websphere-application-server-gives-warning-message-could-not-lock-user-prefs

It appears the problem is that whatever server the Frankfurt bots are running on does not have its java setup correctly; it lacks a user_home directory. I don't know whether we have any direct control over whatever that bot is running on in order to fix that; or if we can contact the people who run it to get them to fix it. The simplest fix by far would involve that computer having its directory set, if we can arrange for that.

Since the server bot shouldn't be saving any preferences of its own, it must be about general java preferences.

Seeing as people have been using the offending bots for games, it appears that whatever the problem is, it does not substantially worsen gameplay; so we could just catch and ignore the exception.

Any fix we implement would require the bot to be redeployed so it gets the update.

I don't know how our progress is on the plan to replace the bots with that alternate system; once that's completed it would render this problem moot.

edit:
based on the various files which can throw a relevant exception, and that most of them catch it and provide a custom logging message which does not match what is showing up in the log; it's likely that the problem occurs in
game-app/game-core/src/main/java/games/strategy/engine/chat/ChatIgnoreList.java

I cannot tell which parts of the engine code get used by a bot, and which it cannot access at all. So I cannot use that to exclude any possibilities.

@RoiEXLab
Copy link
Member

RoiEXLab commented Jan 5, 2023

@zlefin Thank you for digging into this issue. It should be resolved now. Basically on "Frankfurt" the "bot user" did not have a home directory, making it impossible for it to store preferences somewhere. So I created the home directory for it and added the directories for preferences manually (I believe it would have automatically created the directories on restart, but I didn't want to restart the bot if there isn't a good reason for it.) As soon as I created the prefs directory and gave it the correct permissions the error messages instantly stopped.

A couple of questions remain though:

  1. Why didn't the bot home directory exist on this server, but on other servers? My best guess is that when the servers where initially created we were still doing the setup manually and thus the differences were cause by that.
  2. Why are the preferences used in the first place? The only thing that was stored seems to be the "system-id" which is generated for every client, but I'm not sure if it's actually being used by the bots.

Thoughts @DanVanAtta ?

@RoiEXLab RoiEXLab closed this as completed Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Problem A problem, bug, defect - something to fix
Projects
None yet
Development

No branches or pull requests

4 participants