RocketChat/Rocket.Chat · error · Error
Transfer to entity with id ${transferData.to} not found
Error message
Transfer to entity with id ${transferData.to} not found What it means
Same IPostLivechatRoomTransferred handler, after the room check (listeners.ts:446-448). The destination entity (`to`) is resolved via the 'users' converter for LivechatTransferEventType.AGENT or the 'departments' converter otherwise (listeners.ts:436). If it resolves to undefined the bridge throws — the transfer target agent or department could not be found.
Source
Thrown at apps/meteor/app/apps/server/bridges/listeners.ts:447
.executeListener(args.event, {
room: (await this.orch.getConverters().get('rooms').convertRoom(agentData.room)) as IAppsLivechatRoom,
agent: this.orch.getConverters().get('users').convertToApp(agentData.user),
});
case AppInterface.IPostLivechatRoomTransferred: {
const [transferData] = args.payload;
const converter = transferData.type === LivechatTransferEventType.AGENT ? 'users' : 'departments';
const room = await this.orch.getConverters().get('rooms').convertById(transferData.room);
const from = await this.orch.getConverters().get(converter).convertById(transferData.from);
const to = await this.orch.getConverters().get(converter).convertById(transferData.to);
if (!room) {
throw new Error(`Room with id ${transferData.room} not found`);
}
if (!to) {
throw new Error(`Transfer to entity with id ${transferData.to} not found`);
}
return this.orch
.getManager()
.getListenerManager()
.executeListener(args.event, {
room,
from: from as NonNullable<typeof from>, // type definition in the apps-engine seems to be incorrect
to,
type: transferData.type,
});
}
case AppInterface.IPostLivechatGuestSaved: {
const [visitorId] = args.payload;
const visitor = await this.orch.getConverters().get('visitors').convertById(visitorId);
if (!visitor) {View on GitHub (pinned to f9d3ec372b)
Solutions
- Confirm transferData.to exists in the correct collection (users for AGENT, departments for DEPARTMENT).
- Ensure transferData.type matches the id kind.
- Investigate deletion races and data integrity.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await appListenerBridge.handleEvent({ event: AppInterface.IPostLivechatRoomTransferred, payload: [transferData] });
} catch (e) {
if (e instanceof Error && /Transfer to entity with id .* not found/.test(e.message)) {
logger.warn({ msg: 'Transfer event skipped: target missing', toId: transferData.to, type: transferData.type });
return;
}
throw e;
} Prevention
- Verify the destination agent/department exists before initiating a transfer.
- Keep transferData.type consistent with the destination id kind (AGENT->user, DEPARTMENT->department).
- Handle deletion races gracefully when target entities may be removed mid-flow.
When it happens
Trigger: transferData.to references an agent user or department that was deleted, never existed, or could not be read; or transferData.type mismatches the id kind (an agent id passed with DEPARTMENT type, or vice versa).
Common situations: Destination agent/department removed between transfer and event dispatch; type/id mismatch in the payload; data-integrity issue.
Related errors
- Room with id ${transferData.room} not found
- Visitor with id ${visitorId} not found
- Room with id ${roomId} not found
- Department ${departmentData._id} not found
- Room ${roomData._id} not found
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/217264d0b2744db8.
Report an issue: GitHub.