{"record":{"id":"79d18997f58f0183","repo":"HumanSignal/label-studio","slug":"transition-transition-name-not-found-for-entit","errorCode":null,"errorMessage":"Transition '{transition_name}' not found for entity '{entity_name}'","messagePattern":"Transition '(.+?)' not found for entity '(.+?)'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"label_studio/fsm/transition_executor.py","lineNumber":55,"sourceCode":"        transition_data: Data for the transition (validated by Pydantic)\n        user: User executing the transition\n        state_manager_class: The StateManager class to use for state operations\n        **context_kwargs: Additional context data\n\n    Returns:\n        The newly created state record\n\n    Raises:\n        ValueError: If transition is not found or state model is not registered\n        TransitionValidationError: If transition validation fails\n    \"\"\"\n    entity_name = entity._meta.model_name.lower()\n    transition_data = transition_data or {}\n\n    # Get the transition class from registry\n    transition_class = transition_registry.get_transition(entity_name, transition_name)\n    if not transition_class:\n        raise ValueError(f\"Transition '{transition_name}' not found for entity '{entity_name}'\")\n\n    # Create transition instance\n    transition = transition_class(**transition_data)\n\n    # Extract organization_id from context_kwargs if provided, otherwise use entity's org_id\n    organization_id = context_kwargs.pop('organization_id', getattr(entity, 'organization_id', None))\n\n    # Create minimal context with just entity for target_state computation\n    minimal_context = TransitionContext(\n        entity=entity,\n        current_user=user,\n        current_state_object=None,\n        current_state=None,\n        target_state=None,  # Will be computed\n        organization_id=organization_id,\n    )\n\n    # Get target_state (can now use entity from context)","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/HumanSignal/label-studio/blob/0b49e9b53917880baf1dd85d574fe5541a9aafb2/label_studio/fsm/transition_executor.py#L37-L73","documentation":"execute_transition_with_state_manager looks up the transition class in transition_registry by (entity_name, transition_name). If no class is registered for that pair, it raises ValueError telling you the transition name was not found for the entity.","triggerScenarios":"Calling execute_transition(entity, 'transition_name') where transition_name is misspelled, or the transition class was never registered for that entity's model_name via transition_registry.register.","commonSituations":"Typos or case mismatches in transition names (registry keys are lowercase model names); transitions registered in a module never imported at startup; adding a new transition but forgetting registration; renaming an entity model without updating registry keys.","solutions":["Verify the transition name spelling and case matches the registered key.","Register the transition class: transition_registry.register(entity_name, transition_name, TransitionClass) at app startup.","Inspect the registry (e.g. transition_registry.get_transitions(entity_name)) to see what names exist.","Ensure the module containing registrations is imported during Django app initialization."],"exampleFix":"// before\nexecute_transition(task, 'start_annotation')  # never registered\n// after\ntransition_registry.register('task', 'start_annotation', StartAnnotationTransition)\nexecute_transition(task, 'start_annotation')","handlingStrategy":"validation","validationCode":"if transition_registry.get_transition(entity._meta.model_name.lower(), transition_name) is None:\n    raise LookupError(f\"Transition '{transition_name}' not registered for {entity._meta.model_name}\")","typeGuard":"def is_registered_transition(entity, name: str) -> bool:\n    return transition_registry.get_transition(entity._meta.model_name.lower(), name) is not None","tryCatchPattern":"try:\n    execute_transition(entity, transition_name)\nexcept ValueError as e:\n    if 'not found for entity' in str(e):\n        raise ConfigurationError(f'Check transition registry: {e}') from e\n    raise","preventionTips":["Centralize transition name constants instead of inline strings.","Import all registration modules in AppConfig.ready().","Write a registry smoke test listing all (entity, transition) pairs."],"tags":["fsm","transition","registry"],"backgroundTag":"transition-not-found","analyzedSha":"0b49e9b53917880baf1dd85d574fe5541a9aafb2","analyzedAt":"2026-08-29T00:39:52.578Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}