You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Russell E Glaue <rg...@cait.org> on 2007/12/15 00:03:01 UTC

[users@httpd] Apache 2.2 DAV/2 problem

I have a problem.
Apache 2.2 DAV/2 changed the way it handles file properties, and now mod_dav
does not work with NFS mounted partition anymore.

When files are uploaded via WebDAV, and the properties are modified, a ".DAV"
directory with associated property file(s) are created.

Apache 2.0.* used:

/uploaddir/
/uploaddir/test1.txt
/uploaddir/.DAV/test1.txt

Apache 2.2.* uses:

/uploaddir/
/uploaddir/test1.txt
/uploaddir/.DAV/test1.txt.dir
/uploaddir/.DAV/test1.txt.pag


The prior for Apache 2.0 I am guessing is a sdbm file for storing file properties.
The later for Apache 2.2 I am guessing is gdbm files for storing file properties


The later gdbm based files is a problem for WebDAV shares for data on NFS
partitions.



We have our data NFS mounted from various systems to one local system which
provides a centralized WebDAV service.
We are in the progress of upgrading to Apache 2.2.
Upon testing we see these .DAV/.dir|.pag files attempting to be created, and
Apache hangs for WebDAV clients requesting a PROPFIND for these directories
containing these property file types.

If we remove these .dir|.pag files and restart Apache all is well again until
someone uploads/modifies a file which touches the DAV properties which Apache
attempts to store in these gdbm based files.


The Apache Lock DB is gdbm based, and the documentation says it has to be on a
local disk, which ours is.
So I set up another WebDAV share that points to a local hard disk partition, for
testing.
And this works successfully. I.E. Apache 2.2 does not hang when answering a
PROPFIND request for a directory containing a .DAV/.dir|.pag properties files.


Additionally, we have apr-util compiled with disabled support for gdbm, and
using sdbm. But apparently mod_dav just uses something specifically configured.
And I do not see an easy way to turn this off for compiling mod_dav to not use gdbm.


Can anyone tell me how to fix this problem.
Something changed between Apache 2.0 and 2.2 to create this new predicament.
Can this be labeled as a bug in Apache 2.2?

I hope no one tells me that I just cannot share out NFS data partitions through
mod_dav. Especially since it has always been supported up until Apache 2.2 .


Here are steps to reproduce this problem:

install Fedora Core 7
install apr (latest version)
install apr-util (latest version)
install httpd (latest version)

create the directories:
/data/
/data/local-test
/data/nfs-test

NFS mount a remote NFS parition to /data/nfs-test
mount nfsserver.domain.com:/nfsexports/data/ /data/nfs-test

now configure /data/ to be served as a WebDAV share under Apache 2.2 with mod_dav
-- apache config --
    LoadModule dav_module modules/mod_dav.so
    LoadModule dav_fs_module modules/mod_dav_fs.so
    DAVLockDB /var/lib/dav/lockdb
    <Location /data>
        DAV On
    </Location>
-- apache config --

Now use a WebDAV client that will update file properties, which results in a
.DAV directory being created with associated .dir and .pag gdbm files to store
the properties.
You can use the DAV client WebDrive which will expose this error in this way.
http://www.webdrive.com/
You can download a free 30 day trial to test this issue

Now connect to your webdav share
http://yourserver/data/

Now upload a test file to the server, say a file named "test1.txt" and
"test2.txt", to both local-test and nfs-test subdirectories:
/data/local-test/test1.txt
/data/nfs-test/test2.txt

Now you can attempt to refresh WebDrive's view of nfs-test and will see it has hung.
You can now use any other WebDAV client to also experience this issue.
This is because they must all issue a PROPFIND on the test2.txt file, which will
query the .DAV/test2.txt.dir and .DAV/text2.txt.pag gdbm files.
And this is what hangs Apache 2.2, as it will never get a lock on the gdbm
files, and never finish querying the properties gdbm files, and never return a
response to the WebDAV client.

If you wait long enough, your WebDAV client will eventually time out.

You can restart Apache to get it to become unhung.
But if you issue another PROPFIND on that nfs-test directory containing
test2.txt, it will hang again.

performing a PROPFIND on the local-test will work because the propery files .dir
and .pag files are not on a NFS mounted partition and thus Apache has no
problems getting a lock on the properties files.

You can resolve the immediate issue by stopping apache, deleting the .DAV
directory and contents, and then starting Apache.

We know the problem is with these files, and that Apache is having troubles with
them because if you issue a PROPFIND on the nfs-test directory with the
.DAV/{.dir|.pag} existing, it will hang, and then when you go to stop Apache you
will notice it takes a long time trying to clean up that process, which it can;t
do and simply aborts in creating the properties files which is the cause of the
problems.


Here is a visual look at the problem:

NFS mounted WebDAV share, hangs after uploading a file test1.txt

-bash-3.1$ ls -al /data/nfs-test/
total 16
drwxr-xr-x 3 datatree datatree 4096 Dec 14 09:07 .
drwxr-xr-x 5 datatree datatree 4096 Dec 14 09:02 ..
drwxr-xr-x 2 datatree datatree 4096 Dec 14 09:50 .DAV
-rw-r--r-- 1 datatree datatree    6 Dec 14 09:50 test1.txt
-bash-3.1$ ls -al /data/nfs-test/.DAV
total 8
drwxr-xr-x 2 datatree datatree 4096 Dec 14 09:50 .
drwxr-xr-x 3 datatree datatree 4096 Dec 14 09:07 ..
-rw-r--r-- 1 datatree datatree    0 Dec 14 09:50 test1.txt.dir
-rw-r--r-- 1 datatree datatree    0 Dec 14 09:50 test1.txt.pag


Local Disk mounted WebDAV share, after uploading a file test1.txt, and test2.txt
(Ah, I can upload a second file this time! -- compare these file sizes from the
pervious)

-bash-3.1$ ls -al /data/local-test/
total 36
drwxr-xr-x  3 datatree datatree 4096 Dec 14 08:57 .
drwxr-xr-x 12 root     root     4096 Dec 14 08:53 ..
drwxr-xr-x  2 datatree datatree 4096 Dec 14 08:57 .DAV
-rw-r--r--  1 datatree datatree    6 Dec 14 08:57 test1.txt
-rw-r--r--  1 datatree datatree    6 Dec 14 08:56 test2.txt
-bash-3.1$ ls -al /data/local-test/.DAV
total 40
drwxr-xr-x 2 datatree datatree 4096 Dec 14 08:57 .
drwxr-xr-x 3 datatree datatree 4096 Dec 14 08:57 ..
-rw-r--r-- 1 datatree datatree    0 Dec 14 08:57 test1.txt.dir
-rw-r--r-- 1 datatree datatree 1024 Dec 14 08:57 test1.txt.pag
-rw-r--r-- 1 datatree datatree    0 Dec 14 08:56 test2.txt.dir
-rw-r--r-- 1 datatree datatree 1024 Dec 14 08:56 test2.txt.pag


-RG

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org