SVN cleanup fails

When trying to update your local repository, if the names of some files to be created are not permitted on an operating system, svn complaints with a message something like:

X:\workspace>svn up
...    ...
A    some\directory\build\Project.build\Release\Project.build\Objects-normal\i386\MainWindow.o~>
svn: E720123: Can't move 'X:\workspace\.svn\tmp\svn-XXXXXXXX' to 'X:\workspace\some\directory\build\Project.build\Release\Project.build\Objects-normal\i386\MainWindow.o~>': The filename, directory name, or volume label syntax is incorrect.

Trying yet to update the repository gives you:

X:\workspace>svn up
svn: E155037: Previous operation has not finished; run 'cleanup' if it was interrupted

And trying to cleaning up:

X:\workspace>svn cleanup
svn: E720123: Can't move 'X:\workspace\.svn\tmp\svn-XXXXXXXX' to 'X:\workspace\some\directory\build\Project.build\Release\Project.build\Objects-normal\i386\MainWindow.o~>': The filename, directory name, or volume label syntax is incorrect.

Well, again:

X:\workspace>svn up
svn: E155037: Previous operation has not finished; run 'cleanup' if it was interrupted

And so on and so forth.

This happens, for instance, when you (sure, unintentionally) included an Xcode build directory to your svn repository and try to check it out on Windows, which will not allow some characters to be used in a file name–‘>’ in the example above. SVN doesn’t resolve this problem: the unaccomplished operation to check out a file with unallowed name is still at svn’s private “to-do” list, which should be done prior to any other operations through “svn cleanup”, which in essence flush all unfinished operations. This, however, makes an error as it tries to do something not achievable.

Since SVN 1.7, the repository is managed with a centralized SQLite data base instead of numerous, small chunks of files inside .svn directory within each subdirectory. The data base is located at .svn directory at your local copy’s top level directory, and named wc.db.

Open wc.db using sqlite3, a command line shell of SQLite, which can be downloaded from http://www.sqlite.org.

X:\workspace>sqlite3 .svn\wc.db

The “to-do” list is stored in a table called WORK_QUEUE:

sqlite> select * from WORK_QUEUE;

which might look like:

XXXX|(file-install 142 some/directory/build/Project.build/Release/Project.build/Objects-normal/i386/MainWindow.o~> 1 0 1 1)
XXXX|(file-install 142 some/directory/build/Project.build/Release/Project.build/Objects-normal/i386/MainWindow.o~? 1 0 1 1)
XXXX|(file-install 142 some/directory/build/Project.build/Release/Project.build/Objects-normal/i386/MainWindow.o~$ 1 0 1 1)
...

Remove all the entries related to the file name problem (here just I remove all):

sqlite> delete from WORK_QUEUE;
sqlite> .quit

“svn cleanup” should work now:

X:\workspace>svn cleanup

Before update, remove the files that caused this problem, or better the build directory containing the files, from the repository to avoid running into the same problem again:

X:\workspace>svn --force rm some\directory\build
X:\workspace>svn up

Reference: http://subversion.1072662.n5.nabble.com/quot-svn-cleanup-quot-fails-because-it-can-t-find-a-temp-file-td157577.html

Advertisements
SVN cleanup fails

29 thoughts on “SVN cleanup fails

  1. Thankyou! I had this same issue – I had already deleted from work queue and was still getting the E155037 error code. But calling svn rm on the directory that I suspected was the cause fixed it! Phew.

  2. Many thanks, dear sir. It helped a clueless folk, me. :)

    Another tip for people coming over here looking for answers is to use SQLLite add-on for firefox. It’s a GUI and much simpler to understand w.r.t Command Line.

    Also, in my case, after deleting the WORK_QUEUE entries, svn was complaining about ‘The node … was not found’. I resolved it by deleting the entries in NODE table(using the GUI).

  3. Hi,
    First of all thank you very much for such a informative post. I had the same issue and I just have fixed it using provided info.
    Thanks again
    Asit

  4. Rachit says:

    Hi,

    Anyone in the post please reply. I am unable to execute these commands.

    I have downloaded 32 sqlite and directly double clicked the exe file of sqlite and enetered these commands but it does not work.

    Do I need to go to particular folder where my working copy is there ?

    Please help its really very urgent

    Thanks

    1. Hi Rachit, I reckon you need to open the command line prompt (cmd.exe) first and run sqlite there in the prompt with the path to the wc.db file in your .svn folder as the argument. Also make sure that you use the recent version of svn (version >= 1.7). Hope this helps.

  5. Lars says:

    Thanks … I had the same problem, and this helped resolve it. Has the problem been reported to the developers of the svn client? Seems like whatever it does, it shouldn’t leave the db in a state that even cleanup won’t work on.

  6. Daniel says:

    After many links I found about this issue, this was the only one that really solved it (at least for me :)). Thanks a lot!

  7. Robert Bremel says:

    Thanks,

    My situation was just as was described by Daniel a few days ago. Makes me wonder whether one of the windows updates created some issues.

    Bob

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s