[Owncloud] WebDav - Cannot create files. Locking fails

Alexander Skwar alexanders.mailinglists+nospam at gmail.com
Mon Dec 26 12:37:39 UTC 2011


A few days ago, I already posted, that I'm not really successful in
using a WebDAV mount and copying files to the server over this WebDAV
mount. Files created always are 0 byte.

I now did a bit of debugging and found, that it always fails in
3rdparty/Sabre/DAV/Locks/Plugin.php, where it does a

throw new Sabre_DAV_Exception_PreconditionFailed('The tokens provided
in the if header did not match','If');

in line 586 (or there abouts…).

Right before the "throw", I added this debug code:

$M = 'The tokens provided in the if header did not match';
$M .= '. $conditions = ' . ob_get_clean();
$M = date("r") . ": " . $M . "\n"; $L = fopen("/tmp/L", "a");
fwrite($L, $M, strlen($M)); fclose($L); unset($L, $M);

in /tmp/L, there's:

Mon, 26 Dec 2011 13:14:50 +0100: The tokens provided in the if header
did not match. $conditions = array(1) {
  array(2) {
    string(0) ""
    array(1) {
      array(3) {
        string(52) "opaquelocktoken:3581c263-c4b5-479e-9fc6-e459a40d47cd"
        string(0) ""

If I do the webdav mount on Linux and set "use_locks 0" in the
davfs2 configuration, files get created just fine.

But on OS X, I cannot set "use_locks 0" (or can I?).

Anyway, even if I could disable the use of locks everywhere, I doubt
that this would be the right way to go. It should work with locks
enabled, shouldn't it? After all, using locks is the default.

Doing a bit of MORE debugging, I found out, that

  $locks = $this->getLocks($url, $checkChildLocks);

returns an empty array. This "smells" to be correct, since there
really isn't anything, which would hold a lock - for testing,
I'm doing a "cp $src $mountpoint/File.$RANDOM", which should give
me a new file every invocation (yes, I know, not guaranteed…).

Should it be like this?


↯    Lifestream (Twitter, Blog, …) ↣ http://alexs77.soup.io/     ↯
↯ Chat (Jabber/Google Talk) ↣ a.skwar at gmail.com , AIM: alexws77  ↯

More information about the Owncloud mailing list