Subversion stuck due to "previous operation has not finished"?

SvnTortoisesvn

Svn Problem Overview


If I try to update my subversion repo, it says I must run cleanup. If I run cleanup, it says a file is missing. (I deleted a MASSIVE directory of files that failed to commit this morning from my home pc, but then I commit the same set of files from work, and now my home repo is bust). So, cleanup says:

Cleanup failed to process blablabla Can't set file blablabla read-write: The system cannot find the file specified.

If I update it says:

> Command: Update Error: Previous operation has not finished; > run 'cleanup' if it was interrupted Error: Please execute the > 'Cleanup' command. Completed!:

How do I get this unstuck?

Svn Solutions


Solution 1 - Svn

There is often no need for a new checkout or copying.

I have just solved a similar issue relating to the error "previous operation has not finished" with help from this (Link)

It seems that svn sometimes gets stuck while processing commands/operations. All of these operations are stored in the database file wc.db in the .svn folder.

By downloading SQLite to my checkout directory and running

sqlite3.exe .svn/wc.db "select * from work_queue"

you can get a list of all pending operations. These operations are the ones the error is referring to as "not finished".

By running

sqlite3.exe .svn/wc.db "delete from work_queue"

all of the old operations are deleted from the work queue and the error disapears. No need for a new checkout or anything

Solution 2 - Svn

Running console svn cleanup has solved the same problem for me.

Solution 3 - Svn

I've been in similar situations. Have you tried running cleanup from the root of your workspace? I know sometimes a cleanup from a child directory (where the problem lies) doesn't work, and cleanup from the root of the workspace does.

If that still fails, since you had deleted a child dir somewhere. Try deleting 1 level higher from the child dir as well (assuming that is not the root), and re-trying update and cleanup.

If cleanup attempts aren't succeeding at any level then the answer is unfortunately checkout a new working copy.

Solution 4 - Svn

I just had a similar issue. Running Process Explorer showed that another program (Notepad++) had a file handle to a folder that SVN had tried to delete. When I closed Notepad++, "Clean Up" was able to run successfully.

Solution 5 - Svn

I had tried the most voted answers here and a few others to no avail. My WORK_QUEUE table was empty and I wasn't able to try a clean up at a higher folder. What did work was the following (this is via Tortoise SVN);

  • Right click on folder
  • Go to TortoiseSVN -> Clean Up...
  • Make sure the option to Break Locks is ticked and click OK

The Clean Up operation now completes successfully and I can continue. No downloading of sqlite3 or other convoluted solutions required.

Solution 6 - Svn

I was facing this problem after adding a jar which is already in the SVN and I added the new Version of it with the same name.

In Eclipse I tried this

  1. Right click on folder > Team > Refresh/Cleanup.
  2. Clean, build and refresh my application.
  3. Restart the Eclipse.

Using above steps I am able to Synchronize.

Solution 7 - Svn

Trying to run cleanup while your files are open gave me problems. as soon as I closed my application (Visual studio) I ran clean up and it was successful

Solution 8 - Svn

I use tortoise SVN. When clean up failed, check cleanup option

Make sure the option to Break Locks is checked.

Cleanup step

  • left mouse button in explore folder
  • select 'Tortoise SVN' -> 'Clean up...' menu
  • check 'Break Locks' checked and press 'ok'

It already answered ,but sometimes picture helps

enter image description here

Solution 9 - Svn

I got the same problem, in my case I was using svn tortoise with the application I mean. Using the cmd shell of windows in root mode I applied svn cleanup and then svn update.... Then you can comeback to the application mode aand it will work perfectly!

Solution 10 - Svn

I have also stuck with the same issue I have tried blow:

1.Try kill the process related to svn i.e. TSVNCache.exe and TortoiseProc 2.Reverting the unversioned files and deletion of same, which I have in svn . 3.cleanup using command prompt "svn cleanup"

and finally when restarted the desktop it worked for me , So for restart of system worked for me

Solution 11 - Svn

I tried removing the .svn folder to other location and placed it back in the same root folder. After when I tried to update the SVN, it got updated. I don't know how exactly it worked.

Solution 12 - Svn

I had the same problem, and somehow found that I had a hidden .svn file at the c:\ level. Once I deleted this hidden folder (.svn), everything worked okay. I must have unintentionally created a working directory at the root drive.

Solution 13 - Svn

In my case I had gulp-watch running that caused the problems. After stopping it I could execute Cleanup command.

Solution 14 - Svn

In my cases, after I close Visual Studio and retry the CleanUp, it works.

Solution 15 - Svn

I resolved this error today when it occurred trying to Commit to SVN. The error was genuine, TortoiseSVN could not access a file which I tried to Commit. This file had been saved while running a program "As Administrator" in Windows. This means the file has Administrator access but not access from my account (TortoiseSVN running as interactive user). I took ownership of the nominated file under my windows account and after that Cleanup was able to proceed.

Solution 16 - Svn

I have seen several issues with svn, including this one, solved by deleting/creating an .svn/tmp directory. Then run svn cleanup

Solution 17 - Svn

delete the svn from the main folder and replace it from another viable copy you have from elsewere.and then update. svn folder will be normally a hidden folder. So, please make sure, to unhide the folder before doing the above steps.

Solution 18 - Svn

Workaround that worked for me:

  1. Cut the content of your directory and copy it to another folder.
  2. Run cleanup from command line on the empty folder.
  3. Copy the files back in the original folder.

Done, but I cannot explain why this happens. If you don't remove the files, the cleanup command say that he can't read/write those files.

Solution 19 - Svn

I had the same issue, what worked for me:

  1. Copy your folders and files to another place, say to a folder (I changed my files recently and the commitment failed and led to the addressed problem)
  2. check out a new working copy
  3. copy your changed files from folder to your working copy and override existing files. Commiting / Updating should work now

Solution 20 - Svn

I had an error such as "Can't change perms of file '/Users/Code/UnitTest.cpp': No such file or directory". The subversion is confused about a file that is no longer there. I simply did something like "echo ABCD >> /Users/Code/UnitTest.cpp" to create a copy of the file, then cleanup. It worked.

Solution 21 - Svn

In my case, the error appeared when trying to commit from within an IDE. When I executed the commit of the same directories with TortoiseSVN in the explorer, the operation succeeded.

Solution 22 - Svn

That has happened for me when using externals and one of them was corrupt. I had to go to that folder and perform a cleanup. Then the cleanup worked for the entire working copy.

Example: Using external ^/widgets/foo common/foo-widget, first perform cleanup on folder common/foo-widget.

Solution 23 - Svn

I initially got this problem trying to check in with TortoiseSVN. Initially, both, TortoiseSVN clean up and console svn cleanup both failed with similar messages as the original poster.

But my solution, (found out accidentally) was just to wait a few minutes. I am thinking TSVNCache was holding on to some of those files at the time of check in.

Solution 24 - Svn

In my case a background Java Virtual Machine instance was running, killing which cleanup was successful.

Solution 25 - Svn

I had taken .svn folder from my fellow developer and replaced my .svn folder with this. It worked for me. Don't know what may be other consequences!

Solution 26 - Svn

This can happen when you have files still open when you try to SVN switch / cleanup.

I had a branch where I had created a new file, which I had open in another application. Switching to another branch could not remove the file causing the switch to fail. This was also causing the svn cleanup to fail, however this is not displayed as the reason in the Tortoise SVN UI.

Running svn cleanup from a console window (on the root folder) clearly shows the error file\location\file.ext: The process cannot access the file because it is being used by another process

Closing any open file handles / windows and running the console svn cleanup then allows the cleanup to work correctly.

Long story short - run svn cleanup in the console to see a more detailed error.

Solution 27 - Svn

Further to Sigurd V's answer (you should try that first), some larger code bases have multiple '.svn' folders, and it's not necessarily the one in the root directory which has the locked task.

If that's the case, you have to check each one. If you've already got SQLite and Powershell you can locate the offending directory quickly.

To find which folders is locked run (replacing path\to\sqlite.exe):

Get-ChildItem -Path . -Filter '.svn' -Recurse -Hidden | foreach { $toFind = $_.FullName + "\wc.db" ; gci $toFind | foreach { echo $_.FullName ; path\to\sqlite.exe $_.FullName "select * from work_queue" } }.

This gives a list of .svn directories and, below each one, a list of any current tasks.

If there are any with unfinished tasks, for each one run (replacing path\to\sqlite.exe and path\to\.svn\wc.db):

path\to\sqlite.exe path\to\.svn\wc.db "delete from work_queue"

Solution 28 - Svn

In Eclipse;

  1. Right click on your project folder > Team > Refresh/Cleanup.
  2. In Eclipse window, select clean option under Project menu item
  3. Finally, restart Eclipse

Solution 29 - Svn

follow below steps.

  1. Go to the directory where you are not able to successfully clean up via svn.(Root folder or child folder).

  2. Select .svn folder in the directory, cut that folder and paste it in the separate drive or separate location (out of svn directory)

  3. Now, go back to the directory - right click and select TortoiseSVN -->Repo-browser

  4. Checkout the folder(it will not perform fresh checkout).

  5. All your items will be versioned again, and it will repair the internal issue of svn, and problem should be solved.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncoderamaView Question on Stackoverflow
Solution 1 - SvnSigurd VView Answer on Stackoverflow
Solution 2 - Svnuser2902464View Answer on Stackoverflow
Solution 3 - SvnJoshua McKinnonView Answer on Stackoverflow
Solution 4 - SvnGlen LittleView Answer on Stackoverflow
Solution 5 - SvnDiskJunkyView Answer on Stackoverflow
Solution 6 - SvnRakesh ChouhanView Answer on Stackoverflow
Solution 7 - SvnJohnView Answer on Stackoverflow
Solution 8 - Svns.cView Answer on Stackoverflow
Solution 9 - SvnGutiMacView Answer on Stackoverflow
Solution 10 - SvnAnkur NirmalkarView Answer on Stackoverflow
Solution 11 - SvnAjayvigneshView Answer on Stackoverflow
Solution 12 - Svnmike goldView Answer on Stackoverflow
Solution 13 - SvnMariusz PawelskiView Answer on Stackoverflow
Solution 14 - SvnAli SadriView Answer on Stackoverflow
Solution 15 - SvnKim Anthony GrovesView Answer on Stackoverflow
Solution 16 - SvnVinnie JamesView Answer on Stackoverflow
Solution 17 - Svndigish a dView Answer on Stackoverflow
Solution 18 - SvnPaoloView Answer on Stackoverflow
Solution 19 - SvnguestView Answer on Stackoverflow
Solution 20 - SvnSmallChessView Answer on Stackoverflow
Solution 21 - SvnDaniView Answer on Stackoverflow
Solution 22 - SvnerikHView Answer on Stackoverflow
Solution 23 - SvnJahmicView Answer on Stackoverflow
Solution 24 - SvncoretechieView Answer on Stackoverflow
Solution 25 - SvnManish DubeyView Answer on Stackoverflow
Solution 26 - SvnJamie PollardView Answer on Stackoverflow
Solution 27 - SvnRobert GowlandView Answer on Stackoverflow
Solution 28 - Svnharun ugurView Answer on Stackoverflow
Solution 29 - SvnKunal KhatriView Answer on Stackoverflow