CKAN icon indicating copy to clipboard operation
CKAN copied to clipboard

CKAN complains about temp files when upgrading a mod and installing another one at the same time

Open judemille opened this issue 9 years ago • 43 comments

When I download a large amount of mods, CKAN barfs, complaining that it can't access this ONE temp file.

Unhandled exception:
System.IO.IOException: The process cannot access the file 'C:\Users\FireFaced\AppData\Local\Temp\tmp8C0B.tmp' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalDelete(String path, Boolean checkHost)
at CKAN.NetAsyncDownloader.ModuleDownloadsComplete(Ne tFileCache cache, Uri[] urls, String[] filenames, Exception[] errors)
at CKAN.NetAsyncDownloader.<DownloadModules>c__AnonSt orey2.<>m__1(Uri[] _uris, String[] paths, Exception[] errors)
at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System. Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

judemille avatar Aug 10 '15 16:08 judemille

May be related to #801

Postremus avatar Aug 10 '15 20:08 Postremus

I don't think so. @Postremus

judemille avatar Aug 10 '15 20:08 judemille

Okay, I cleared my temp file, issue doesn't seem to come up. Closing this, and it seems that it is related to #801

judemille avatar Aug 12 '15 16:08 judemille

All right, I'm sick of this. Now it's holding onto a different temp file EVEN THOUGH my temp folder is merely 1MB

judemille avatar Aug 12 '15 23:08 judemille

facepalm Remind me NOT to click the close button

judemille avatar Aug 12 '15 23:08 judemille

Ugh. @pjf can you please reopen this? I didn't mean to click "comment and close"

judemille avatar Aug 12 '15 23:08 judemille

Thank you, I didn't mean to close it after I reopened it.

judemille avatar Aug 13 '15 12:08 judemille

I am able to reliably reproduce temp file issues by trying to both upgrade a mod and install a new one at the same time. Not sure if it's related.

squizzeak avatar Aug 13 '15 14:08 squizzeak

Yeah, usually when I install mods, I also just run through the upgrades. Strange

judemille avatar Aug 13 '15 14:08 judemille

Anyone?

judemille avatar Aug 14 '15 17:08 judemille

Can you Point the issue down to a specific mod?

Postremus avatar Aug 14 '15 17:08 Postremus

No, it's pretty broad. It usually comes up when I install a lot of mods AND upgrade a bunch of mods at the same time.

judemille avatar Aug 14 '15 17:08 judemille

I've had it occur with as little as a single new mod install and a single mod update in the same change list.

squizzeak avatar Aug 14 '15 18:08 squizzeak

Huh. Yeah, the issue is quite broad.

judemille avatar Aug 14 '15 18:08 judemille

@FireFaced @squizzeak I am unable to reproduce this bug. Would you mind testing a dev version which may fix this issue?

Postremus avatar Aug 14 '15 18:08 Postremus

Sure

judemille avatar Aug 14 '15 18:08 judemille

https://dl.dropboxusercontent.com/u/46071056/CKAN/ckan.exe Please paste the new exception.

Postremus avatar Aug 14 '15 18:08 Postremus

I gave this issue a higher priority, since it is a bad thing if ckan doesn't do it's job (installing mods).

Postremus avatar Aug 14 '15 18:08 Postremus

Same result with the version you posted, attempting to update 3 mods and install 1 new one.

Unhandled exception:
System.IO.IOException: The process cannot access the file because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
   at ChinhDo.Transactions.TxFileManager.Move(String srcFileName, String destFileName)
   at CKAN.NetFileCache.Store(Uri url, String path, String description, Boolean move)
   at CKAN.NetAsyncDownloader.ModuleDownloadsComplete(NetFileCache cache, Uri[] urls, String[] filenames, Exception[] errors)
   at CKAN.NetAsyncDownloader.<>c__DisplayClass19_0.<DownloadModules>b__1(Uri[] _uris, String[] paths, Exception[] errors)
   at CKAN.NetAsyncDownloader.FileDownloadComplete(Int32 index, Exception error)
   at CKAN.NetAsyncDownloader.<>c__DisplayClass16_0.<DownloadNative>b__1(Object sender, AsyncCompletedEventArgs args)
   at System.ComponentModel.AsyncCompletedEventHandler.Invoke(Object sender, AsyncCompletedEventArgs e)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

OS: Windows 8.1 Pro x64

squizzeak avatar Aug 14 '15 19:08 squizzeak

Okay, it's confirmed: Upgrade mods, and install at least one mod at the same time, get this:

Unhandled exception:
System.IO.IOException: The process cannot access the file 'C:\Users\FireFaced\AppData\Local\Temp\tmpB938.tmp' because it is being used by another process.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalDelete(String path, Boolean checkHost)
   at CKAN.NetAsyncDownloader.ModuleDownloadsComplete(NetFileCache cache, Uri[] urls, String[] filenames, Exception[] errors)
   at CKAN.NetAsyncDownloader.<DownloadModules>c__AnonStorey2.<>m__1(Uri[] _uris, String[] paths, Exception[] errors)
   at CKAN.NetAsyncDownloader.FileDownloadComplete(Int32 index, Exception error)
   at System.ComponentModel.AsyncCompletedEventHandler.Invoke(Object sender, AsyncCompletedEventArgs e)
   at System.Net.WebClient.OnDownloadFileCompleted(AsyncCompletedEventArgs e)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch() 

I'm on Win 10 Home x64

judemille avatar Aug 17 '15 15:08 judemille

I actually got the same (with a different temp file name). Win7 64-bit. Upgrading Chatterer and installing KAL9000

mheguy avatar Aug 17 '15 15:08 mheguy

So, it's most versions of Windows.

judemille avatar Aug 17 '15 15:08 judemille

@plague006 I don't think that's relevant, TBH. It seems to not matter which mod is installed/upgraded, just that you upgrade and install mods at the same time.

judemille avatar Aug 17 '15 15:08 judemille

You're correct that it's not about which mods. I just provide information if it's available.

mheguy avatar Aug 17 '15 15:08 mheguy

Okay, that's reasonable, since people ask for ALL THE DETAILS

judemille avatar Aug 17 '15 15:08 judemille

Anybody? I REALLY just want to have CKAN manage mods properly.

judemille avatar Aug 19 '15 00:08 judemille

@FireFaced @plague006 Does the .zip of the mod already exists in your CKAN/dowloads Folder before you install / update the mod? Does it still exists after the install / update ?

Postremus avatar Aug 19 '15 05:08 Postremus

@Postremus, it wouldn't matter, the ZIP file has a different name in each version. Also, the mods I've been installing in the tests were never in my cache.

judemille avatar Aug 19 '15 12:08 judemille

In my case the files weren't cached @Postremus, and the .zips are present after the transaction.

mheguy avatar Aug 19 '15 12:08 mheguy

Ok, ckan is srupid.

----- Ursprüngliche Nachricht ----- Von: "Matthew" [email protected] Gesendet: ‎19.‎08.‎2015 14:46 An: "KSP-CKAN/CKAN" [email protected] Cc: "Martin Panzer" [email protected] Betreff: Re: [CKAN] CKAN complains about temp files when upgrading a mod andinstalling another one at the same time (#1367)

In my case the files weren't cached @Postremus, and the .zips are present after the transaction. — Reply to this email directly or view it on GitHub.

Postremus avatar Aug 19 '15 14:08 Postremus