FichteFoll / InsertDate

Sublime Text Plugin that provides a configurable command and popup for inserting the current date and time (with specific format)
MIT License
124 stars 18 forks source link

Error message "Process being used by another process" #25

Closed vongoh closed 9 years ago

vongoh commented 9 years ago

I have InsertDate installed in ST3 under Windows. It was working when I first installed it about 6 months ago. Now when I hit F5 to use the plugin nothing happens.

When I look for the User Settings (to try and reassign the hotkey) there is no entry for InsertDate under Package Settings menu. There are no entries for InsertDate under the Package Control menus either.

When I try and Remove Package to uninstall and reinstall - I get the following error:

Package Control: An error occcurred while trying to remove the installed 
package file for InsertDate.  

[WinError 32] The process cannot access the file because it is being used 
by another process: 'C:\\Users\Username\AppData\\Roaming\Sublime Text 3\Installed Packages\\InsertDate.sublime-package'

I get this error trying to uninstall the plugin, even after a fresh start of Sublime with no projects or files open in ST.

FichteFoll commented 9 years ago

Which InsertDate version are you using (check with "List Packages" command)? Did you update recently? What are the entire contents of the console?

This looks like a duplicate of https://github.com/FichteFoll/InsertDate/issues/23, because I am not keeping handles of the zip anymore that could not be released.

Edit: Actually, this might be caused by upgrading the package due to the above mentioned issue and a restart of ST should be able to fix it.

vongoh commented 9 years ago

List Packages says I'm using v1.0.1

I just received a message from Package Control that there was an update with a changelog last night.. In fact, the update message keeps coming back up whenever I shut down and restart ST .. but the version in List Packages is still 1.0.1

Package Control Messages
========================
InsertDate:
----------
  v2.0.0 (2015-08-21)
  -------------------

The thing is I noticed this problem before the update. The F5 key did not work and I never got around to figuring out why. I just looked at issue #23 - you have the fix in the updates I'm gathering? But I seems like I can't uninstall or update because of this issue.

FichteFoll commented 9 years ago

This may be an inappropriate workflow by package control, where it re-enables the package after the upgrade fails, and then the upgrade fails again. I'll need to check the package control code for that.

Until then, try to uninstall the package completely, then restart, then reinstall.

vongoh commented 9 years ago

Trying to uninstall gives me the error message. Is there a clean way to manually uninstall the package and delete all references to it, without package control? I don't want to tangle things up by simply deleting a directory if that going to cause problems, thanks

FichteFoll commented 9 years ago

I did some investigation. It does seem like this is mainly caused by package control, but triggered by my bad code earlier which, as a result of PC, I can not automatically fix. I either have to fix PC and get wbond to push an update, or tell everyone to remove the package manually, which still works.

You said you got an update message after the failed upgrade attempt, is that correct? When did you get it exactly? Maybe I can tell users to remove (and automatically upgrade) InsertDate manually that way.

In order do remove it, you need to close Sublime Text (to close the file handles) and then remove the file %APPDATA%\Sublime Text 3\InstalledPackages\InsertDate.sublime-package. Then start ST and let package control download the latest release with the fix.

vongoh commented 9 years ago

I get the update message every time I close down / re-open ST3 now. In fact I just opened it a moment ago and the update message came up again.

Now I deleted the sublime package - restarted ST3 - and there is your new message from Package Control. It asked me to set the timezone, I did, and tested F5 to see if my hotkey is back.

Seems to work great! Thanks for looking into this, handy little utility for sure didnt want to lose it.

FichteFoll commented 9 years ago

Alright, I will test this in a local install and see if users are always getting the update messages (because from my current understanding of Package Control's code they should not) and then push a new release with instructions for updating.

Thanks for the report.

FichteFoll commented 9 years ago

Update: This will hopefully be resolved by a Package Control update in the next few days.

FichteFoll commented 9 years ago

Package Control has been updated and includes a fix for this situation that will be fixed by restarting ST after attempting to update or remove InsertDate 1.0.1.

I'll be releasing a new version with minor changes and mention this in the update message.