{"record":{"id":"568bd99652bde70a","repo":"RocketChat/Rocket.Chat","slug":"forbidden-568bd9","errorCode":null,"errorMessage":"Forbidden","messagePattern":"Forbidden","errorType":"http","errorClass":null,"httpStatus":403,"severity":"error","filePath":"apps/meteor/server/lib/media/custom-sounds/startup/custom-sounds.js","lineNumber":48,"sourceCode":"\tif (settings.get('CustomSounds_FileSystemPath') != null) {\n\t\tif (settings.get('CustomSounds_FileSystemPath').trim() !== '') {\n\t\t\tpath = settings.get('CustomSounds_FileSystemPath');\n\t\t}\n\t}\n\n\tRocketChatFileCustomSoundsInstance = new RocketChatStore({\n\t\tname: 'custom_sounds',\n\t\tabsolutePath: path,\n\t});\n};\n\nMeteor.startup(() => {\n\tinitializeCustomSoundsStorage();\n\treturn WebApp.connectHandlers.use('/custom-sounds/', async (req, res /* , next*/) => {\n\t\tconst fileId = decodeURIComponent(req.url.replace(/^\\//, '').replace(/\\?.*$/, ''));\n\n\t\tif (!fileId) {\n\t\t\tres.writeHead(403);\n\t\t\tres.write('Forbidden');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\tconst sound = await CustomSounds.findOneById(fileId.split('.')[0], { projection: { _id: 1 } });\n\n\t\tif (!sound) {\n\t\t\tres.writeHead(404);\n\t\t\tres.write('Not found');\n\t\t\tres.end();\n\t\t\treturn;\n\t\t}\n\n\t\tconst file = await RocketChatFileCustomSoundsInstance.getFileWithReadStream(fileId);\n\n\t\tif (!file) {\n\t\t\tres.writeHead(404);","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/media/custom-sounds/startup/custom-sounds.js#L30-L66","documentation":"Error \"Forbidden\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/lib/media/custom-sounds/startup/custom-sounds.js:48 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include the custom sound file id in the request path after /custom-sounds/.","Verify the request URL is well-formed and the file id segment is not empty."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}