RocketChat/Rocket.Chat · error · Meteor.Error

error-not-allowed

error-not-allowed

Error message

WebDAV Integration Not Allowed

What it means

getFileFromWebdav throws error-not-allowed ('WebDAV Integration Not Allowed') when the Webdav_Integration_Enabled setting is false. The toggle is checked immediately after the user check, so even users with valid, pre-existing WebDAV accounts cannot download files once the integration is disabled workspace-wide.

Source

Thrown at apps/meteor/server/bridges/webdav/methods/getFileFromWebdav.ts:25

import { getWebdavCredentials } from '../lib/getWebdavCredentials';
import { WebdavClientAdapter } from '../lib/webdavClientAdapter';

declare module '@rocket.chat/ddp-client' {
	// eslint-disable-next-line @typescript-eslint/naming-convention
	interface ServerMethods {
		getFileFromWebdav(accountId: IWebdavAccount['_id'], file: IWebdavNode): Promise<{ success: boolean; data: Uint8Array<ArrayBuffer> }>;
	}
}

Meteor.methods<ServerMethods>({
	async getFileFromWebdav(accountId, file) {
		const userId = Meteor.userId();

		if (!userId) {
			throw new Meteor.Error('error-invalid-user', 'Invalid User', { method: 'getFileFromWebdav' });
		}
		if (!settings.get('Webdav_Integration_Enabled')) {
			throw new Meteor.Error('error-not-allowed', 'WebDAV Integration Not Allowed', {
				method: 'getFileFromWebdav',
			});
		}

		const account = await WebdavAccounts.findOneByIdAndUserId(accountId, userId, {});
		if (!account) {
			throw new Meteor.Error('error-invalid-account', 'Invalid WebDAV Account', {
				method: 'getFileFromWebdav',
			});
		}

		try {
			const cred = getWebdavCredentials(account);
			const client = new WebdavClientAdapter(account.serverURL, cred);
			const fileContent = await client.getFileContents(file.filename);
			const data = new Uint8Array(fileContent);
			return { success: true, data };
		} catch (error) {

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Re-enable WebDAV Integration under Admin → WebDAV Integration
  2. Remove/hide WebDAV file-picker UI when the integration is off
  3. Scripts should check the setting before attempting downloads

Example fix

// before
await call('getFileFromWebdav', accountId, file); // throws error-not-allowed

// after
const { value } = await (await fetch('/api/v1/settings/Webdav_Integration_Enabled', { headers })).json();
if (value !== true) throw new Error('WebDAV Integration is disabled');
await call('getFileFromWebdav', accountId, file);
Defensive patterns

Strategy: validation

Validate before calling

const { value } = await (await fetch('/api/v1/settings/Webdav_Integration_Enabled', { headers: adminHeaders })).json();
if (value !== true) throw new Error('WebDAV Integration is disabled');
await call('getFileFromWebdav', accountId, file);

Try / catch

try {
  await Meteor.callAsync('getFileFromWebdav', accountId, file);
} catch (e) {
  if (e.error === 'error-not-allowed') {
    // integration disabled workspace-wide: disable the picker UI
  }
}

Prevention

When it happens

Trigger: Calling getFileFromWebdav while Webdav_Integration_Enabled is false — e.g. the admin disabled the integration after accounts were linked, or it was never enabled on this workspace.

Common situations: Disabling the integration to troubleshoot and forgetting that file downloads stop too; restored configs losing the setting; users with cached account data attempting downloads on a workspace where the feature was turned off.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/7895d49c6fbcb5f4. Report an issue: GitHub.