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

269,459

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.

Share:
269,459

Related videos on Youtube

rockstardev
Author by

rockstardev

Updated on July 27, 2022

Comments

  • rockstardev
    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
      rockstardev about 12 years
      (other than deleting all the SVN info, and re-checking out)
    • phuclv
      phuclv over 10 years
      that 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
    Brandon S over 10 years
    The 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
    DDS over 10 years
    Running the console command will probably give enough info to actually solve the problem. This is a much better answer.
  • Gangnus
    Gangnus about 10 years
    That could produce the problem mentioned in the question. But I am afraid, it can't liquidate it if it already happened.
  • Iman Mahmoudinasab
    Iman Mahmoudinasab about 10 years
    This fall me in another error. Finally I install tortoisesvn and run cleanup to solve my problem.
  • Sigurd V
    Sigurd V almost 10 years
    You 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
    deadfish almost 10 years
    well i selected the most top folder and used svn cleanup, thanks
  • Marnee KG7SIO
    Marnee KG7SIO over 9 years
    For 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
    Jeffrey Knight over 9 years
    Downloading sqlite.exe and running the delete was actually faster than checking out and merging -- great answer
  • Vitor Canova
    Vitor Canova over 9 years
    Didn't work for me. I end up with "Working Copy XXX is locked" after that when trying clean up.
  • Jeffrey Knight
    Jeffrey Knight over 9 years
    I've also gotten a "locked" after this but have gotten past it with a "svn cleanup"
  • Phil Cooper
    Phil Cooper over 9 years
    I'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
    RyanfaeScotland about 9 years
    For me the SQL command appears to be case sensitive so doing everything in CAPS worked.
  • Franva
    Franva about 9 years
    for cleaning up from the child dir! It works for me!
  • Tony
    Tony over 8 years
    When you run svn cleanup, make sure the console is elevated. I didn't do this initially and I got the red-write: Access is denied error.
  • Tony
    Tony over 8 years
    How do you access the console?
  • makoshichi
    makoshichi about 8 years
    Fantastic, I was trying to do a revert and was stuck on this error. This simple solution solved it. Thanks a bunch!
  • Richard Merchant
    Richard Merchant about 8 years
    I ran this on Debian, install using apt-get install sqlite3, then you can run the above commands without the .exe
  • Adrian Hedley
    Adrian Hedley almost 8 years
    I 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
    McCoy over 7 years
    I 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
    Richard Kiefer over 7 years
    The cmd command solved the issue immediately, although the TortoiseSVN client was not able to perform it.
  • jpmottin
    jpmottin over 7 years
    Worked for me. Just, the third step is not mandatory (restart Eclipse).
  • coretechie
    coretechie about 7 years
    This helped me kill an unwanted JVM and progress.
  • Josh P
    Josh P about 7 years
    Worked 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
    froggythefrog almost 7 years
    True. Make sure your files are not in use or checked out as a different user such as Administrator on Windows.
  • aliopi
    aliopi almost 7 years
    If 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
    Gunnar over 6 years
    I'm using netbeans with svn and tortoise svn (in win10), both failed, but command line didn*t fail - thanks :-)
  • Dave
    Dave over 6 years
    Fantastic! 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
    Jacob about 6 years
    I had to subsequently cleanup with 'break lock' and then also resolve, but that was it and I could update again. Excellent solution.
  • Brian Carlton
    Brian Carlton about 6 years
    Break 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
    AhammadaliPK over 5 years
    This 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
    Jhollman over 5 years
    I 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
    s.c almost 5 years
    sqlite3 sometimes solved my problem , but that method was too difficult to remember and clean up failed so often. This method saved me..
  • prem
    prem over 4 years
    Worked for me too and that too without even running cmd with Admin privileges. This is the best answer.
  • Anshul Gupta
    Anshul Gupta over 3 years
    Thanks a lot, it worked for me! Checking "Break Locks" is the trick.
  • likeGreen
    likeGreen about 3 years
    Just Right click on folder > Team > Refresh/Cleanup was all needed for me
  • Larry
    Larry over 2 years
    just shift + right click on the folder and open in PowerShell. So much easier than navigating a cmd or ps from c:/windows etc/