RocketChat/Rocket.Chat · error · Error

failed-to-load-own-data

Error message

failed-to-load-own-data

What it means

Thrown by VideoConferenceService.create when Users.findOneById(createdBy) returns null — the user starting the call cannot be loaded, so the service cannot build the caller identity for messages and ringing. It fires after the room check and before the type-specific branches (direct/livechat/group).

Source

Thrown at apps/meteor/server/services/video-conference/service.ts:87

	protected name = 'video-conference';

	// VideoConference.create: Start a video conference using the type and provider specified as arguments
	public async create(
		{ type, rid, createdBy, providerName, ...data }: VideoConferenceCreateData,
		useAppUser = true,
	): Promise<VideoConferenceInstructions> {
		return wrapExceptions(async () => {
			const room = await Rooms.findOneById<Pick<IRoom, '_id' | 't' | 'uids' | 'name' | 'fname'>>(rid, {
				projection: { t: 1, uids: 1, name: 1, fname: 1 },
			});

			if (!room) {
				throw new Error('invalid-room');
			}

			const user = await Users.findOneById<IUser>(createdBy);
			if (!user) {
				throw new Error('failed-to-load-own-data');
			}

			if (type === 'direct') {
				if (!isRoomCompatibleWithVideoConfRinging(room.t, room.uids)) {
					throw new Error('type-and-room-not-compatible');
				}

				return this.startDirect(providerName, user, room, data);
			}

			if (type === 'livechat') {
				return this.startLivechat(providerName, user, rid);
			}

			const title = (data as Partial<IGroupVideoConference>).title || room.fname || room.name || '';
			return this.startGroup(providerName, user, room._id, title, data, useAppUser);
		}).catch((err) => {
			logger.error({

View on GitHub (pinned to e4b8178b20)

Solutions

  1. Verify the user exists (Users.findOneById) before calling create
  2. Always take createdBy from the authenticated context (e.g. this.userId in Meteor methods) rather than client payloads
  3. For app integrations, ensure the provider app's user exists and is not deleted
  4. Seed Users consistently in test fixtures

Example fix

// before
await VideoConfService.create({ type, rid, createdBy, providerName });

// after
const user = await Users.findOneById(createdBy, { projection: { _id: 1 } });
if (!user) throw new Error('failed-to-load-own-data');
await VideoConfService.create({ type, rid, createdBy, providerName });
Defensive patterns

Strategy: validation

Validate before calling

const user = await Users.findOneById(createdBy, { projection: { _id: 1 } });
if (!user) throw new Meteor.Error('failed-to-load-own-data');

Try / catch

try {
  await VideoConfService.create(payload);
} catch (err) {
  if (err instanceof Error && err.message === 'failed-to-load-own-data') {
    // force re-auth / refresh the user record
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling create with a createdBy that is a deleted or nonexistent user id; app-driven flows whose app user was removed; tests passing arbitrary user ids without seeding Users.

Common situations: User deactivated/deleted between client load and call start; imported data referencing dropped user ids; passing a client-supplied user id instead of the authenticated one.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@e4b8178b20 (2026-08-18). Data as JSON: /api/errors/58af5a345b782ce9. Report an issue: GitHub.