{"record":{"id":"cf4f5482fa20348f","repo":"RocketChat/Rocket.Chat","slug":"error-action-not-allowed-cf4f54","errorCode":"error-action-not-allowed","errorMessage":"Importing is not allowed","messagePattern":"Importing is not allowed","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/meteor-methods/import/getImportProgress.ts","lineNumber":43,"sourceCode":"};\n\ndeclare module '@rocket.chat/ddp-client' {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tinterface ServerMethods {\n\t\tgetImportProgress(): IImportProgress;\n\t}\n}\n\nMeteor.methods<ServerMethods>({\n\tasync getImportProgress() {\n\t\tmethodDeprecationLogger.method('getImportProgress', '9.0.0', '/v1/getImportProgress');\n\t\tconst userId = Meteor.userId();\n\t\tif (!userId) {\n\t\t\tthrow new Meteor.Error('error-invalid-user', 'Invalid user', 'getImportProgress');\n\t\t}\n\n\t\tif (!(await hasPermissionAsync(userId, 'run-import'))) {\n\t\t\tthrow new Meteor.Error('error-action-not-allowed', 'Importing is not allowed', 'setupImporter');\n\t\t}\n\n\t\treturn executeGetImportProgress();\n\t},\n});\n","sourceCodeStart":25,"sourceCodeEnd":49,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/meteor-methods/import/getImportProgress.ts#L25-L49","documentation":"getImportProgress enforces `hasPermissionAsync(userId, 'run-import')`; users without it get error-action-not-allowed. The permission is admin-only on default installs. Note the error metadata string in the source says 'setupImporter' (a copy-paste artifact), but the failure is genuinely the run-import check in getImportProgress.","triggerScenarios":"A logged-in user whose roles lack `run-import` calls `Meteor.call('getImportProgress')`. The error's third argument reports 'setupImporter' instead of 'getImportProgress', which can mislead log searches.","commonSituations":"Non-admin roles used for import monitoring; searching logs for the wrong method name because of the metadata quirk; assuming view-import-operations suffices for progress polling (it does not — this method wants run-import).","solutions":["Grant `run-import` to the caller's role, or call as admin","When triaging logs, search for 'Importing is not allowed' rather than trusting the 'setupImporter' metadata in this method","If the caller only needs to view operations, use getLatestImportOperations (view-import-operations) instead"],"exampleFix":"// before\nMeteor.call('getImportProgress', cb); // error-action-not-allowed for non-admin\n\n// after\nconst canImport = usePermission('run-import');\nif (canImport) Meteor.call('getImportProgress', cb);\n// read-only viewers use: Meteor.call('getLatestImportOperations', cb);","handlingStrategy":"validation","validationCode":"const canRunImport = usePermission('run-import');\nif (canRunImport) Meteor.call('getImportProgress', cb);\n// read-only users: use getLatestImportOperations (view-import-operations) instead","typeGuard":null,"tryCatchPattern":"Meteor.call('getImportProgress', (err, p) => {\n  if (err && (err as Meteor.Error).error === 'error-action-not-allowed') {\n    // note: this method's error metadata says 'setupImporter' — search by message, not method name\n  }\n});","preventionTips":["Remember this method needs run-import, not view-import-operations","When grepping logs, match on 'Importing is not allowed' — the method metadata is 'setupImporter' due to a copy-paste quirk","Gate progress UI on run-import"],"tags":["rocket-chat","permissions","import","meteor-methods"],"backgroundTag":"insufficient-permissions","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}