laurent22/joplin · error · Error

WebDAV directory not found: ${options.path()}

Error message

WebDAV directory not found: ${options.path()}

What it means

Thrown by SyncTargetWebDAV.checkConfig after fileApi.stat('') returns a falsy result. The stat with an empty path probes the WebDAV base directory; a falsy result means the directory does not exist or the server did not return a usable stat. checkProviderIsSupported runs first, so this fires only for supported providers when the path itself is wrong.

Source

Thrown at packages/lib/SyncTargetWebDAV.ts:74

		const driver = new FileApiDriverWebDav(api);
		const fileApi = new FileApi('', driver);
		fileApi.setSyncTargetId(syncTargetId);
		return fileApi;
	}

	public static override async checkConfig(options: WebDavFileApiOptions): Promise<CheckConfigResult> {
		const fileApi = await SyncTargetWebDAV.newFileApi_(SyncTargetWebDAV.id(), options);
		fileApi.requestRepeatCount_ = 0;

		const output: CheckConfigResult = {
			ok: false,
			errorMessage: '',
		};

		try {
			checkProviderIsSupported(options.path());
			const result = await fileApi.stat('');
			if (!result) throw new Error(`WebDAV directory not found: ${options.path()}`);
			output.ok = true;
		} catch (error) {
			output.errorMessage = error.message;
			if (error.code) output.errorMessage += ` (Code ${error.code})`;
		}

		return output;
	}

	public async initFileApi() {
		const fileApi = await SyncTargetWebDAV.newFileApi_(SyncTargetWebDAV.id(), {
			path: () => Setting.value('sync.6.path'),
			username: () => Setting.value('sync.6.username'),
			password: () => Setting.value('sync.6.password'),
			ignoreTlsErrors: () => Setting.value('net.ignoreTlsErrors'),
		});

		fileApi.setLogger(this.logger());

View on GitHub (pinned to 2654b33620)

Solutions

  1. Verify the WebDAV URL and path segment against the server — open the URL in a browser to confirm the directory resolves.
  2. Create the directory on the server first (many WebDAV servers do not auto-create the base path).
  3. Match the trailing-slash convention the server expects (some need a trailing /, some reject it).
  4. Confirm credentials have read+write on that directory.

Example fix

# before
sync.6.path: https://dav.example.com/misspelled-folder
# after
sync.6.path: https://dav.example.com/joplin   # directory exists on server
Defensive patterns

Strategy: validation

Validate before calling

// Probe the WebDAV base path with a stat before offering sync.
const stat = await fileApi.stat('');
if (!stat) throw new Error(`WebDAV path does not resolve: ${options.path()}`);

Type guard

const isResolvableWebDavPath = async (api, p) => !!(await api.stat(p));

Try / catch

try { await SyncTargetWebDAV.checkConfig(options); }
catch (e) { if (/WebDAV directory not found/.test(e.message)) { /* fix URL/path, create dir on server */ } else throw e; }

Prevention

When it happens

Trigger: checkConfig() runs checkProviderIsSupported(options.path()) then fileApi.stat('') — stat resolves to falsy. Indicates the configured WebDAV path does not point to an existing directory on the server.

Common situations: Path in sync settings has a typo or wrong segment; directory was never created on the server; using a relative path where an absolute path is required; trailing slash differences; server requires the directory to pre-exist.

Related errors


AI-assisted analysis of laurent22/joplin@2654b33620 (2026-08-12). Data as JSON: /api/errors/76ebebfc5bed8207. Report an issue: GitHub.