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


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

Submitted by:  None
Submitted on:  Mon 06 Jul 2009 12:52:03 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  Werner Baumann <wbaumann>
Originator Email:  -email is unavailable- Open/Closed:  Closed
Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( 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.


Werner Baumann <wbaumann>
Project AdministratorIn charge of this item.
Wed 08 Jul 2009 08:22:26 PM UTC, comment #5:


Just FYI, cPanel is using a perl webDAV Server implementation [url=[/url]]

I got a [url=] on the cPanel forum[/url] with some information. They know they aren't supporting locks (or eTags).

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


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.

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:

Host: xxxx
User-Agent: davfs2/1.4.1 neon/0.28.2
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
Content-Type: httpd/unix-directory
DAV: 1,2,<>
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:'>

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.

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

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.


Werner Baumann <wbaumann>
Project AdministratorIn charge of this item.
Tue 07 Jul 2009 04:51:49 PM UTC, comment #2:


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:

2) Server information:

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

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.

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.

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 Baumann <wbaumann>
Project AdministratorIn charge of this item.
Mon 06 Jul 2009 12:52:03 PM UTC, original submission:

I'm having the same issue shown at

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?



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

Attach Files:

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 wbaumann (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

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

    Back to the top

    Powered by Savane 3.3