{"record":{"id":"bb679a6c47d0f122","repo":"benbjohnson/litestream","slug":"cannot-specify-url-path-for-webdav-replica","errorCode":null,"errorMessage":"cannot specify url & path for webdav replica","messagePattern":"cannot specify url & path for webdav replica","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/litestream/main.go","lineNumber":1862,"sourceCode":"\tclient.User = user\n\tclient.Password = password\n\tclient.Path = path\n\tclient.KeyPath = c.KeyPath\n\tclient.HostKey = c.HostKey\n\n\t// Set concurrent writes if specified, otherwise use default (true)\n\tif c.ConcurrentWrites != nil {\n\t\tclient.ConcurrentWrites = *c.ConcurrentWrites\n\t}\n\n\treturn client, nil\n}\n\n// newWebDAVReplicaClientFromConfig returns a new instance of webdav.ReplicaClient built from config.\nfunc newWebDAVReplicaClientFromConfig(c *ReplicaConfig, _ *litestream.Replica) (_ *webdav.ReplicaClient, err error) {\n\t// Ensure URL & constituent parts are not both specified.\n\tif c.URL != \"\" && c.Path != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot specify url & path for webdav replica\")\n\t} else if c.URL != \"\" && c.WebDAVURL != \"\" {\n\t\treturn nil, fmt.Errorf(\"cannot specify url & webdav-url for webdav replica\")\n\t}\n\n\twebdavURL, username, password, path := c.WebDAVURL, c.WebDAVUsername, c.WebDAVPassword, c.Path\n\n\t// Apply settings from URL, if specified.\n\tif c.URL != \"\" {\n\t\tu, err := url.Parse(c.URL)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Build WebDAV URL from scheme and host\n\t\tscheme := \"http\"\n\t\tif u.Scheme == \"webdavs\" {\n\t\t\tscheme = \"https\"\n\t\t}","sourceCodeStart":1844,"sourceCodeEnd":1880,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/cmd/litestream/main.go#L1844-L1880","documentation":"newWebDAVReplicaClientFromConfig rejects configs that set both the combined 'url' and the individual 'path' field for a webdav replica. The URL should encode everything; specifying path alongside it is ambiguous and fails fast at startup.","triggerScenarios":"A webdav replica config where c.URL is non-empty and c.Path is also non-empty, e.g. url: 'webdavs://dav.example.com/db' plus path: /db.","commonSituations":"Upgrading an older per-field webdav config by adding a url without deleting the old path key; generated configs that always include 'path:'.","solutions":["Remove the 'path' key and keep only 'url' (put the path in the URL)","Or remove 'url' and configure webdav-url/username/password/path individually","Validate the final YAML contains exactly one of the two specification styles"],"exampleFix":"# before\n- type: webdav\n  url: webdavs://dav.example.com/db\n  path: /db\n# after\n- type: webdav\n  url: webdavs://dav.example.com/db","handlingStrategy":"validation","validationCode":"if rep.Type == \"webdav\" && rep.URL != \"\" && rep.Path != \"\" {\n    return fmt.Errorf(\"webdav replica %s: url and path are mutually exclusive\", rep.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Encode the path inside the webdav url","Remove discrete path key when url is set","Add config linting for mutually exclusive keys"],"tags":["config","webdav","litestream","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}