RocketChat/Rocket.Chat · error

Forbidden

Error message

Forbidden

What it means

Error "Forbidden" thrown in RocketChat/Rocket.Chat.

Source

Thrown at apps/meteor/server/lib/media/custom-sounds/startup/custom-sounds.js:48

	if (settings.get('CustomSounds_FileSystemPath') != null) {
		if (settings.get('CustomSounds_FileSystemPath').trim() !== '') {
			path = settings.get('CustomSounds_FileSystemPath');
		}
	}

	RocketChatFileCustomSoundsInstance = new RocketChatStore({
		name: 'custom_sounds',
		absolutePath: path,
	});
};

Meteor.startup(() => {
	initializeCustomSoundsStorage();
	return WebApp.connectHandlers.use('/custom-sounds/', async (req, res /* , next*/) => {
		const fileId = decodeURIComponent(req.url.replace(/^\//, '').replace(/\?.*$/, ''));

		if (!fileId) {
			res.writeHead(403);
			res.write('Forbidden');
			res.end();
			return;
		}

		const sound = await CustomSounds.findOneById(fileId.split('.')[0], { projection: { _id: 1 } });

		if (!sound) {
			res.writeHead(404);
			res.write('Not found');
			res.end();
			return;
		}

		const file = await RocketChatFileCustomSoundsInstance.getFileWithReadStream(fileId);

		if (!file) {
			res.writeHead(404);

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Include the custom sound file id in the request path after /custom-sounds/.
  2. Verify the request URL is well-formed and the file id segment is not empty.

When it happens

Trigger: Thrown at apps/meteor/server/lib/media/custom-sounds/startup/custom-sounds.js:48 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


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