RocketChat/Rocket.Chat · error · Error
Command does not exist in the system currently (or it is dis
Error message
Command does not exist in the system currently (or it is disabled): "${cmd}" What it means
`modifyCommand(command: ISlashCommand)` (commands.ts:75-83) updates an existing slash command. After `_verifyCommand` it lowercases `command.command` and looks it up in `slashCommands.commands`. If absent it throws — the command must be present AND not currently disabled, because disabled commands are parked in disabledCommands, not slashCommands.commands. A command therefore cannot be modified while disabled.
Source
Thrown at apps/meteor/app/apps/server/bridges/commands.ts:82
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}"`);
}
const item = slashCommands.commands[cmd];
item.params = command.i18nParamsExample ? command.i18nParamsExample : item.params;
item.description = command.i18nDescription ? command.i18nDescription : item.params;
item.callback = this._appCommandExecutor.bind(this);
item.providesPreview = command.providesPreview;
item.previewer = command.previewer ? this._appCommandPreviewer.bind(this) : item.previewer;
item.previewCallback = (
command.executePreviewItem ? this._appCommandPreviewExecutor.bind(this) : item.previewCallback
) as (typeof slashCommands.commands)[string]['previewCallback'];
slashCommands.commands[cmd] = item;
void this.orch.getNotifier().commandUpdated(cmd);
}
protected async registerCommand(command: ISlashCommand, appId: string): Promise<void> {View on GitHub (pinned to f9d3ec372b)
Solutions
- Re-enable the command before modifying it.
- Confirm registerCommand completed and the command sits in the active registry.
- Use the exact registered command string.
Example fix
// before await modifier.modifyCommand(updatedCmd) // command is currently disabled // after await modifier.enableCommand(updatedCmd.command); // re-enable first await modifier.modifyCommand(updatedCmd);
Defensive patterns
Strategy: try-catch
Try / catch
try {
await modifier.modifyCommand(updatedCmd);
} catch (e) {
if (e instanceof Error && /does not exist in the system currently/.test(e.message)) {
// likely disabled: re-enable then retry
await modifier.enableCommand(updatedCmd.command).catch(() => {});
await modifier.modifyCommand(updatedCmd);
return;
}
throw e;
} Prevention
- Avoid modifying commands you have disabled; re-enable first.
- Keep command lifecycle calls ordered: register -> modify -> disable -> enable.
- Note doesCommandExist returns true for disabled commands, so it cannot prevent this error alone.
When it happens
Trigger: Modifying a command that is currently disabled, never registered, was unregistered, or whose name changed.
Common situations: App tries to update its own command while a prior disable parked it; modify fired on startup before registration completed; command-name drift after a rename.
Related errors
- The command is not currently disabled: "${cmd}"
- Command does not exist in the system currently: "${cmd}"
- Invalid command parameter provided, must be a string.
- Invalid Slash Command parameter provided, it must be a valid
- Invalid Api parameter provided, it must be a valid IApi obje
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/69746612de4e9071.
Report an issue: GitHub.