What is the underlying cause of an SVN checksum mismatch?

14.1k views Asked by At

Almost every time I commit to SVN I keep getting a checksum mismatch error. I already know how to fix it (by checking out the folder and copying over the .svn folder after deleting the old one). What I want to know is what causes this as its starting to drive me insane.

OS: Windows 7 SVN Client: VisualSVN, TortoiseSVN

TortoiseSVN error message indicating corruption in checked-out copy

6

There are 6 answers

0
optimistAk On BEST ANSWER

Yes, this error is a bit annoying.. There are multiple reasons this can occur, say a broken network, power outage, or say file corruption. The workaround you figured out is the best way to get over this error afaik..

More details on the reasons and theory why this error occurs: (similar issue, where the md5 was being null; where as in your case its a different value than whats on the server)

Repair SVN Checksum

0
Nicki On

I had an error like this. The easiest solution I found, was deleting the folder that the fil was in and then updating in my svn client of choice.

This restores the checksums from the server.

Only problem is, of course, that any changes you've made before that last commit will be lost. If it's a simple source text file, you can copy the whole content to notepad (or whatever text editor), update the svn, then copy the source text into the file again and commit.

2
Corneil du Plessis On

This solution I can across a while ago is to open a command shell in the folder where the problem file is located and execute the following:

svn update --set-depth empty
svn update --set-depth infinity

I cannot remember where I found the solution, I would like to give credit where due but I can't remember, I found this in shell command history.

0
null On

This once happened to me in eclipse svn plugin, I committed some files and then I clicked cancel button when it's in progress. Then I got error same as yours. It seems the svn server had received the committed files and updated the checksums, but in my local svn, the files are still pointing to old checksums.

My solution is to delete/move the folder that contains problem files, then I checked out or updated again the folder.

1
Dee On

1.Rename corrupted file in your working directory

2.Commit (it will delete the corrupted file from repository, and add the renamed one)

3.Rename file back to original name in your working directory

4.Commit

Work like a charm for me, hope it helps.

0
iadd On
  1. First of all, you need to connect SQLite database (.svn\wc.db)
  2. Get checksum of file:

    SELECT CHECKSUM FROM NODES WHERE REPOS_PATH LIKE '%FILE_NAME%'
    
  3. You need to delete record in both table NODES and PRISTINE:

    DELETE FROM NODES WHERE CHECKSUM = 'CHECKSUM from 2.'
    DELETE FROM PRISTINE WHERE CHECKSUM = 'CHECKSUM from 2.'
    

It's worked for me.