Updating from svn repository returns "Could not read chunk size" error

SvnTortoisesvnConnection

Svn Problem Overview


When updating from subversion repository using tortoise svn client I get error looking like that:

Could not read chunk size: An existing connection was forcibly closed by the remote host.

It doesn't prevent me from updating, just interrupts update process, so that I have to repeat update several times, before it is complete.

What can cause such behaviour and how to fix it?

Svn Solutions


Solution 1 - Svn

I was getting the "Could not read chunk size" message from clients on several machines.

The key to figuring it out was this error in the Apache error log:

[Fri May 07 14:26:26 2010] [error] [client 155.35.175.50] Provider encountered an error while streaming a REPORT response.  [500, #0]
[Fri May 07 14:26:26 2010] [error] [client 155.35.175.50] Problem replaying revision  [500, #24]
[Fri May 07 14:26:26 2010] [error] [client 155.35.175.50] Can't open file '/usr/site/svnrep/impc/db/revs/16122': Too many open files  [500, #24]

The Apache process handling the svn operation was running out of file descriptors. On my Ubuntu server, I fixed it by editing /etc/security/limits.conf and adding this at the bottom:

*               hard    nofile          5000
*               soft    nofile          5000

Which increases the file descriptor limit from 1024 to 5000. Then I logged in on a fresh shell and confirmed that the limit got increased via ulimit -n. Then restarted Apache.

Solution 2 - Svn

I just got the 'could not read chunk size' error AND FOUND A SOLUTION -- at least for one scenario.

First, my configuration...

SERVER: CollabNet Subversion Edge Server 2.0.0-2190.74 (Subversion binaries 1.6.17-2190.74) running on Windows Server 2003 32-bit.

CLIENT: TortoiseSVN 1.6.16, Build 21511 - 32-Bit (Subversion 1.6.17) running on Windows XP Pro 32-bit with SP3.

Steps to reproduce...

I got this error after right-click-dragging a versioned subfolder into another versioned subfolder within my local working copy folder and then choosing 'SVN Copy versioned item(s) here' (this is a TortoiseSVN context menu command in Windows Explorer when right-dragging folders). The subfolder contained one ANSI-encoded text file, MANIFEST.MF, which I believe I did not modify (my Subversion configuration does not include a mime type for .MF files). I subsequently committed the newly copied subfolder. Later, anytime I tried to update my Subversion local working copy folders on this PC, I got the chunk size error.

Work-around...

I resolved this by restarting my Subversion/Apache service (which in and of itself did not help and may not have been necessary), then deleting the newly added subfolder from my local working copy folder (it had already made it to the repo, so I wasn't going to lose anything), and THEN performing an Update, which succeeded without the chunk size error and re-fetched the subfolder I just deleted.

In my case, I had copied TWO versioned subfolders this way, and I could not successfully update the root of my local working copy folder until I had deleted BOTH of these new subfolders.

Follow-up...

I assume this is a bug in Subversion server and/or TortoiseSVN client, but I do not have the debugging skills to make that determination. I'll report my findings in the TortoiseSVN Issue Tracker and see where that goes.

Solution 3 - Svn

I just had this happen to me, and it was not a server issue; my working copy got corrupted (by me, incidentally).

Solution 4 - Svn

The problem and (some other) disappeared after turning off client-side antivirus.

I'm using Ubuntu server with subversion 1.7.4 via Apache.

Solution 5 - Svn

Check the apache error log, there should be an error logged in there with an error number. That number will help finding out why the connection was dropped.

If there's nothing in the error log, check your virus scanner/firewall settings: some of those tools will drop a connection if they think the transferred data is dangerous.

Solution 6 - Svn

For us the problem was an a timeout on Apache. The update was taking about 15 minutes, but Apache timed out after 10 minutes, causing our SVN server to give the error you see. The final solution was to increase the timeout setting for Apache. We use VisualSVN server - for detailed instructions on how to change this setting, look here: http://adventuresindotnet.blogspot.com/2010/09/svn-trouble.html

Solution 7 - Svn

I changed to an Ubuntu server and we had this same error - across multiple client PC's, OS's, and client versions.

After making sure that both the file limit settings and Apache timeout settings were as suggested.

(See http://posidev.com/blog/2009/06/04/set-ulimit-parameters-on-ubuntu/ )

I eventually solved the problem by using the apache2-mpm-prefork package rather than the apache2-mpm-worker package.

Solution 8 - Svn

I was getting this same error message on updates after I renamed a folder and committed. I created a new working directory and didn't receive the error. So, I just moved my changes to the new working directory, committed and blew away the old directory.

So, this error seemed to be caused by my local directory getting corrupted.

Solution 9 - Svn

VisualSVN 2.5.8: Had the same error, next steps helped me to fix this error:

On the server:

  1. Deleted on the server problematic folder;
  2. Restart VisualSVN server.

On Workstation:

  1. Update parent folder ;
  2. Add folder and files again ;
  3. Add to SVN ;
  4. Commit.

Solution 10 - Svn

I get that also. Our server is Apache running on Windows. My client is connected with a high speed but somewhat high latency (200ms.) The other part of the puzzle is that I am running windows Vista. Turning autoscaling and rss seems to improve the situation, but does not fix it.

Solution 11 - Svn

There is another annoying cause for this error message. It could be your router or your router's firmware.

I had recently upgraded my Linksys WRT110's firmware from version 1.0.02 to 1.0.07 and after that, subversion could no longer add new files to the repository. It could only update existing files. Rolling back to 1.0.02 fixed the problem.

Sources:

Basically, anytime the connection is abruptly dropped, you're going to get this error. Could be a configuration error on Apache, like many of you stated. It could also be due to a slow server or overloaded connection, or it could be due to a cheap router, as was in my case.

Solution 12 - Svn

This clearly has many causes, but for me this was fixed by restarting my SVN server (VisualSVNServer 2.5.1). This occurs frequently when doing a full repo checkout on a newly loaded dump.

Solution 13 - Svn

For us, the workaround was to downgrade the SVN client from 1.8 to 1.7 (command line client that's bundled with TortoiseSVN).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDenisView Question on Stackoverflow
Solution 1 - SvnLachlanView Answer on Stackoverflow
Solution 2 - SvnMikeOnlineView Answer on Stackoverflow
Solution 3 - SvnhoffmancView Answer on Stackoverflow
Solution 4 - SvnvrogachView Answer on Stackoverflow
Solution 5 - SvnStefanView Answer on Stackoverflow
Solution 6 - SvnCodeThugView Answer on Stackoverflow
Solution 7 - SvnSimon HoffeView Answer on Stackoverflow
Solution 8 - Svnuser1097928View Answer on Stackoverflow
Solution 9 - SvnEugene BosikovView Answer on Stackoverflow
Solution 10 - SvnJeremy WhiteView Answer on Stackoverflow
Solution 11 - Svnmrbinky3000View Answer on Stackoverflow
Solution 12 - SvnDerrickView Answer on Stackoverflow
Solution 13 - SvnFrank SchmittView Answer on Stackoverflow