Ckan: Could not find a part of the path 'C:\Users\name\Appdata\Local\Temp\CdFileMgr\02a3e06-bc35-40.json'.

Created on 4 Mar 2018  路  18Comments  路  Source: KSP-CKAN/CKAN

Background

CKAN Version:
1.24.0

KSP Version:
1.3.1.1819

Operating System:
Windows 10

Have you made any manual changes to your GameData folder (i.e., not via CKAN)?
No.

Problem

What steps did you take in CKAN?
Was installing mods: EVE, Scatterer, SVE, Science Full reward, Science alert

What did you expect to happen?
Mods being installed

What happened instead?

Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue, if you click Quit, the application will close immediately.
Could not find a part of the path 'C:\Users\name\Appdata\Local\Temp\CdFileMgr\02a3e06-bc35-40.json'.

Screenshots:
image
image
*Progress bar is stuck at 70%

CKAN error codes (if applicable):

************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\name\AppData\Local\Temp\CdFileMgr\02a3e0a6-bc35-40.json'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at ChinhDo.Transactions.WriteAllTextOperation.Execute()
   at ChinhDo.Transactions.TxFileManager.EnlistOperation(IRollbackableOperation operation)
   at CKAN.RegistryManager.Save(Boolean enforce_consistency)
   at CKAN.ModuleInstaller.InstallList(ICollection`1 modules, RelationshipResolverOptions options, IDownloader downloader)
   at CKAN.Main.InstallMods(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)
Windows

All 18 comments

Interesting. Does this happen every time, or was it a one-off? Can you please check whether these folders exist?

  • C:UsersnameAppdata
  • C:UsersnameAppdataLocal
  • C:UsersnameAppdataLocalTemp

Yeah all of those folders exist sorry for the late reply

Thanks, what about C:UsersnameAppdataLocalTempCdFileMgr ?

Oh no it's not there

How do I get it back there?

That's quite strange! The Transactions library attempts to create that folder if it doesn't exist:

https://github.com/rsevil/Transactions/blob/8125415d5a74eb129d2d0311762362dfa2679193/src/ChinhDo.Transactions.FileManager/TxFileManager.cs#L16-L22

https://github.com/rsevil/Transactions/blob/8125415d5a74eb129d2d0311762362dfa2679193/src/ChinhDo.Transactions.FileManager/Utils/FileUtils.cs#L8-L20

As far as I know, there is nothing that would stop that call from succeeding, since you would always have access to your own AppdataLocalTemp folder. Maybe one of those Windows Defender type things?

You could try creating the folder yourself in Windows Explorer:

  1. Open C:UsersnameAppdataLocalTemp
  2. Ctrl-shift-N to make a new directory
  3. Type CdFileMgr to set the name
  4. Press enter

Creating the folder seems to have fixed it (even if it's empty)
Thanks!

Even after creating the folder previously, I added 2 new mods today, and it threw this error again. Manually adding the folder fixed it, again. Adding and removing previously cached/installed mods did not trigger this error.

Thanks, @GargamelKSP, that's a helpful clue. It means that something is _deleting_ the folder, not just failing to create it.

Can you please check whether you have this "Storage Sense" thing turned on, and/or "Delete temporary files that my apps aren't using"? Maybe Windows 10 is deleting it in a scheduled background task:

Nope, had to check, but it's turned off.

Downloading and installing new mods while CKAN is still open from a manual fix earlier, error is not thrown.

Closing Ckan, reopening it, and DL and installing new mods also did not throw an error this time. Previous (second) error was after a reboot.
If you need any other testing, ask.

Running CKAN in administrator mode fixes this for me.

Running CKAN in administrator mode fixes this for me.

Why would you do that? Do you not care about your PC becoming part of some bot army, using up all your CPU resources?

I haven't looked at the code that much, but:

It only checks to see if the folder is there when the TxFileManager is created. But this happens hours after it was created. I'm guessing that it creates it when you first go to the web, and relies on it being there for the duration of the session

Good call, so maybe we can work around this by changing how and when we create TxFileManager objects. A search turns up several that are private static readonly, which should possibly be shorter-lived and only created as needed...

I'll leave it in your hands

Suffice to say, I would really like to see this fixed. It's very annoying to have to close and reopen CKAN every few hours

Was this page helpful?
0 / 5 - 0 ratings