Subversion stuck due to "previous operation has not finished"?
Solution 1
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 2
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 3
Running console svn cleanup
has solved the same problem for me.
Solution 4
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
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.
Related videos on Youtube
rockstardev
Updated on July 27, 2022Comments
-
rockstardev almost 2 years
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?
-
rockstardev about 12 years(other than deleting all the SVN info, and re-checking out)
-
phuclv over 10 yearsthat annoying error is why I hate svn. Each time facing this I have to re-checkout because cleanup from root folder or parent folder doesn't work. But the biggest problem is that it doesn't display overlay icons at that time so I don't know which file has been changed to backup before checking out
-
-
Brandon S over 10 yearsThe console command
svn cleanup
will also provide more detailed information than using the Tortoise Explorer plug-in, which makes it very useful in situations like this. -
DDS over 10 yearsRunning the console command will probably give enough info to actually solve the problem. This is a much better answer.
-
Gangnus about 10 yearsThat could produce the problem mentioned in the question. But I am afraid, it can't liquidate it if it already happened.
-
Iman Mahmoudinasab about 10 yearsThis fall me in another error. Finally I install tortoisesvn and run
cleanup
to solve my problem. -
Sigurd V almost 10 yearsYou should always try to run cleanup before trying the above solution. This works if you want to get a stuck SVN repository up and running without having to checkout a new working copy.
-
deadfish almost 10 yearswell i selected the most top folder and used
svn cleanup
, thanks -
Marnee KG7SIO over 9 yearsFor me, cleanup was stuck even after I checked out a new working copy. It couldn't find a file. This procedure worked to got over that. Clean ran again without any problems.
-
Jeffrey Knight over 9 yearsDownloading sqlite.exe and running the delete was actually faster than checking out and merging -- great answer
-
Vitor Canova over 9 yearsDidn't work for me. I end up with "Working Copy XXX is locked" after that when trying clean up.
-
Jeffrey Knight over 9 yearsI've also gotten a "locked" after this but have gotten past it with a "svn cleanup"
-
Phil Cooper over 9 yearsI've often had success with traversing up parent directories and running clean up on them, but it's a bit time consuming and 'magic'. Never knew this would return a detailed error, +1.
-
RyanfaeScotland about 9 yearsFor me the SQL command appears to be case sensitive so doing everything in CAPS worked.
-
Franva about 9 yearsfor cleaning up from the child dir! It works for me!
-
Tony over 8 yearsWhen you run
svn cleanup
, make sure the console is elevated. I didn't do this initially and I got thered-write: Access is denied
error. -
Tony over 8 yearsHow do you access the console?
-
makoshichi about 8 yearsFantastic, I was trying to do a revert and was stuck on this error. This simple solution solved it. Thanks a bunch!
-
Richard Merchant about 8 yearsI ran this on Debian, install using apt-get install sqlite3, then you can run the above commands without the .exe
-
Adrian Hedley almost 8 yearsI deleted the queue as described above using SqliteManager for Firefox add-on and had to run svn Clean up before I could Commit. This solution works like a charm.
-
McCoy over 7 yearsI got the 'locked' message as well, but then I ran the 'Clean Up' command checking the box that says "breaks locks", and it worked
-
Richard Kiefer over 7 yearsThe cmd command solved the issue immediately, although the TortoiseSVN client was not able to perform it.
-
jpmottin over 7 yearsWorked for me. Just, the third step is not mandatory (restart Eclipse).
-
coretechie about 7 yearsThis helped me kill an unwanted JVM and progress.
-
Josh P about 7 yearsWorked for me too. Had to go back to my tortoise SVN installer and add the command line tools. Then made sure to run cmd.exe as administrator. svn cleanup ran without any messages. Then I could right click SVN Update again without errors!
-
froggythefrog almost 7 yearsTrue. Make sure your files are not in use or checked out as a different user such as Administrator on Windows.
-
aliopi almost 7 yearsIf you are reading this you are in trouble :) I never ran into such a mess with Git (so far). I ended up cleaning / reverting / cleaning etc. on any directory I could, if Svn would let me.
-
Gunnar over 6 yearsI'm using netbeans with svn and tortoise svn (in win10), both failed, but command line didn*t fail - thanks :-)
-
Dave over 6 yearsFantastic! I used the following tool in VS 2017 (marketplace.visualstudio.com/…), connected to the .db and using same method as describe in your article and got it cleared up...good job!
-
Jacob about 6 yearsI had to subsequently cleanup with 'break lock' and then also resolve, but that was it and I could update again. Excellent solution.
-
Brian Carlton about 6 yearsBreak locks does not do what I thought. It only breaks local locks that it uses on your system. Not locks that someone else has set.
-
AhammadaliPK over 5 yearsThis has worked for me too , i tried so many things but didn't worked . I did closed my visual studio and did run clean-up . thanks much
-
Jhollman over 5 yearsI did run the Cleanup from Windows FileExplorer (with Turtoise) and it gave me a more elaborated error wich told me what was the file with the problem, somehow SVN lost that file, a darm *.cache file, so i took another .cache and rename it to replace the missing file, run the cleanup, no errors this thime, ALL FIXED!!
-
s.c almost 5 yearssqlite3 sometimes solved my problem , but that method was too difficult to remember and clean up failed so often. This method saved me..
-
prem over 4 yearsWorked for me too and that too without even running cmd with Admin privileges. This is the best answer.
-
Anshul Gupta over 3 yearsThanks a lot, it worked for me! Checking "Break Locks" is the trick.
-
likeGreen about 3 yearsJust Right click on folder > Team > Refresh/Cleanup was all needed for me
-
Larry over 2 yearsjust shift + right click on the folder and open in PowerShell. So much easier than navigating a cmd or ps from c:/windows etc/