#21568·tailscale

drive/driveimpl/compositedav: PROPFIND returns a stale 404 after LOCK creates a file

Author: RaphaelFakhriCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbug

What is the issue?

A WebDAV LOCK on a path that does not exist creates an empty file (RFC 4918, section 7.3). Handler.handleLOCK in drive/driveimpl/compositedav/rewriting.go delegates the request to the child file server and returns without invalidating the StatCache. ServeHTTP invalidates the cache for PUT, POST, COPY, MKCOL, MOVE, PROPPATCH and DELETE, but LOCK returns earlier in the same function and is not in that list.

If a client sends PROPFIND for the missing file first, the 404 is cached. The client then sends LOCK, which creates the file, and the next PROPFIND still gets the cached 404 until the entry expires (10 seconds by default).

Steps to reproduce

  1. Start a FileSystemForLocal with a StatCache and share a directory.
  2. Send PROPFIND with Depth: 0 for a file that does not exist. The response is 404.
  3. Send LOCK for the same path. The response is 200 or 201 and the file now exists.
  4. Send PROPFIND with Depth: 0 for the same path.

Actual behavior

Step 4 returns 404.

Expected behavior

Step 4 returns 207 Multi-Status.

Are there any recent changes that introduced the issue?

No.

OS

All

Tailscale version

main (dca60dd77)