KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.94k stars 349 forks source link

Can't access registry.locked #4097

Closed kosha227 closed 2 months ago

kosha227 commented 2 months ago

Is there an existing issue for this?

Operating System

Windows 10

CKAN Version

1.34.4

Games

KSP 1

Game Version

1.12.5

Did you make any manual changes to your game folder (i.e., not via CKAN)?

No

Describe the bug

When i starting CKAN, that appears: Unhandled excaption in th application. When you click Continue, the application will ignore the error and try to continue. Clicking the Ecit button will immediately exit the application Access to the path: "E\for games\Kerbal Spave Program\CKAN\registry.locked" is denied

Steps to reproduce

Start CKAN

Relevant log output

Unhandled exception:
System.UnauthorizedAccessException: Отказано в доступе по пути "E:\for games\Kerbal Space Program\CKAN\GUIConfig.xml".
   в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   в System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   в System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   в System.IO.StreamWriter..ctor(String path)
   в CKAN.GUI.GUIConfiguration.SaveConfiguration(GUIConfiguration configuration)
   в CKAN.GUI.Main.OnFormClosing(FormClosingEventArgs e)
   в System.Windows.Forms.Form.RaiseFormClosingOnAppExit()
   в System.Windows.Forms.Application.ExitInternal()
   в System.Windows.Forms.Application.ThreadContext.OnThreadException(Exception t)
   в System.Windows.Forms.Control.WndProcException(Exception e)
   в System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 

LOG2:

System.UnauthorizedAccessException: Отказано в доступе по пути "E:\for games\Kerbal Space Program\CKAN\registry.locked".
   в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   в System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
   в CKAN.RegistryManager.GetLock()
   в CKAN.RegistryManager..ctor(String path, GameInstance inst, RepositoryDataManager repoData)
   в CKAN.RegistryManager.Instance(GameInstance inst, RepositoryDataManager repoData)
   в CKAN.GUI.Main.<OnShown>b__25_0(Object sender, DoWorkEventArgs evt)
   в System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   в System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
HebaruSan commented 2 months ago

Hey @kosha227, I see that you changed the filename in the stack trace from registry.locked to GUIConfig.xml. Which of these are you actually seeking help with?

HebaruSan commented 2 months ago

For both of those files, you should check their permissions on disk and make sure the user running CKAN is able to read and write them.

For registry.locked specifically, you should make sure you're only running one copy of CKAN at a time. If you try to open another CKAN while CKAN is already running, you'll get errors about locking.

kosha227 commented 2 months ago

For both of those files, you should check their permissions on disk and make sure the user running CKAN is able to read and write them.

For registry.locked specifically, you should make sure you're only running one copy of CKAN at a time. If you try to open another CKAN while CKAN is already running, you'll get errors about locking.

I find that registry.locked log is broken, and GUIConfig for some reason bugged too. But i don't have Registry.locked log, and replaced it by one that i have.

HebaruSan commented 2 months ago

OK, then I recommend checking the permissions of those files on disk. Your OS is telling CKAN that it can't access them, and you'll have to figure out why that is somehow.

kosha227 commented 2 months ago

Checked premissions, but nothing. And added 2nd log. I've finally found part of it.

HebaruSan commented 2 months ago

OK, next I'd check for some sort of anti-virus software that's limiting what CKAN can access.

netkan-bot commented 2 months ago

Hey there! I'm a fun-loving automated bot who's responsible for making sure old support tickets get closed out. As we haven't seen any activity on this ticket for a while, we're hoping the problem has been resolved and I'm closing out the ticket automatically. If I'm doing this in error, please add a comment to this ticket to let us know, and we'll re-open it!