maindavfs2 - Support: sr #106922, When my webDAV direcotry is...

 
 

sr #106922: When my webDAV direcotry is mounted with davfs, I can't write to files.

Submitter:  None
Submitted:  Mon 06 Jul 2009 12:52:03 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  _71007
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 09 Jul 2009 07:23:27 PM UTC, comment #6: 

Hello Eric,

I am happy to see a reply to your request at the cPanel Forum.

As I don't want to create an account at cPanel here are some hints which you might pass on.

Support for Locks is not required in WebDAV, but they should change the headers in this case:
- remove the number "2" from the header "DAV"
- remove "LOCK" and "UNLOCK" fro the header "Allow".
This way clients will know that locks are not supported. davfs2 will in this case not use locks, without the need for the user to explicitely configure it.

Etag is probably not required either. But having Etags and conditional requests based on Etags will significantly improve reliability and also reduce traffic. This is not important as long as only one client has access to the repository, but can save a lot of trouble in case of concurrent access.

Cheers
Werner

- <_71007>
Wed 08 Jul 2009 08:22:26 PM UTC, comment #5: 

Werner,

Just FYI, cPanel is using a perl webDAV Server implementation [url=http://search.cpan.org/~brong/Net-DAV-Server-1.29/Net::DAV::Server[/url]]

I got a [url=http://forums.cpanel.net/f7/webdisk-mounted-ubuntu-8-10-a-110265.html#post539625response] on the cPanel forum[/url] with some information. They know they aren't supporting locks (or eTags).


Anonymous
Tue 07 Jul 2009 08:36:40 PM UTC, comment #4: 

Werner,

Thank you, sir.

I added "use_locks 0" to my davfs2.conf file and it works now.  Thank you so much.

I'm reporting the bugs you mentioned to my hosting service and to the developers over at cPanel.

For most things, this is so much better than simple ssh access (which they turned off for security reasons yesterday). It's like I'm editing files in place now.

Anonymous
Tue 07 Jul 2009 07:28:08 PM UTC, comment #3: 

Hello Eric,

using the account data you supplied it did some short tests with your server. I found two serious bugs, but there is also a work around for this.

Bug 1:
The server claims to support WebDAV locks but does not. In response to a LOCK request it returns Error Code 200 OK but the response does not include the required Lock Token.

This is what I get with an OPTIONS request:

OPTIONS / HTTP/1.1
Host: xxxx
User-Agent: davfs2/1.4.1 neon/0.28.2
Keep-Alive:
Connection: TE, Keep-Alive
TE: trailers
Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
HTTP/1.1 200 OK^M
Date: Tue, 07 Jul 2009 18:21:24 GMT
Server: cPanel
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Allow: UNLOCK,HEAD,MOVE,OPTIONS,LOCK,POST,PUT,COPY,TRACE,MKCOL,GET,DELETE,PROPFIND
Content-Type: httpd/unix-directory
DAV: 1,2,<http://apache.org/dav/propset/fs/1>
Keep-Alive: timeout=15, max=96
MS-Author-Via: DAV

Header "DAV: 1,2" claims compliance class 2 which includes support for locks. This is also announced in the Allow Header.

But a LOCK request looks like this:

LOCK /test.txt HTTP/1.1
Host: xxxx
User-Agent: davfs2/1.4.1 neon/0.28.2
Connection: TE
TE: trailers
Content-Length: 184
Content-Type: application/xml
Depth: 0
Timeout: Second-1800
Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
<?xml version="1.0" encoding="utf-8"?>
<lockinfo xmlns='DAV:'>
  <lockscope><exclusive/></lockscope>
  <locktype><write/></locktype>
  <owner>xxxxxxxxx</owner>
</lockinfo>

HTTP/1.1 200 OK
Date: Tue, 07 Jul 2009 18:21:39 GMT
Server: cPanel
Content-Length: 0
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100

The response code is 200 OK but the response misses a lock-token header and a body with additional lock information. This is badly broken.

Bug2:
When I do a PUT request for the already existing file test.txt, I get this:

PUT /test.txt HTTP/1.1
Host: xxxx
User-Agent: davfs2/1.4.1 neon/0.28.2
Connection: TE
TE: trailers
Content-Length: 48
Authorization: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This is a test file.
This is appended by Werner

HTTP/1.1 201 CREATED
Date: Tue, 07 Jul 2009 18:25:32 GMT
Server: cPanel
Content-Length: 16
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
Resource Created

The response code is 201 CREATED. This is only correct when a new resource is created. When an existing resource is replaced by a new version is must be 200 OK.

Serious shortcomming:
The server does not support Etag. I am not clear whether this is required by HTTP 1.1. But for WebDAV it is important to avoid unintended overwriting of someone elses changes to a resource.

Work around:
You can configure davfs2 to not use locks. You have to add option "use_locks 0" to your davfs2.conf file. I did a short test and it worked. File test.txt on the server should now be changed by me.

Though there is a work around, please report this bugs to the maintainer of the server. There is an increasing number of new WebDAV backends for Apache and other HTTP servers, most of which are seriously broken (or not seriously developed and tested). Writing a WebDAV module seems to have replaced the function of the famous "Hello World" program from when I was young.

Cheers
Werner

- <_71007>
Tue 07 Jul 2009 04:51:49 PM UTC, comment #2: 

Werner,

Thanks for your reply. And I apologize for not giving more details on my initial post here yesterday.

I mistakenly thought that my post on the cpanel forum would be visible by now.

Since that hasn't happened, let me give some additional details here.

First, I'm pretty sure that someone has made a stupid configuration error, and that I, in blissful ignorance, have tried to use things in a badly configured condition.

Now, I must learn enough to get things working.  I though you were the best one to learn from on this topic.

Here's some information to let you know where I'm at.

1) Versions - my workstation:




:~$ uname -srvmpio
Linux 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 22:12:12 UTC 2009 x86_64 unknown unknown GNU/Linux
:~$ mount.davfs --version
davfs2 1.3.3  <http://dav.sourceforge.net>




2) Server information:

I wish I had more for you, but here's what I have:



SERVER_SIGNATURE=Server signature: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at myserver.myhostingservice.com Port 80
SERVER_SOFTWARE=Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635




That information comes from a printenv SSI on a test page on the server.

3) Symptoms:

Here's how to recreate the problem. First, I show that cadaver works (to some extent) with the webDAV directory. Then I show the results when mounting the webDAV directory with davfs2.



:~$ grep dav /etc/fstab
https://myserver.myhostingservice.com:2078 /media/myserver davfs rw,noauto,user 0 0
:~$ cadaver https://myserver.myhostingservice.com:2078
Authentication required for cPanel WebDisk on server `myserver.myhostingservice.com':
Username: <username>
Password: <password>
Could not access / (not WebDAV-enabled?):
Did not find a collection resource.
Connection to `myserver.myhostingservice.com' closed.
dav:!> exit
:~$ cadaver -t https://myserver.myhostingservice.com:2078
Authentication required for cPanel WebDisk on server `myserver.myhostingservice.com':
Username: <username>
Password: <password>
Ignored error: / not WebDAV-enabled:
Did not find a collection resource.
dav:/? ls
Listing collection `/': succeeded.
Coll:   /                                   4096  Jul  7 12:12
        test.txt                              21  Jul  7 12:11
dav:/? cat test.txt
Displaying `/test.txt':
This is a test file.
dav:/? cp test.txt newtest.txt
Copying `/test.txt' to `/newtest.txt':  succeeded.
dav:/? cat newtest.txt
Displaying `/newtest.txt':
This is a test file.
dav:/? exit
Connection to `myserver.myhostingservice.com' closed.
:~$ mount https://myserver.myhostingservice.com:2078
Please enter the username to authenticate with server
https://myserver.myhostingservice.com:2078 or hit enter for none.
Username: <username>
Please enter the password to authenticate user <username>.de with server
https://myserver.myhostingservice.com:2078 or hit enter for none.
Password: <password>
:~$ cd /media/myserver/
:/media/myserver$ ls -l
total 2
drwx------ 2 eric eric 64 2009-07-07 12:19 lost+found
-rw-r--r-- 1 eric eric 21 2009-07-07 12:17 newtest.txt
-rw-r--r-- 1 eric eric 21 2009-07-07 12:11 test.txt
:/media/myserver$ cat test.txt
This is a test file.
:/media/myserver$ cp test.txt anothertest.txt
cp: cannot create regular file `anothertest.txt': Input/output error
:/media/myserver$ ls -l
total 2
drwx------ 2 eric eric 64 2009-07-07 12:19 lost+found
-rw-r--r-- 1 eric eric 21 2009-07-07 12:17 newtest.txt
-rw-r--r-- 1 eric eric 21 2009-07-07 12:11 test.txt
:/media/myserver$ rm newtest.txt
:/media/myserver$ ls -l
total 1
drwx------ 2 eric eric 64 2009-07-07 12:19 lost+found
-rw-r--r-- 1 eric eric 21 2009-07-07 12:11 test.txt
:/media/myserver$ cd
:~$ umount /media/myserver
/sbin/umount.davfs: waiting while mount.davfs (pid 8991) synchronizes the cache .. OK
:~$




I've actually set up a test webDAV directory that you can use, if you want to check things out. I'll send you the details for login in a private message.

I realize I have an older version of davfs2 installed. For some reason, this is the "latest" version in the ubuntu repositories. If needed, I can uninstall that version and build the latest version from the tarball.

Also, I note that I have to use "cadaver -t https://..." to connect to the server. Plain "cadaver https://..." gives an error and closes the connection. This confirms that you are probably right that there is a problem at the server.

If changes are needed in the server configuration, I don't control the server. The people who run my hosting service are pretty good with customer service if I contact them and say, "in configuration file _____, you have option ____ set to xxx. For me to work, I need it set to yyyy instead."  If changes need to be made, I can make requests (and they are likely to honor reasonable requests). My problem is I don't know what to ask for.

Anonymous
Mon 06 Jul 2009 07:31:08 PM UTC, comment #1: 

"Is this a configuration issue? Or a bug in davfs2?"
It looks like a server bug. But there is not much information to draw conclusions from (not even a version number). The link doesn't provide much af information either.

You might first look at NEWS and README. davfs2 also has some configuration options to work around server bugs. They are described in the davfs2.conf manual.

If you can't solve the problem this way: the davfs2 debug options allow you to record the communication between davfs2 and the server which is very usefull when there are communication problems between the client and the server.

Do you really think I'm distributing a WebDAV client with the known bug of not beeing able to create and edit files?

Please do not start your submissions with "I'm having the same issue". It is usually not the case. Allways start with an as precise as possible description of the problem.

Werner

- <_71007>
Mon 06 Jul 2009 12:52:03 PM UTC, original submission:  

I'm having the same issue shown at http://forums.cpanel.net/f7/webdisk-mounted-ubuntu-8-10-a-110265.html

I posted a full reply there, it's waiting on the moderators there to approve it. If it doesn't show up in a day or so, I'll re-create the full test log here.

Basically, when I use my webDAV directory with cadaver, it works perfectly. It's also working for my Mozilla-lightning calendar file.

When I mount it using davfs, I can delete existing files, but I can't create new files or write to files.

Is this a configuration issue?  Or a bug in davfs2?

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by _71007 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-07-19 _71007 Open/ClosedOpen Closed
    2009-10-18 _71007 StatusNone Done
    2009-07-09 _71007 Assigned toNone _71007

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code