HomeHome ArchiveArchive

Nginx kills large SVN commits

Lately, when committing large files with Subversion I had problems like this:

\$ svn commit linux-2.6.24.2.tar.gz
Adding (bin) linux-2.6.24.2.tar.gz
Transmitting file data .svn: Commit failed (details follow):
svn: PUT of '/svn/!svn/wrk/38f59907-4ccf-4e05-acf4-444499e715cc/embipc/branches/ipc/linux-image/linux-2.6.24.2.tar.gz': Could not send request body: connection was closed by server. (<https://www.example.org>)
svn: Your commit message was left in a temporary file:
svn: '/some/path/embipc/branches/ipc/linux-image/svn-commit.tmp'

Apache’s Log was very quiet about the problem. All I could see that SVN would be deleting the uploaded file after abort (that’s what I think it was doing):

192.168.0.2 - joe [07/Mar/2008:13:53:59 +0100] "DELETE /svn/!svn/act/38f59907-4ccf-4e05-acf4-444
3b969 HTTP/1.0" 204 - "-" "SVN/1.4.4 (r25188) neon/0.26.4"

The root of the problem is however that we’re having multiple virtual servers on our hardware and are proxying and distributing request to them through nginx. And nginx had a default setting for maximal file upload sizes, which made it automatically abort all commits that exeeded that size:

2008/03/07 13:56:16 [error] 15916\#0: \*1463829 client intented to send too large body: 59042053 bytes
, client: 10.0.0.15, server: www.example.org, URL: "/svn/!svn/wrk/38f59907-4ccf-4e05-acf4-444

We had to change the respective setting in nginx.conf, and everything was fine after:

 \# ---- dev ---
 location /svn {

      # Set the max size for file uploads
      client_max_body_size 100M;

The real problem here is though, that the stack of technologies is not able to pass forward errors. It’s the svn client that should have told me “client intented to send too large body: 59042053 bytes” and not the nginx log.