RocketChat/Rocket.Chat · error · Meteor.Error

error-operation-not-found

error-operation-not-found

Error message

Import Operation Not Found

What it means

getImportProgress starts with `Imports.findLastImport()`; when no import operation document exists at all, it throws error-operation-not-found. In other words, no import has ever been started (or the last one was removed) on this workspace, so there is no progress to report.

Source

Thrown at apps/meteor/server/meteor-methods/import/getImportProgress.ts:13

import type { IImportProgress } from '@rocket.chat/core-typings';
import type { ServerMethods } from '@rocket.chat/ddp-client';
import { Imports } from '@rocket.chat/models';
import { Meteor } from 'meteor/meteor';

import { hasPermissionAsync } from '../../lib/authorization/hasPermission';
import { methodDeprecationLogger } from '../../lib/deprecationWarningLogger';
import { Importers } from '../../lib/import';

export const executeGetImportProgress = async (): Promise<IImportProgress> => {
	const operation = await Imports.findLastImport();
	if (!operation) {
		throw new Meteor.Error('error-operation-not-found', 'Import Operation Not Found', 'getImportProgress');
	}

	const { importerKey } = operation;
	const importer = Importers.get(importerKey);
	if (!importer) {
		throw new Meteor.Error('error-importer-not-defined', `The importer (${importerKey}) has no import class defined.`, 'getImportProgress');
	}

	const instance = new importer.importer(importer, operation); // eslint-disable-line new-cap

	return instance.getProgress();
};

declare module '@rocket.chat/ddp-client' {
	// eslint-disable-next-line @typescript-eslint/naming-convention
	interface ServerMethods {
		getImportProgress(): IImportProgress;
	}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Start an import first: `Meteor.call('uploadImportFile', binaryContent, contentType, fileName, 'csv')` (requires login + run-import)
  2. Or check state first via `Meteor.call('getLatestImportOperations')` (needs view-import-operations) and only poll progress when a non-empty list returns
  3. Treat this error as 'no import yet' in polling loops: stop polling instead of retrying

Example fix

// before
Meteor.call('getImportProgress', cb); // error-operation-not-found on fresh workspace

// after — only poll once an operation exists
Meteor.call('getLatestImportOperations', (e, ops) => {
  if (ops?.length) Meteor.call('getImportProgress', cb);
});
Defensive patterns

Strategy: validation

Validate before calling

// Confirm an operation exists before polling progress
Meteor.call('getLatestImportOperations', (e, ops) => {
  if (e || !ops?.length) {
    // no import yet — run uploadImportFile first instead of calling getImportProgress
  }
});

Try / catch

try {
  const progress = await meteorCall('getImportProgress');
} catch (e) {
  if (e instanceof Meteor.Error && e.error === 'error-operation-not-found') {
    // no import started: begin the upload flow, stop polling
  }
}

Prevention

When it happens

Trigger: Calling `Meteor.call('getImportProgress')` (or POST /v1/getImportProgress) before any uploadImportFile / import setup has created a record in the `imports` collection; also when the imports collection was cleared.

Common situations: Import UIs that poll progress as soon as the page opens instead of after starting an import; fresh installs; automated flows that skip the upload step; polling after the operation document was deleted.

Related errors


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