RocketChat/Rocket.Chat · warning · Error

Command does not exist in the system currently

Error message

Command does not exist in the system currently: "${cmd}"

What it means

Rocket.Chat wraps WebAppInternals.staticFilesMiddleware to refuse /meteor_runtime_config.js requests whose ?hash= query does not equal the server's current per-arch WebApp build hash, answering a bodyless 404. This is deliberate cache poisoning protection: serving a runtime config from a different build than the client bundle makes the client's version hash mismatch the websocket handshake and loop, so stale or hashless requests are cut off instead.

Solutions

  1. Hard-refresh or clear site data (the middleware already sets Clear-Site-Data via the cache_version cookie when versions differ)
  2. Fetch the file with the hash taken from the current page's own script URL, never a hardcoded or cached one
  3. Exclude /meteor_runtime_config.js* from CDN/proxy caches
  4. After upgrades, make sure every replica serves the same build so the expected hash is consistent

Example fix

// before
fetch('/meteor_runtime_config.js');
// after: reuse the hash the page was served with
const hash = document.querySelector('script[src*="meteor_runtime_config"]').src.match(/hash=([0-9a-f]+)/)[1];
fetch(`/meteor_runtime_config.js?hash=${hash}`);
Defensive patterns

Strategy: fallback

Validate before calling

const currentHash = document.querySelector('script[src*="meteor_runtime_config"]')?.src.match(/hash=([0-9a-f]+)/)?.[1];
if (!currentHash || currentHash !== wantedHash) { location.reload(); /* pick up fresh hashes */ }

Try / catch

On a 404 from meteor_runtime_config.js, force a cache-busting reload (or clear site data) instead of retrying the same URL — the server hash moved on.

Prevention

When it happens

Trigger: Fetching /meteor_runtime_config.js without ?hash=<current-hash> or with a previous build's hash — typically right after a server upgrade/rebuild while the browser or an intermediate cache still holds old HTML; CDN/proxy caching of the file; scripts fetching the URL directly without a hash.

Common situations: Post-deploy stale caches; reverse proxies or CDNs caching meteor_runtime_config.js; replicas behind one proxy serving different build versions; scrapers or custom clients hardcoding the bare URL.

Related errors


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

Appendix: source

Thrown at apps/meteor/app/apps/server/bridges/commands.ts:65

	}

	protected async disableCommand(command: string, appId: string): Promise<void> {
		this.orch.debugLog(`The App ${appId} is attempting to disable the command: "${command}"`);

		if (typeof command !== 'string' || command.trim().length === 0) {
			throw new Error('Invalid command parameter provided, must be a string.');
		}

		const cmd = command.toLowerCase();
		if (this.disabledCommands.has(cmd)) {
			// The command is already disabled, no need to disable it yet again
			return;
		}

		const commandObj = slashCommands.commands[cmd];

		if (typeof commandObj === 'undefined') {
			throw new Error(`Command does not exist in the system currently: "${cmd}"`);
		}

		this.disabledCommands.set(cmd, commandObj);
		delete slashCommands.commands[cmd];

		void this.orch.getNotifier().commandDisabled(cmd);
	}

	// command: { command, paramsExample, i18nDescription, executor: function }
	protected async modifyCommand(command: ISlashCommand, appId: string): Promise<void> {
		this.orch.debugLog(`The App ${appId} is attempting to modify the command: "${command}"`);

		this._verifyCommand(command);

		const cmd = command.command.toLowerCase();
		if (typeof slashCommands.commands[cmd] === 'undefined') {
			throw new Error(`Command does not exist in the system currently (or it is disabled): "${cmd}"`);
		}

View on GitHub (pinned to b2c16d5842)