{"record":{"id":"2a4d87f799d1e63b","repo":"RocketChat/Rocket.Chat","slug":"error-invalid-file-height","errorCode":"error-invalid-file-height","errorMessage":"error-invalid-file-height","messagePattern":"error-invalid-file-height","errorType":"error_code","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/media/assets/assets.ts","lineNumber":253,"sourceCode":"\t\t\t});\n\t\t}\n\n\t\tconst extension = getExtension(contentType);\n\t\tif (assetInstance.constraints.extensions.includes(extension) === false) {\n\t\t\tthrow new Meteor.Error('error-invalid-file-type', `Invalid file type: ${contentType}`, {\n\t\t\t\tfunction: 'RocketChat.Assets.setAsset',\n\t\t\t});\n\t\t}\n\n\t\tif (assetInstance.constraints.width || assetInstance.constraints.height) {\n\t\t\tconst dimensions = sizeOf(file);\n\t\t\tif (assetInstance.constraints.width && assetInstance.constraints.width !== dimensions.width) {\n\t\t\t\tthrow new Meteor.Error('error-invalid-file-width', 'Invalid file width', {\n\t\t\t\t\tfunction: 'Invalid file width',\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (assetInstance.constraints.height && assetInstance.constraints.height !== dimensions.height) {\n\t\t\t\tthrow new Meteor.Error('error-invalid-file-height');\n\t\t\t}\n\t\t}\n\n\t\tconst rs = RocketChatFile.bufferToStream(file);\n\t\tawait RocketChatAssetsInstance.deleteFile(asset);\n\n\t\tconst ws = RocketChatAssetsInstance.createWriteStream(asset, contentType);\n\n\t\treturn new Promise((resolve) => {\n\t\t\tws.on('end', () => {\n\t\t\t\treturn setTimeout(async () => {\n\t\t\t\t\tconst key = `Assets_${asset}`;\n\t\t\t\t\tconst value = {\n\t\t\t\t\t\turl: `assets/${asset}.${extension}`,\n\t\t\t\t\t\tdefaultUrl: assetInstance.defaultUrl,\n\t\t\t\t\t} as IRocketChatAsset;\n\n\t\t\t\t\tawait RocketChatAssets.processAsset(key, value);","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/media/assets/assets.ts#L235-L271","documentation":"Error \"error-invalid-file-height\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/lib/media/assets/assets.ts:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"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"}