RocketChat/Rocket.Chat · error · Meteor.Error
error-returning-inquiry
error-returning-inquiry
Error message
error-returning-inquiry
What it means
returnRoomAsInquiry wraps saveTransferHistory and RoutingManager.unassignAgent in one try/catch; any failure in either call is logged via livechatLogger.error({ err }) and re-raised as Meteor.Error('error-returning-inquiry'). It is a wrapper error: the real cause appears only in the server log entry immediately before it.
Source
Thrown at apps/meteor/server/lib/omnichannel/rooms.ts:262
if (!inquiry) {
return false;
}
// update inquiry's last message with room's last message to correctly display in the queue
// because we stop updating the inquiry when it's been taken
if (room.lastMessage) {
await LivechatInquiry.setLastMessageById(inquiry._id, room.lastMessage);
}
const transferredBy = normalizeTransferredByData(user, room);
livechatLogger.debug({ msg: 'Transferring room by user', roomId: room._id, transferredBy: transferredBy._id });
const transferData = { scope: 'queue' as const, departmentId, transferredBy, ...overrideTransferData };
try {
await saveTransferHistory(room, transferData);
await RoutingManager.unassignAgent(inquiry, departmentId);
} catch (err) {
livechatLogger.error({ err });
throw new Meteor.Error('error-returning-inquiry');
}
callbacks.runAsync('livechat:afterReturnRoomAsInquiry', { room });
return true;
}
export async function removeOmnichannelRoom(rid: string) {
livechatLogger.debug({ msg: 'Deleting room', roomId: rid });
check(rid, String);
const room = await LivechatRooms.findOneById(rid);
if (!room) {
throw new Meteor.Error('error-invalid-room', 'Invalid room');
}
if (!isOmnichannelRoom(room)) {
throw new Meteor.Error('error-this-is-not-a-livechat-room');
}View on GitHub (pinned to b2c16d5842)
Solutions
- Read the server logs: the livechatLogger.error entry right before this error carries the original exception — fix that root cause first.
- Reproduce with the workspace's routing method (Administration > Omnichannel > Routing) to isolate custom routing code.
- Retry after the underlying fix; both calls run inside the same try block, so a partial state is possible and the room should be re-checked.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await returnRoomAsInquiry(room, departmentId);
} catch (err) {
if (err instanceof Meteor.Error && err.error === 'error-returning-inquiry') {
// inspect server logs: livechatLogger.error({ err }) logged the underlying cause
// room state may be partially updated - re-fetch before any retry
return;
}
throw err;
} Prevention
- Always pair this error with a server-log review — the root cause is the logged inner err, not this code.
- Test custom routing methods against return-to-queue flows before deploying them.
- After upgrades, regression-test transfer history and unassignment paths.
When it happens
Trigger: saveTransferHistory throws (transfer-history write failure) or the configured RoutingManager's unassignAgent throws (custom routing method, auto-selection engine error) while returning a room to the queue.
Common situations: Custom routing-method implementation raising; database write errors; regressions in transfer-history handling after a version upgrade.
Related errors
- agent-not-found
- error-no-agents-available-for-service-on-department
- room-closed
- no-agent-online
- error-contact-not-found
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/c1cfe6182fd56fa3.
Report an issue: GitHub.