tags:

views:

3761

answers:

13

I have a client who had to rebuild his automated build server. He checked out his project folder from my subversion server but is now no longer able to commit - he gets this error:

Error: Commit failed (details follow):  
Error: Cannot write to the prototype revision file of transaction
'551-1' because a   
Error: previous representation is currently being written by another
process  
Finished!:

I have searched Google but although this error has been often reported there is no clear explanation - does anyone on StackOverflow have a solution?

UPDATE: Nobody else commits to that repository, so it was not a transaction stuck (at least not from another user). In the end we found that permissions were not set correctly. Not that you would know it from this message, but that fixed the problem.

A: 

I haven't seen it, but going on the error message I'm guessing something has gotten stuck writing a file. I'd try restarting your svn server process / reboot server.

DamianM
+8  A: 

Your repository has a stuck transaction. You can use the svnadmin command to repair it. Like all the other svn utilities, svnadmin takes a command followed by options (usually just the repository directory). svnadmin has to be run on the server with the repository.

Do something like this:

svnadmin lstxns /path/to/repository

to get a list of transactions in process (you should see your offending 551-1 there). You can then decide how best to recover from this error... svnadmin also has a command rmtxns to delete the offending transaction. For more information, issue:

svnadmin help

or see the tigris website: http://subversion.tigris.org/. You can also get more detailed help on specific commands by following the help command with the name of the command you're interested in. For example:

svnadmin help lstxns

Obviously you will need shell access to the repository server and write permissions on the repository to use svnadmin. If you're repository format is Berkely DB you should suspend your svnserve daemon (if you use it) and any web_dav/web_svn access to ensure you don't corrupt the database while issuing svnadmin commands.

Jason Coco
+10  A: 

I had a similar problem except the message said "...previous representation is currently being written by THIS process".

svnadmin lstxns did not show any transactions.

Restarting Apache solved the problem for me.

The server didn't have any outstanding transactions and permissions were fine. Simply restarting Apache (I was committing over DAV) fixed it. Thanks!
Cal
A: 

"Cannot write to the prototype revision file of transaction" Restarting apache also fixed this problem for me. I'm posting so that something useful might actually make it to the top of google.

Good luck!

A: 

Ewan

I ran into the exact same issue with Visual SVN Server installed on Windows 2003, I had altered the default install to place the Repository folder onto a separate partition since the servers C drive is small. I had to change the permission to that folder (in this case D:\Repository), as a quick and dirty hack I simply added the "Everyone" user to this folder and selected "Modify" rights (not the most secure for sure but a dirty working hack none the less). This resolved the issue.

A: 

I account the same wrong message, and when I "Get lock" the commit, success~

A: 

I did a one vote up for @DamianM answer. In my case it seems that had been the problem. File Corruption which made it not possible to write on server. http://stackoverflow.com/questions/1910503/issue-with-svn-commit-for-certain-file-extension

But Instead of restarting your svn server process / reboot server I copied the dlls[files with problem] again to working folder and was able to commit.

TheMar
+1  A: 

Had same problem, restarting apache fixed the issue.

ultra
+1  A: 

You can clear this error w/out a reboot:

  1. Identify (or create) a directory in the root SVN repository that was not a part of the failed commit.

  2. Create a new file in the directory from step 1.

  3. Commit the new file (and directory if created in step 1). Because the file is new, it doesn't conflict w/the previous commit and can update the revision # on the server.

  4. Commit the original files/directories.

  5. Delete the new file (and directory if created in step 1).

  6. Commit the entire tree.

**Steps 5 & 6 aren't required, but I like to keep my repository tidy...

I get this error a lot b/c SVN frequently conks out in the middle of committing my large files, which in turn causes subsequent commits to try to write to the revision that was interrupted.

Captain Obvious
I did it and I can commit now. However svnadmin lstxns still shows those hanging transactions. Is it a problem?
Jirka-x1
A: 

@Captain Obvious -- but what if the root directory was part of the failed commit?

Answering it myself: I tried your trick, but it wouldn't do the "svn mkdir" -- gave the same error about the transaction in the original post. Just restarted httpd, and it worked.

JatDanJigh
A: 

Lots of people are unable to commit. Sometimes couples counseling helps.

mickeyf
A: 

Ran into this same issue after I cancelled a commit in progress. After doing the svnadm rmtxns with the transaction number to remove, I still got the message. I am using webdav with apache, so I restarted apache as suggested (/sbin/service httpd restart). Worked.

webasdf
+1  A: 

For me the problem was solved (as hinted in the update of the question) by changing the permissions of my local folder (not the repository). In Windows Vista you do that by right-clicking on the folder and in properties/security you change permissions.

The error message is not very good and it wasn't easy to find an answer so I hope my answer helps other people to solve this annoying but on the other hand simple to solve problem.

Omar Kohl