{"record":{"id":"1b4d468d6148f093","repo":"RocketChat/Rocket.Chat","slug":"command-does-not-exist-in-the-system-currently","errorCode":null,"errorMessage":"Command does not exist in the system currently: \"${cmd}\"","messagePattern":"Command does not exist in the system currently: \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"apps/meteor/app/apps/server/bridges/commands.ts","lineNumber":65,"sourceCode":"\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\n\t\t\treturn;\n\t\t}\n\n\t\tconst commandObj = slashCommands.commands[cmd];\n\n\t\tif (typeof commandObj === 'undefined') {\n\t\t\tthrow new Error(`Command does not exist in the system currently: \"${cmd}\"`);\n\t\t}\n\n\t\tthis.disabledCommands.set(cmd, commandObj);\n\t\tdelete slashCommands.commands[cmd];\n\n\t\tvoid this.orch.getNotifier().commandDisabled(cmd);\n\t}\n\n\t// command: { command, paramsExample, i18nDescription, executor: function }\n\tprotected async modifyCommand(command: ISlashCommand, appId: string): Promise<void> {\n\t\tthis.orch.debugLog(`The App ${appId} is attempting to modify the command: \"${command}\"`);\n\n\t\tthis._verifyCommand(command);\n\n\t\tconst cmd = command.command.toLowerCase();\n\t\tif (typeof slashCommands.commands[cmd] === 'undefined') {\n\t\t\tthrow new Error(`Command does not exist in the system currently (or it is disabled): \"${cmd}\"`);\n\t\t}","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/app/apps/server/bridges/commands.ts#L47-L83","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Hard-refresh or clear site data (the middleware already sets Clear-Site-Data via the cache_version cookie when versions differ)","Fetch the file with the hash taken from the current page's own script URL, never a hardcoded or cached one","Exclude /meteor_runtime_config.js* from CDN/proxy caches","After upgrades, make sure every replica serves the same build so the expected hash is consistent"],"exampleFix":"// before\nfetch('/meteor_runtime_config.js');\n// after: reuse the hash the page was served with\nconst hash = document.querySelector('script[src*=\"meteor_runtime_config\"]').src.match(/hash=([0-9a-f]+)/)[1];\nfetch(`/meteor_runtime_config.js?hash=${hash}`);","handlingStrategy":"fallback","validationCode":"const currentHash = document.querySelector('script[src*=\"meteor_runtime_config\"]')?.src.match(/hash=([0-9a-f]+)/)?.[1];\nif (!currentHash || currentHash !== wantedHash) { location.reload(); /* pick up fresh hashes */ }","typeGuard":null,"tryCatchPattern":"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.","preventionTips":["Never hardcode or cache meteor_runtime_config.js URLs without their hash","Set CDN/proxy cache rules to bypass /meteor_runtime_config.js*","After deploys, verify all replicas serve identical build hashes"],"tags":["meteor","caching","http-404","static-files","cache-poisoning"],"backgroundTag":"cache-version-mismatch","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"}