{"record":{"id":"8bfe592cc86732da","repo":"HumanSignal/label-studio","slug":"transition-name-unknown-transition-for-this-entit","errorCode":null,"errorMessage":"transition_name: Unknown transition for this entity","messagePattern":"transition_name: Unknown transition for this entity","errorType":"validation","errorClass":"ValidationError","httpStatus":400,"severity":"error","filePath":"label_studio/fsm/api.py","lineNumber":163,"sourceCode":"        'project': all_permissions.projects_change,\n    }\n\n    def post(self, request, *args, **kwargs):\n        entity_name = kwargs['entity_name']\n        if entity_name not in state_model_registry.get_all_models():\n            raise NotFound()\n\n        entity = self.get_entity()\n\n        serializer = self.get_serializer(data=request.data)\n        serializer.is_valid(raise_exception=True)\n        transition_name = serializer.validated_data['transition_name']\n        transition_data = serializer.validated_data.get('transition_data') or {}\n\n        # Validate that transition is registered and manual (not auto-triggered)\n        transition_class = transition_registry.get_transition(entity_name, transition_name)\n        if not transition_class:\n            raise ValidationError({'transition_name': ['Unknown transition for this entity']})\n\n        # If it's a ModelChangeTransition and has any triggers configured, it's not manual\n        if issubclass(transition_class, ModelChangeTransition):\n            triggers_on_create = getattr(transition_class, '_triggers_on_create', False)\n            triggers_on_update = getattr(transition_class, '_triggers_on_update', False)\n            if triggers_on_create or triggers_on_update:\n                raise ValidationError(\n                    {'transition_name': ['Transition is auto-triggered and cannot be executed manually']}\n                )\n\n        # Execute transition\n        StateManager = get_state_manager()\n        try:\n            state_record = StateManager.execute_transition(\n                entity=entity,\n                transition_name=transition_name,\n                transition_data=transition_data,\n                user=request.user,","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/fsm/api.py#L145-L181","documentation":"The FSM transition POST endpoint validates the transition after resolving the entity: transition_registry.get_transition(entity_name, transition_name) must return a registered, manually-invokable transition class. If it is unknown (or, for ModelChangeTransition subclasses, configured with auto-triggers so it is not manual), DRF ValidationError({'transition_name': ['Unknown transition for this entity']}) is raised, producing HTTP 400.","triggerScenarios":"POST transition with a transition_name that is not registered for the entity, a typo, a transition registered for a different entity, or an auto-triggered ModelChangeTransition (has _triggers_on_create/_triggers_on_update) being invoked manually.","commonSituations":"Frontend dropdowns out of sync with backend transition registrations; transitions registered under a different entity_name than requested; attempting to manually fire transitions that are meant to fire automatically on model create/update; version skew between services deploying new transition names.","solutions":["Use a transition_name that is registered for that exact entity — verify via transition_registry.get_transition(entity_name, name) or the API schema.","Register the missing transition for the entity (and ensure it is manual, without auto-trigger flags if invoked via API).","If the transition is auto-triggered, do not call it manually — let the model create/update trigger fire it.","Fix typos/incorrect entity pairing in the client payload.","Catch DRF ValidationError (400) client-side and list valid transitions for the user."],"exampleFix":"// before\nPOST /api/fsm/task/42/transition {\"transition_name\": \"complete_task\"}  // not registered\n// after\nPOST /api/fsm/task/42/transition {\"transition_name\": \"mark_completed\"}  // registered manual transition","handlingStrategy":"validation","validationCode":"def transition_is_manual(entity_name: str, transition_name: str, registry) -> bool:\n    from label_studio.fsm.state import ModelChangeTransition\n    tc = registry.get_transition(entity_name, transition_name)\n    if not tc:\n        return False\n    if issubclass(tc, ModelChangeTransition):\n        return not (getattr(tc, '_triggers_on_create', False) or getattr(tc, '_triggers_on_update', False))\n    return True","typeGuard":null,"tryCatchPattern":"from rest_framework.exceptions import ValidationError\ntry:\n    fire_transition(entity_name, entity_id, transition_name)\nexcept ValidationError as e:\n    if 'transition_name' in e.detail:\n        valid = list_valid_transitions(entity_name)\n        raise ValueError(f'{transition_name} invalid; valid: {valid}') from e\n    raise","preventionTips":["Keep the client's transition dropdown generated from the backend registry","Never manually POST auto-triggered ModelChangeTransitions","Verify transition registration for the exact entity_name, not just the name","Integration-test each manual transition endpoint after registration changes"],"tags":["django","fsm","validation","api"],"backgroundTag":"schema-validation-failed","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}