Login problem - "could not acquire file lock"

Jong

New member
Hi, I am trying to return to the game after a six-year break and cannot log in to kolmafia. This is the error I'm getting:

1705256088376.png

There have been other threads on this but they do not have a solution as far as I can tell, e.g., https://kolmafia.us/threads/cant-log-into-kolmafia.29335/

My system32 folder does not have a "sessions" folder. I tried moving the .jar and opening it from a different folder and that does nothing.

Any help would be appreciated. The barrier to entry on this game is extremely high and it's kind of frustrating!

Thanks.
 

fronobulax

Developer
Staff member
C:\Windows\system32 is a protected folder. Running KoLmafia from there is NOT RECOMMENDED and if you insist on doing so you will need to obtain Administrator privileges before running KoLmafia.

The recommended solution is to place the KoLmafia jar file in a directory that the user who is running KoLmafia has full control over and thus can can create, update, read and delete files.

C:\Users\<your user name>\Documents\KoLmafia is one such place.

If you were using some kind of tool that put the jar file in C:\Windows\system32 then you might consider using another tool.
 

Jong

New member
Thank you for taking the time to provide feedback.

When I received the error, I was opening it from a directory similar to the one you suggest, not Windows/System32 (or any other privilege-protected folder). I have since moved it to another such unprotected folder and am receiving the same error.

I'm not well-versed in this sort of thing but it seems like the program looks at the Windows/System32 folder by default for something?

Also - the jar file is all I need, correct? No other files? I downloaded the jar file from the latest build page and it did not appear that other files came with it.

Thank you again. Please let me know if you have any other ideas.
 

Ryo_Sangnoir

Developer
Staff member
On windows, the program looks at the current directory, which for you is system32 (for some reason).

Are you running as the "Administrator" user? That user's home directory is system32, which is why I think it might be that. If so, try creating a non-Administrator user, and running with that.

Yes, all you need is the jar file. Normally, you put that in a particular location, then double click on it, and the "current" directory is interpreted as whichever directory it was stored in. If you run from commandline with "-jar", try navigating to the directory the jar is in, if you're in system32.

Which OS version are you on?
 

Ghost Puncher

New member
I was trying to figure out why I've been intermittently having the same problem, and may have figured it out. When I try to launch kolmafia from the list of recent files, visible when opening File Explorer I get the same inability to acquire a lock in the system32 directory.

However, navigating to where the file is actually stored works fine.
 

fronobulax

Developer
Staff member
I was trying to figure out why I've been intermittently having the same problem, and may have figured it out. When I try to launch kolmafia from the list of recent files, visible when opening File Explorer I get the same inability to acquire a lock in the system32 directory.

However, navigating to where the file is actually stored works fine.

Thank you. I never use File Explorer to launch mafia but you have probably identified an issue.

When mafia starts up it looks for or makes files in the "current" directory. mafia works best when the current directory is the directory containing the jar file. This combined with other reports where the current directory is not what is expected, suggests that starting from recent files sets the current directory to C:\Windows\system32 which does not contain the jar file.
 
Top