RocketChat/Rocket.Chat · error · Meteor.Error

error-importer-not-defined

error-importer-not-defined

Error message

The Pending File Importer was not found.

What it means

The downloadPendingFiles endpoint calls Importers.get('pending-files'); if no importer is registered under that key it throws error-importer-not-defined with detail 'downloadPendingFiles'. The 'pending-files' importer is registered by an EE/importer plugin, so on deployments without that plugin it is absent.

Source

Thrown at apps/meteor/server/api/v1/import.ts:217

);

API.v1.post(
	'downloadPendingFiles',
	{
		authRequired: true,
		permissionsRequired: ['run-import'],
		body: isDownloadPendingFilesParamsPOST,
		response: {
			200: countResponseSchema,
			400: validateBadRequestErrorResponse,
			401: validateUnauthorizedErrorResponse,
			403: validateForbiddenErrorResponse,
		},
	},
	async function action() {
		const importer = Importers.get('pending-files');
		if (!importer) {
			throw new Meteor.Error('error-importer-not-defined', 'The Pending File Importer was not found.', 'downloadPendingFiles');
		}

		const operation = await Import.newOperation(this.userId, importer.name, importer.key);
		const instance = new PendingFileImporter(importer, operation);
		const count = await instance.prepareFileCount();

		return API.v1.success({
			count,
		});
	},
);

API.v1.post(
	'downloadPendingAvatars',
	{
		authRequired: true,
		permissionsRequired: ['run-import'],
		body: isDownloadPendingAvatarsParamsPOST,

View on GitHub (pinned to f9d3ec372b)

Solutions

  1. Install/enable the importer plugin that registers the 'pending-files' importer.
  2. Confirm Importers.get('pending-files') resolves at runtime before calling the endpoint.
  3. Use the correct endpoint for your installed importer rather than the pending-files one.

Example fix

// before
POST /api/v1/import.downloadPendingFiles // importer not registered

// after: ensure the importer plugin is loaded, then
if (Importers.get('pending-files')) {
  await POST /api/v1/import.downloadPendingFiles;
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Detect importer availability before calling the endpoint
const importers = (await api.get('/api/v1/importers.list')).data.importers || [];
if (!importers.some(i => i.key === 'pending-files')) {
  throw new Error('pending-files importer is not registered on this server');
}

Try / catch

try {
  await api.post('/api/v1/import.downloadPendingFiles');
} catch (e) {
  if (e.response?.data?.error === 'error-importer-not-defined') {
    // install/enable the importer plugin, then retry; otherwise disable this flow
  } else throw e;
}

Prevention

When it happens

Trigger: POST /api/v1/import.downloadPendingFiles on a workspace where the pending-files importer package is not installed/registered, or before any importer that registers the 'pending-files' key has loaded.

Common situations: Community edition without the importer EE module; the importer app/plugin disabled; calling the endpoint before the migration/importer feature is configured.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12). Data as JSON: /api/errors/cd8c0ae690c5f783. Report an issue: GitHub.