RocketChat/Rocket.Chat · error · Meteor.Error
error-invalid-file-height
error-invalid-file-height
Error message
error-invalid-file-height
What it means
Error "error-invalid-file-height" thrown in RocketChat/Rocket.Chat.
Source
Thrown at apps/meteor/server/lib/media/assets/assets.ts:253
});
}
const extension = getExtension(contentType);
if (assetInstance.constraints.extensions.includes(extension) === false) {
throw new Meteor.Error('error-invalid-file-type', `Invalid file type: ${contentType}`, {
function: 'RocketChat.Assets.setAsset',
});
}
if (assetInstance.constraints.width || assetInstance.constraints.height) {
const dimensions = sizeOf(file);
if (assetInstance.constraints.width && assetInstance.constraints.width !== dimensions.width) {
throw new Meteor.Error('error-invalid-file-width', 'Invalid file width', {
function: 'Invalid file width',
});
}
if (assetInstance.constraints.height && assetInstance.constraints.height !== dimensions.height) {
throw new Meteor.Error('error-invalid-file-height');
}
}
const rs = RocketChatFile.bufferToStream(file);
await RocketChatAssetsInstance.deleteFile(asset);
const ws = RocketChatAssetsInstance.createWriteStream(asset, contentType);
return new Promise((resolve) => {
ws.on('end', () => {
return setTimeout(async () => {
const key = `Assets_${asset}`;
const value = {
url: `assets/${asset}.${extension}`,
defaultUrl: assetInstance.defaultUrl,
} as IRocketChatAsset;
await RocketChatAssets.processAsset(key, value);View on GitHub (pinned to b2c16d5842)
Solutions
- Resize the image so its height exactly matches the height required by the asset's constraints before uploading.
- Check the asset definition for the expected height and supply an image of that size.
When it happens
Trigger: Thrown at apps/meteor/server/lib/media/assets/assets.ts:253 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/2a4d87f799d1e63b.
Report an issue: GitHub.