svn cleanup failed–previous operation has not finished; run cleanup if it was interrupted
Usually, an svn cleanup fixes most issues with tortoise svn. However, I ran into an issue which caused me some grief.
The specific error I was seeing:
Previous operation has not finished; run 'cleanup' if it was interrupted
Solution:
Somehow, svn is stuck on the previous operation. We need to remove this operation from it’s ‘work queue’.
The data is stored in the wc.db sqllite database in the offending folder.
1. Install sqllite (32 bit binary for windows) from here
2. sqlite .svn/wc.db “select * from work_queue”
The SELECT should show you your offending folder/file as part of the work queue. What you need to do is delete this item from the work queue.
3. sqlite .svn/wc.db “delete from work_queue”
That’s it. Now, you can run cleanup again – and it should work. Or you can proceed directly to the task you were doing before being prompted to run cleanup (adding a new file etc.)
Also, svn.exe (a command line tool) is part of the Tortoise installer – but is unchecked for some reason. Just run the installer again, choose ‘modify’ and select the ‘command line tools’.
Next Steps?
Need help with your cloud migration? Or securing your cloud assets? Try Google Cloud Architect ( also for AWS, Azure and DevOps Engagements)
Worked for me perfectly.
Thank you!
You, my friend, rock out loud. Thanks!
This did the trick. Thanks a lot
Last character on step 3 should be ‘”‘ not ‘*’, e.g. “delete from work queue” :). Very helpful, thanks!
thanks: The procedure I have typed:
C:\my_SVN_root_path\>sqlite3 .svn/wc.db
SQLite version 3.8.1 2013-10-17 12:57:35
Enter “.help” for instructions
Enter SQL statements terminated with a “;”
sqlite> select * from work_queue;
7066|(file-install my_faulty_file_name 1 0 1 1)
sqlite>delete from work_queue;
sqlite>exit
and don’t forget to perfrom a cleanup
Thanks Jaques. The command-line procedure helped a lot since I don’t use GUIs to do these things.
Thank you very much. without this i would have been lost.
I’m having the “Previous operation has not finished; run ‘cleanup’ if it was interrupted” problem and hope to use your sqlite method to solve it. But I’ve never used sqlite before, and am stuck. I installed sqlite3.exe (windows 32) in the directory containing the .svn file. I also made sure that ‘command line tools’ have been selected in my Tortoise installation. When I run sqlite3, and type in
sqlite .svn/wc.db “select * from work_queue”
I get: Error: near “sqlite”: syntax error.
When I just type in
.svn/wc.db “select * from work_queue”,
I get: Error: unknown command or invalid arguments: “svn/wc.db”. Enter .help for help. But doing so gives no advice regarding .svn
Any advice?
Try .svn\wc.db (backslash instead of forward slash). Also , ensure that you have a semicolon at the end of the statement.
I can’t think of what else it could be . Maybe try running the cmd prompt as administrator ?
Thanks, now it worked for me. backslash instead of forward slash indeed seems to have been important.
In case others newbies like myself find it useful, I typed the following in the windows command line:
D:\my_SVN_root_path\sqlite3 .svn\wc.db
This opened a sqlite3.exe windows, into which I typed:
select * from work_queue;
delete from work_queue;
Then I killed the sqlite3.exe window, ran cleanup, and celebrated as it ran without further problems.
thanks a lot
Could you tell me what I need to set in work queue?
You shouldn’t need to ‘set’ anything. Just delete as follows
sqlite .svn/wc.db “delete from work_queue”
Thanks for this advice !
it worked and helped a lot.
Hi,
Anyone in the post please reply. I am unable to execute these commands.
I have downloaded 32 bit sqlite and directly double clicked the exe file of sqlite and entered these commands but it does not work.
Do I need to go to particular folder where my working copy is there ?
Will I loose my content on hard drive if I perform the last step on this blog?
svn.exe (a command line tool) is part of the Tortoise installer – but is unchecked for some reason. Just run the installer again, choose ‘modify’ and select the ‘command line tools’.
Please help its really very urgent
Fantastic advice. Solved my problem in seconds! (svn was trying to delete a file that was apparently linked to a C:\temp file on Windows) Deleting the queue restored everything perfectly.
Thank you Anuj,
This worked perfectly and solved my problem,
Ravil
Thanks for the tip – fixed it right up.
Awesome!!! Did the trick.
Thanks…
Worked like charm! thanks!
This was a GREAT piece of secret information :).
I installed sqllite3 (64bit) and this worked!
Wish the Tortise SVN or svn would have a more verbose option to indicate what was going on.
In my case, a process had one or more files locked when I attempted to do an update. This corrupted the update and the subsequent clean-up’s.
There should be a “svn db_clear” option that does the same thing as sqllite “delete work_queue”
-R
Hi anuj I have downloaded sqlite-shell-win32 and on running it I get this command prompt.On entering any of the commands mentioned here on your blog it says “unknown command or invalid arguments”. How do i sort this out.. Please help me resolve this
There’s an easier way with TortoiseSVN. When doing a clean-up, click the checkbox that says “Break Locks”. This will do what you’re doing and get past the error.
Wow. I actually spent an hour trying to get SQLite to work and couldn’t get it and decided to read more comments. Your method worked for me. SQLite was unable to access my database for some reason. THANK YOU
Thank you so much. I had the same problem as Kody below. The SQLite fix didn’t work either
thanks a lot!.. worked for me!
This really helped.. never thought of looking at the SVN db via sqlite. However, for me, I found there was a cryptic record in the WC_LOCKS table. First column was 1, second col was empty, and third column was set to -1. I was not able to run any more svn commands until I removed this record from WC_LOCKS. The working copy now seems fine.
And be careful when you click the browse Data tab when you have any table selected. It starts browsing on the first table in the database, not the one you had selected (at least in this revision of DB Browser for SQLite.
Worked Perfectly for me – thank you so much!
Yes, cleanup is working now but… when I try to do SVN update it coming back with the same problem…
Anybody can suggest how to make it work?
Thanks a lot. I was breaking my head for this error. Your solution worked like a charm. Hats off to you!!!
Thank you. I have to use “jacques rochez” idea, after installing SQLITE3 learning from http://www.codeproject.com/Articles/850834/Installing-and-Using-SQLite-on-Windows
How about the same question in the Linux system
Hello,
please put the comment
“There’s an easier way with TortoiseSVN. When doing a clean-up, click the checkbox that says “Break Locks”. This will do what you’re doing and get past the error.”
above your solution.
Thanks!
Thanks!
Thank You
Thank you it’s work
Very helpful. Thank you for the tip.
Thanks a lot. Worked Perfectly for me too.
Thank you!
This fixed my problem.
Worked perfectly, thank you!!
As a note, it’s now sqlite3
Thanks for the update!
This trick worked perfectly buddy. Awesome Thank you!!
thanks, at last, it works for me also
Awesome Brother..!! You have done a great service to the community..!
I tried this and it didn’t work. The select from the work queue returns nothing.
The SVN update fails, says I need to run clean up. Which I do and get an error.
There error on cleanup is “work item 3446 (file-install 1 0 1 1) The system cannot find the path specified.
The is from me so I don’t have to go on and on listing the actual path. But nothing SVN will work until this gets cleaned up, unfortunately.
Thanks Anuj, It helps me a lot.
Thank you! You saved me.
THANK YOU! You saved me and my svn repository. I have been struggling with it for the past 2 hours!!!