{"record":{"id":"cd8c0ae690c5f783","repo":"RocketChat/Rocket.Chat","slug":"error-importer-not-defined","errorCode":"error-importer-not-defined","errorMessage":"The Pending File Importer was not found.","messagePattern":"The Pending File Importer was not found\\.","errorType":"exception","errorClass":"Meteor.Error","httpStatus":400,"severity":"error","filePath":"apps/meteor/server/api/v1/import.ts","lineNumber":217,"sourceCode":");\n\nAPI.v1.post(\n\t'downloadPendingFiles',\n\t{\n\t\tauthRequired: true,\n\t\tpermissionsRequired: ['run-import'],\n\t\tbody: isDownloadPendingFilesParamsPOST,\n\t\tresponse: {\n\t\t\t200: countResponseSchema,\n\t\t\t400: validateBadRequestErrorResponse,\n\t\t\t401: validateUnauthorizedErrorResponse,\n\t\t\t403: validateForbiddenErrorResponse,\n\t\t},\n\t},\n\tasync function action() {\n\t\tconst importer = Importers.get('pending-files');\n\t\tif (!importer) {\n\t\t\tthrow new Meteor.Error('error-importer-not-defined', 'The Pending File Importer was not found.', 'downloadPendingFiles');\n\t\t}\n\n\t\tconst operation = await Import.newOperation(this.userId, importer.name, importer.key);\n\t\tconst instance = new PendingFileImporter(importer, operation);\n\t\tconst count = await instance.prepareFileCount();\n\n\t\treturn API.v1.success({\n\t\t\tcount,\n\t\t});\n\t},\n);\n\nAPI.v1.post(\n\t'downloadPendingAvatars',\n\t{\n\t\tauthRequired: true,\n\t\tpermissionsRequired: ['run-import'],\n\t\tbody: isDownloadPendingAvatarsParamsPOST,","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/server/api/v1/import.ts#L199-L235","documentation":"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.","triggerScenarios":"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.","commonSituations":"Community edition without the importer EE module; the importer app/plugin disabled; calling the endpoint before the migration/importer feature is configured.","solutions":["Install/enable the importer plugin that registers the 'pending-files' importer.","Confirm Importers.get('pending-files') resolves at runtime before calling the endpoint.","Use the correct endpoint for your installed importer rather than the pending-files one."],"exampleFix":"// before\nPOST /api/v1/import.downloadPendingFiles // importer not registered\n\n// after: ensure the importer plugin is loaded, then\nif (Importers.get('pending-files')) {\n  await POST /api/v1/import.downloadPendingFiles;\n}","handlingStrategy":"try-catch","validationCode":"// Detect importer availability before calling the endpoint\nconst importers = (await api.get('/api/v1/importers.list')).data.importers || [];\nif (!importers.some(i => i.key === 'pending-files')) {\n  throw new Error('pending-files importer is not registered on this server');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await api.post('/api/v1/import.downloadPendingFiles');\n} catch (e) {\n  if (e.response?.data?.error === 'error-importer-not-defined') {\n    // install/enable the importer plugin, then retry; otherwise disable this flow\n  } else throw e;\n}","preventionTips":["Confirm the importer EE plugin is installed and loaded before runtime.","Gate the import flow behind an importers.list capability check.","Do not call pending-files endpoints on CE builds lacking the plugin."],"tags":["importer","config","ee","api"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}