{"record":{"id":"7edb4fc1ebd16f0f","repo":"RocketChat/Rocket.Chat","slug":"failed-to-create-message","errorCode":null,"errorMessage":"failed-to-create-message","messagePattern":"failed-to-create-message","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/services/video-conference/service.ts","lineNumber":573,"sourceCode":"\t\treturn videoConfTypes.getTypeForRoom(room, allowRinging);\n\t}\n\n\tprivate async createMessage(call: VideoConference, createdBy?: IUser, customBlocks?: IMessage['blocks']): Promise<IMessage['_id']> {\n\t\tconst record = {\n\t\t\tt: 'videoconf',\n\t\t\tmsg: '',\n\t\t\tgroupable: false,\n\t\t\tblocks: customBlocks || [this.buildVideoConfBlock(call._id)],\n\t\t} satisfies Partial<IMessage>;\n\n\t\tconst room = await Rooms.findOneById(call.rid);\n\t\tconst appId = videoConfProviders.getProviderAppId(call.providerName);\n\t\tconst user = createdBy || (appId && (await Users.findOneByAppId(appId))) || (await Users.findOneById('rocket.cat'));\n\n\t\tconst message = await sendMessage(user, record, room);\n\n\t\tif (!message) {\n\t\t\tthrow new Error('failed-to-create-message');\n\t\t}\n\n\t\treturn message._id;\n\t}\n\n\tprivate async validateProvider(providerName: string): Promise<void> {\n\t\tconst manager = await this.getProviderManager();\n\t\tconst configured = await manager.isFullyConfigured(providerName).catch(() => false);\n\t\tif (!configured) {\n\t\t\tthrow new Error(availabilityErrors.NOT_CONFIGURED);\n\t\t}\n\t}\n\n\tprivate async getValidatedProvider(): Promise<string> {\n\t\tif (!videoConfProviders.hasAnyProvider()) {\n\t\t\tthrow new Error(availabilityErrors.NO_APP);\n\t\t}\n","sourceCodeStart":555,"sourceCodeEnd":591,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/e4b8178b205510181a96ceefee043d0abcd13e5a/apps/meteor/server/services/video-conference/service.ts#L555-L591","documentation":"Thrown by VideoConferenceService's announcement helper when sendMessage(user, record, room) returns a falsy value while posting the video-call message into call.rid. The room, provider app user, or rocket.cat fallback resolved, but the messaging pipeline produced no message document — an internal messaging-layer failure surfaced at the call layer. The call object itself may already exist, so retries can duplicate state.","triggerScenarios":"A beforeSaveMessage/sendMessage hook or moderation app suppressing the message; the room disappearing between the initial lookup and sendMessage; a hardened install where rocket.cat was deleted and no fallback user could post.","commonSituations":"Message-moderation apps silently swallowing call announcements; databases where the system user was removed; races with room deletion.","solutions":["Inspect server logs around the sendMessage pipeline and audit apps hooking message sending","Verify call.rid still exists before retrying","Ensure the rocket.cat system user exists — the helper falls back to it","Temporarily disable message-moderation apps to confirm the cause, then allow-list call messages"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const room = await Rooms.findOneById(call.rid, { projection: { _id: 1 } });\nif (!room) throw new Meteor.Error('invalid-room'); // room must exist before the announcement posts","typeGuard":null,"tryCatchPattern":"try {\n  await VideoConfService.create(payload);\n} catch (err) {\n  if (err instanceof Error && err.message === 'failed-to-create-message') {\n    // call object may exist without an announcement: notify the user, check message hooks/apps, do not blind-retry\n  }\n  throw err;\n}","preventionTips":["Audit apps hooking message sending on production","Keep the rocket.cat system user intact","Log announcement failures with rid and providerName for triage"],"tags":["video-conference","messaging","internal-error"],"backgroundTag":"message-send-failed","analyzedSha":"e4b8178b205510181a96ceefee043d0abcd13e5a","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}