RocketChat/Rocket.Chat · error · Meteor.Error

error-not-allowed

error-not-allowed

Error message

WebDAV Integration Not Allowed

What it means

Thrown as a feature gate by both addWebdavAccount and addWebdavAccountByToken before any network or DB work: the Rocket.Chat admin setting 'Webdav_Integration_Enabled' is falsy, so the WebDAV integration is disabled server-wide. It is a hard precondition check, not a transient failure. Re-enabling the setting makes the same call succeed without any other change.

Source

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

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

declare module '@rocket.chat/ddp-client' {
	// eslint-disable-next-line @typescript-eslint/naming-convention
	interface ServerMethods {
		addWebdavAccount(formData: IWebdavAccountPayload): boolean;
		addWebdavAccountByToken(data: IWebdavAccountPayload): boolean;
	}
}

export const addWebdavAccountByToken = async (userId: string, data: IWebdavAccountPayload): Promise<boolean> => {
	if (!userId) {
		throw new Meteor.Error('error-invalid-user', 'Invalid User', { method: 'addWebdavAccount' });
	}

	if (!settings.get('Webdav_Integration_Enabled')) {
		throw new Meteor.Error('error-not-allowed', 'WebDAV Integration Not Allowed', {
			method: 'addWebdavAccount',
		});
	}

	check(
		data,
		Match.ObjectIncluding({
			serverURL: String,
			token: Match.ObjectIncluding({
				access_token: String,
				token_type: String,
				refresh_token: Match.Optional(String),
			}),
			name: Match.Maybe(String),
		}),
	);

	try {

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. As admin, open Administration > Workspace > Settings (or Integrations) and set 'WebDAV Integration Enabled' (key Webdav_Integration_Enabled) to true, then retry the call.
  2. Set the value programmatically: settings.set('Webdav_Integration_Enabled', true) on the server, or push it via your deployment's settings preset/seed, then retry.
  3. If the call comes from an automated client, have it preflight by reading the public WebDAV-enabled flag and surface 'contact admin to enable WebDAV' instead of attempting the method.
  4. Confirm the setting is not being overridden by a deployment env var or a conflicting settings document in the DB after enabling it.

Example fix

// before: client calls the method blindly
Meteor.call('addWebdavAccount', payload, (err) => { /* err: error-not-allowed */ });

// after: gate the call on the public setting exposed to the client
if (Settings.getOrDefault('Webdav_Integration_Enabled', false) !== true) {
  showWarning('WebDAV is disabled. Ask a workspace admin to enable it.');
  return;
}
Meteor.call('addWebdavAccount', payload, ...);
Defensive patterns

Strategy: validation

Validate before calling

// Server-side caller (e.g. an app or another method) — check before invoking
import { settings } from '../../../../../server/settings';

function webdavEnabled(): boolean {
  return settings.get('Webdav_Integration_Enabled') === true;
}

if (!webdavEnabled()) {
  // do not call addWebdavAccount / addWebdavAccountByToken
  throw new Error('WebDAV integration is disabled in workspace settings');
}

// Client-side caller — gate on the public setting exposed to the client
if (window.__rocket_chat_settings?.Webdav_Integration_Enabled !== true) {
  ui.alert('WebDAV is disabled. Ask an admin to enable it.');
}

Try / catch

// Wrap the method call; this error is deterministic, so do NOT retry.
try {
  await Meteor.callAsync('addWebdavAccount', payload);
} catch (e) {
  if (e instanceof Meteor.Error && e.error === 'error-not-allowed') {
    showUser('WebDAV is disabled. Ask a workspace admin to enable it in Settings.');
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling the Meteor method 'addWebdavAccount' (with username/password) or 'addWebdavAccountByToken' (with an OAuth token) while settings.get('Webdav_Integration_Enabled') returns false. Triggered identically for any authenticated userId — the check runs after the userId guard but before input validation, so even well-formed payloads are rejected.

Common situations: Fresh install or workspace where the admin never enabled WebDAV; admin toggled it off after incidents; settings collection reset/restored from a backup that predates the feature; test/staging env seeded without the setting; an apps-engine or migration script calling the method on an instance where the setting was never flipped.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/bcd1cd31c9eae853. Report an issue: GitHub.