{"record":{"id":"d149fbd0ee311b94","repo":"HumanSignal/label-studio","slug":"can-t-find-action-id-in-registered-actions","errorCode":null,"errorMessage":"Can't find '{action_id}' in registered actions","messagePattern":"Can't find '(.+?)' in registered actions","errorType":"validation","errorClass":"ValidationError","httpStatus":400,"severity":"error","filePath":"label_studio/data_manager/actions/__init__.py","lineNumber":161,"sourceCode":"        name = path[0 : path.find('.py')]  # get only module name to read *.py and *.pyc\n        try:\n            module = import_module(f'{base_module}.{name}')\n            if not hasattr(module, 'actions'):\n                continue\n            module_actions = module.actions\n        except ModuleNotFoundError as e:\n            logger.info(e)\n            continue\n\n        for action in module_actions:\n            register_action(**action)\n            logger.debug('Action registered: ' + str(action['entry_point'].__name__))\n\n\ndef perform_action(action_id, project, queryset, user, **kwargs):\n    \"\"\"Perform action using entry point from actions\"\"\"\n    if action_id not in settings.DATA_MANAGER_ACTIONS:\n        raise ValidationError(\"Can't find '\" + action_id + \"' in registered actions\")\n\n    action = settings.DATA_MANAGER_ACTIONS[action_id]\n    check_permission = load_func(settings.DATA_MANAGER_CHECK_ACTION_PERMISSION)\n\n    # check user permissions for this action\n    if not check_permission(user, action, project):\n        raise PermissionDenied(f'Action is not allowed for the current user: {action[\"id\"]}')\n\n    try:\n        result = action['entry_point'](project, queryset, **kwargs)\n    except Exception as e:\n        text = 'Error while perform action: ' + action_id + '\\n' + tb.format_exc()\n        logger.error(text, extra={'sentry_skip': True})\n        raise e\n\n    return result\n\n","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/data_manager/actions/__init__.py#L143-L179","documentation":"The Data Manager performs actions (e.g. delete tasks, predictions) by looking up action_id in settings.DATA_MANAGER_ACTIONS. If the requested id is not among the registered actions, perform_action raises this ValidationError naming the unknown id. It guards against typo'd or unavailable action identifiers.","triggerScenarios":"POSTing to the Data Manager action endpoint with an action id string that is not registered — typos, actions from a different Label Studio version, or actions removed/renamed in configuration.","commonSituations":"Custom actions defined in a settings file that was not loaded (so DATA_MANAGER_ACTIONS lacks them); frontend/API version mismatch; renaming an action id in a fork without updating callers.","solutions":["Check the exact action id against settings.DATA_MANAGER_KEYS / registered actions (e.g. 'delete_tasks', 'predictions_to_none')","Register the custom action in DATA_MANAGER_ACTIONS or ensure the module registering it is imported at startup","Upgrade/downgrade client code so it uses action ids supported by the running server version"],"exampleFix":"// before\nPOST /api/dm/actions?id=delete_all_tasks&project=1\n// after\nPOST /api/dm/actions?id=delete_tasks&project=1","handlingStrategy":"try-catch","validationCode":"import requests\nactions = requests.get(f'{HOST}/api/dm/actions?project={project_id}', headers=headers).json()\nknown_ids = {a['id'] for a in actions}\nassert action_id in known_ids, f'{action_id} not registered on this server'","typeGuard":"def is_registered_action(action_id, available_actions):\n    return isinstance(action_id, str) and action_id in {a['id'] for a in available_actions}","tryCatchPattern":"try:\n    perform_action(action_id)\nexcept ValidationError as e:\n    if \"in registered actions\" in str(e):\n        logger.error(f'Unknown action {action_id}; check server version / settings.DATA_MANAGER_ACTIONS')\n    else:\n        raise","preventionTips":["Discover available action ids via the API instead of hardcoding","Keep client action ids in sync with the server Label Studio version","Ensure custom action registration modules are imported at startup"],"tags":["validation","data-manager","actions","label-studio"],"backgroundTag":"unknown-identifier","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}