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

Updating and installing at the same time causes an exception error #1667

Closed
KSPjohnFX opened this issue Apr 18, 2016 · 5 comments
Closed

Updating and installing at the same time causes an exception error #1667

KSPjohnFX opened this issue Apr 18, 2016 · 5 comments

Comments

@KSPjohnFX
Copy link

KSPjohnFX commented Apr 18, 2016

CKAN Version: 1.16.1

Operating System: Windows 7

The issue you are experiencing: Updating and installing at the same time causes an exception error

How to recreate this issue: select a mod to update, select a mod to install, apply changes

CKAN error codes (if applicable):

Unhandled exception:
System.IO.IOException: The process cannot access the file 'C:\Users\John\AppData\Local\Temp\tmpC1A1.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 suspect the same temp file is being used for installs and upgrades causing an access error when upgrading and installing at the same time.

Possible fix if that is the problem, use a different naming structure for the two processes.

@plague006
Copy link
Contributor

plague006 commented Apr 19, 2016

We appreciate the bug report, but this issue has been around for a fair bit of time and has proven itself difficult to squash. Until a solution is found, you'll need to install and update separately. Closing this as a duplicate of #1367.

Edit: Thanks @politas for pointing out my link was to the wrong issue.

@DocBennett
Copy link

@plague006 Is there a way to move forward though? My CKAN will not update Module manager now even if attempting to update it all by itself.

@plague006
Copy link
Contributor

@DocBennett CKAN won't update MM because of a locked temp file? Or are you getting a different error message?

@DocBennett
Copy link

@plague006 I got it to clear out by manually deleted the previously MM files - it processed the update after that it seems.

@KSPjohnFX
Copy link
Author

quoted from #1367

"Workaround for now is just not to install AND upgrade mods in one changeset."

Could that not be the internal solution CKAN uses?

What is to stop an update being done first then install mods once that has completely finished?

If the issue is installing and upgrading at the same time then just don't do that by coding the 'apply changes' section of code to run twice, one for upgrade, one for install.

Then it does not matter what causes the bug as the trigger for the cause is avoided.

Not elegant but functional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants