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
- Start a
FileSystemForLocalwith aStatCacheand share a directory. - Send
PROPFINDwithDepth: 0for a file that does not exist. The response is 404. - Send
LOCKfor the same path. The response is 200 or 201 and the file now exists. - Send
PROPFINDwithDepth: 0for 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)
Source: tailscale/tailscale