You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Антон Бреусов <an...@gmail.com> on 2014/01/09 23:06:21 UTC

Checksum mismatch when checking out from Apache server using dav_svn module with 1.8.5 version.

Hi.

There was a related topic a few month ago : "Regression in 1.8.x - checksum
mismatch when using svn via http/apache" (
http://mail-archives.apache.org/mod_mbox/subversion-dev/201309.mbox/%3Cb28c281f.1ceb834.366d63.250c@analytik-jena.de%3E).
But it was quickly abandoned without final solution. It seems that
same
problem happens in my configuration but now I have a reproduceable test
case. Okay, let's start:

1. An issue:
- When checking out (or updating) a repository with a lot of small html and
PHP files (it's a Drupal software tree with a lot of vendor branches used
for keeping site configuration up to date) a Checksum mismatch message
appears for one of files:

A    vendor\drupal\current\modules\php\php.info
A    vendor\drupal\current\modules\php\php.install
A    vendor\drupal\current\modules\translation\translation.module
A    vendor\drupal\current\modules\translation\translation.test
svn: E200014: Checksum mismatch for
'D:\TEMP\_SVN\test1_1\vendor\drupal\current\modules\update\tests\aaa_update_test.tar.gz':
   expected:  02ede29e316cddf45ee6535ff02eae1d
     actual:  c349cea43c4af6f1192c8eb62a5b27ab

- It always appears for same file;
- It fails when http:// protocol used but succeedes when local (file:/// )
repo access method used (both on windows or FreeBSD). svn:// protocol is
not tested yet.
- Checkout FAILS for following clients: SVN 1.8.5 on FreeBSD AMD64 from
ports, TortoiseSVN 1.8.4, SlikSVN 1.8.5 (x64 and win32) for Windows,
CollabSVN 1.8.5 x64.
- Checkout succeedes when 1.7.x SVN client used with same server setup
(currently only SlikSVN 1.7.13-x64 tested).
- Messages (including checksum numbers) are same for all affected
configurations....
- Repository is checked using svnadmin and no issues found.
- Issue also happens with a fresh repository created with files that cause
this issue.

2. Server configuration:
- FreeBSD 9.2 Release AMD64, Generic kernel.
- Apache 2.2.26
- SVN 1.8.5
- Runs on VMWare vSphere 5.1 (one setup) and VMWare Workstation 10.0.01
(second test setup).
- Everything is built from latest ports with default port settings almost
everywhere (except compiling apache mod for svn).
- Default FreeBSD 9.2 compiler used (GCC 4.2.1 20070831 patched), no custom
compiler environment options in make.conf .
- No mod_deflate or other compression modules used.
- SVNCompressionLevel is set to 0 in Apache config. Issue happens with or
without this option.

3. I failed to make a reproduceable configuration after moving affected
repository to Apache 2.2 server on Windows. Maybe because I run Apache in
32 bit configuration. I wasn't able to setup 64-bit configuration, because
cannot find prebuilt SVN with 64 bit Apache modules. But I successfully
reproduced it on a freshly built VM with another FreeBSD 9.2 AMD64 and then
narrowed it down to a tiny reproduceable repository with only 1 file and 1
commit.

Here's archived repository wtih this issue :
https://www.dropbox.com/s/r84xksm93ksvipu/repo.tgz
And this is the file from Drupal distribution that screws it when committed
to repository:
https://www.dropbox.com/s/lz34u4r9n8tom2k/aaa_update_test.tar.gz
If this doesn't help I can provide developers with a whole FreeBSD VM dump
to play, though it will be a lot bigger: a few gigs.

4. It's hard to find who's to blame - can be anything from compiler/linker
issues to some OS quirks. But there's some thoughts:
- It seems to be an 1.8.x problem, at least from client side because 1.7.x
clients works and 1.8.x clients fails;
- Probably server-side and related to 64-bit builds on server;
- Probably an issue in DAV module or Apache bindings because local file://
checkouts works.
- Related to Zlib issues? Maybe something is wrong with Zlib of FreeBSD?
It's better to test with server configuration on another OSes.

Re: Checksum mismatch when checking out from Apache server using dav_svn module with 1.8.5 version.

Posted by Ben Reser <be...@reser.org>.
On 1/10/14, 12:30 AM, Антон Бреусов wrote:
> It will be very good to add a note to the documentation about this issue here:
> https://subversion.apache.org/docs/release-notes/1.8.html#mod_dav_svn-fsmap

Added a warning section covering this.

> And probably here too:
> http://svnbook.red-bean.com/en/1.7/svn.ref.mod_dav_svn.conf.html

I think that's somewhat out of scope for that part of the book since it's just
supposed to be a reference to the configuration settings and this has nothing
to do with any specific setting.


Re: Checksum mismatch when checking out from Apache server using dav_svn module with 1.8.5 version.

Posted by Антон Бреусов <an...@gmail.com>.
Indeed, this was an issue, after removing AddEncoding directives it works
now! Thank you. They were in my config on global level (<IfModule> context
) for a long time since Apache 1.3.x maybe.

It will be very good to add a note to the documentation about this issue
here:
https://subversion.apache.org/docs/release-notes/1.8.html#mod_dav_svn-fsmap
And probably here too:
http://svnbook.red-bean.com/en/1.7/svn.ref.mod_dav_svn.conf.html

It maybe a better way is not to remove them on global level and stick to
each Directory except SVN's one but use RemoveEncoding on SVN location like
this:

<Location /svn>>
...
 RemoveEncoding .gz
RemoveEncoding .Z
</Location>



2014/1/10 Ben Reser <be...@reser.org>

> On 1/9/14, 4:26 PM, Ben Reser wrote:
> > What's happening is your httpd server is configured to add the gzip
> encoding to
> > the headers of files being served that have filenames that end in .gz.
> >
> > Typically you'll see that setup on the server with something like this:
> >   AddEncoding x-gzip .gz
> >   AddEncoding x-compress .Z
> >
> > AddEncoding is part of mod_mime and is documented here:
> > https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding
> >
> > Those sorts of configurations should never apply to the Location being
> used to
> > serve Subversion.
>
> Realized after sending I may not have been as clear as I should have been.
>
> AddEncoding inserts a Content-Encoding header that specifies that the file
> is
> gziped without changing the content of the body.  The Subversion client
> decompresses the file but then realizes that it doesn't match the checksum
> it
> expected and issues an error.
>
> The purpose of the configuration option is to store pre-compressed files on
> disk that are served to clients that can support gzip Content-Encoding
> without
> needing to do the compression in real time while the client decompresses
> the
> content on its end and uses it seamlessly.
>

Re: Checksum mismatch when checking out from Apache server using dav_svn module with 1.8.5 version.

Posted by Ben Reser <be...@reser.org>.
On 1/9/14, 4:26 PM, Ben Reser wrote:
> What's happening is your httpd server is configured to add the gzip encoding to
> the headers of files being served that have filenames that end in .gz.
> 
> Typically you'll see that setup on the server with something like this:
>   AddEncoding x-gzip .gz
>   AddEncoding x-compress .Z
> 
> AddEncoding is part of mod_mime and is documented here:
> https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding
> 
> Those sorts of configurations should never apply to the Location being used to
> serve Subversion.

Realized after sending I may not have been as clear as I should have been.

AddEncoding inserts a Content-Encoding header that specifies that the file is
gziped without changing the content of the body.  The Subversion client
decompresses the file but then realizes that it doesn't match the checksum it
expected and issues an error.

The purpose of the configuration option is to store pre-compressed files on
disk that are served to clients that can support gzip Content-Encoding without
needing to do the compression in real time while the client decompresses the
content on its end and uses it seamlessly.

Re: Checksum mismatch when checking out from Apache server using dav_svn module with 1.8.5 version.

Posted by Ben Reser <be...@reser.org>.
On 1/9/14, 2:06 PM, Антон Бреусов wrote:
> 1. An issue:
> - When checking out (or updating) a repository with a lot of small html and PHP
> files (it's a Drupal software tree with a lot of vendor branches used for
> keeping site configuration up to date) a Checksum mismatch message appears for
> one of files:
> 
> A    vendor\drupal\current\modules\php\php.info <http://php.info>
> A    vendor\drupal\current\modules\php\php.install
> A    vendor\drupal\current\modules\translation\translation.module
> A    vendor\drupal\current\modules\translation\translation.test
> svn: E200014: Checksum mismatch for
> 'D:\TEMP\_SVN\test1_1\vendor\drupal\current\modules\update\tests\aaa_update_test.tar.gz':
>    expected:  02ede29e316cddf45ee6535ff02eae1d
>      actual:  c349cea43c4af6f1192c8eb62a5b27ab

The problem is a misconfigured http server, with a mis-configuration that
wouldn't turn up until 1.8.5 when we adjusted the filename entry on the request
record in httpd actually not be garbage or empty.  This change is described in
this release note:
https://subversion.apache.org/docs/release-notes/1.8.html#mod_dav_svn-fsmap

I downloaded your file.

$ md5 aaa_update_test.tar.gz
MD5 (aaa_update_test.tar.gz) = 02ede29e316cddf45ee6535ff02eae1d

You'll note that's the expected checksum as mentioned in the error above.

$ gzip -dc aaa_update_test.tar.gz | md5
c349cea43c4af6f1192c8eb62a5b27ab

You'll note that's the checksum in the actual result received.

What's happening is your httpd server is configured to add the gzip encoding to
the headers of files being served that have filenames that end in .gz.

Typically you'll see that setup on the server with something like this:
  AddEncoding x-gzip .gz
  AddEncoding x-compress .Z

AddEncoding is part of mod_mime and is documented here:
https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding

Those sorts of configurations should never apply to the Location being used to
serve Subversion.