{"record":{"id":"0ab6f0778ec838bd","repo":"RocketChat/Rocket.Chat","slug":"the-command-is-not-currently-disabled-cmd","errorCode":null,"errorMessage":"The command is not currently disabled: \"${cmd}\"","messagePattern":"The command is not currently disabled: \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/app/apps/server/bridges/commands.ts","lineNumber":40,"sourceCode":"\t\tif (typeof command !== 'string' || command.length === 0) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst cmd = command.toLowerCase();\n\n\t\treturn typeof slashCommands.commands[cmd] === 'object' || this.disabledCommands.has(cmd);\n\t}\n\n\tprotected async enableCommand(command: string, appId: string): Promise<void> {\n\t\tthis.orch.debugLog(`The App ${appId} is attempting to enable the command: \"${command}\"`);\n\n\t\tif (typeof command !== 'string' || command.trim().length === 0) {\n\t\t\tthrow new Error('Invalid command parameter provided, must be a string.');\n\t\t}\n\n\t\tconst cmd = command.toLowerCase();\n\t\tif (!this.disabledCommands.has(cmd)) {\n\t\t\tthrow new Error(`The command is not currently disabled: \"${cmd}\"`);\n\t\t}\n\n\t\tslashCommands.commands[cmd] = this.disabledCommands.get(cmd) as (typeof slashCommands.commands)[string];\n\t\tthis.disabledCommands.delete(cmd);\n\n\t\tvoid this.orch.getNotifier().commandUpdated(cmd);\n\t}\n\n\tprotected async disableCommand(command: string, appId: string): Promise<void> {\n\t\tthis.orch.debugLog(`The App ${appId} is attempting to disable the command: \"${command}\"`);\n\n\t\tif (typeof command !== 'string' || command.trim().length === 0) {\n\t\t\tthrow new Error('Invalid command parameter provided, must be a string.');\n\t\t}\n\n\t\tconst cmd = command.toLowerCase();\n\t\tif (this.disabledCommands.has(cmd)) {\n\t\t\t// The command is already disabled, no need to disable it yet again","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/app/apps/server/bridges/commands.ts#L22-L58","documentation":"Rocket.Chat apps-engine apps can expose HTTP endpoints under /api/apps/private/:appId/:hash. AppApisBridge keeps one express Router per app (populated by registerApi when the app calls provideApi); if appId has no router, or the inner router matches no route for the path/method, the notFound fallback answers 404 'Not Found'.","triggerScenarios":"Calling /api/apps/private/<appId>/<hash>/... when the app is uninstalled or disabled; the app never called app.api.provideApi so no router exists; the endpoint path or method in the URL does not match what the app registered; wrong or malformed appId/hash segment shifting the parsed path.","commonSituations":"App removed or disabled while external integrations still call its endpoints; app upgraded and endpoint paths changed; app failed to build/enable after update; local development against a workspace where the app is not installed; URL-encoding problems corrupting :appId.","solutions":["Verify the app is installed and enabled (Administration > Apps) and check the exact API path it exposes","Confirm the app actually registers the endpoint (provideApi) and note the registered path and whether it expects auth","Compare the appId in the URL with the app's ID shown in the admin Apps view","Re-check the URL: correct appId, correct private hash segment, exact endpoint path and leading slash"],"exampleFix":"// before: endpoint never registered, client calls /api/apps/private/<appId>/<hash>/status -> 404\n// after: app registers the endpoint\nthis.api = app.getLogger();\nawait app.getProviderManager().provideApi({ name: 'Status API', endpoints: [{ path: 'status', method: 'get', handler: async () => ({ status: 200, content: 'ok' } } as any) }] as any);","handlingStrategy":"validation","validationCode":"const res = await fetch(`${url}/api/apps/private/${appId}/${hash}/${path}`);\nif (res.status === 404) throw new Error(`apps-engine endpoint not registered: app=${appId} path=${path} — verify install/enable state`);","typeGuard":"const isRegisteredApp = (routers: Map<string, unknown>, appId: string): boolean => routers.has(appId);","tryCatchPattern":null,"preventionTips":["Log the full appId/path on every 404 so misconfiguration is obvious","Verify an app is installed and enabled before wiring external webhooks to its endpoints","Pin endpoint paths in config and re-verify after app upgrades","Include a health endpoint in every app that exposes an API"],"tags":["apps-engine","http-404","api","routing"],"backgroundTag":"endpoint-not-found","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}