{"record":{"id":"90579de23ddc42f2","repo":"nautechsystems/nautilus_trader","slug":"invalid-exec-algorithm-id-actor-id-type-90579d","errorCode":null,"errorMessage":"Invalid `exec_algorithm_id`/`actor_id` type","messagePattern":"Invalid `exec_algorithm_id`/`actor_id` type","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/live/src/python/node.rs","lineNumber":1576,"sourceCode":"                    .map_err(|e| anyhow::anyhow!(\"Failed to extract PyDataActor: {e}\"))?;\n\n                // Extract ID from config: prefer exec_algorithm_id, fall back to actor_id\n                if let Some(config_obj) = config_instance.as_ref() {\n                    let id_attr = config_obj\n                        .getattr(\"exec_algorithm_id\")\n                        .ok()\n                        .filter(|v| !v.is_none())\n                        .or_else(|| config_obj.getattr(\"actor_id\").ok().filter(|v| !v.is_none()));\n\n                    if let Some(id_value) = id_attr {\n                        let actor_id_val = if let Ok(eaid) = id_value.extract::<ExecAlgorithmId>() {\n                            ActorId::new(eaid.inner())\n                        } else if let Ok(aid) = id_value.extract::<ActorId>() {\n                            aid\n                        } else if let Ok(aid_str) = id_value.extract::<String>() {\n                            ActorId::new_checked(&aid_str)?\n                        } else {\n                            anyhow::bail!(\"Invalid `exec_algorithm_id`/`actor_id` type\");\n                        };\n                        py_data_actor_ref.set_actor_id(actor_id_val);\n                    }\n\n                    if let Some(val) = extract_bool_config_attr(config_obj, \"log_events\") {\n                        py_data_actor_ref.set_log_events(val);\n                    }\n\n                    if let Some(val) = extract_bool_config_attr(config_obj, \"log_commands\") {\n                        py_data_actor_ref.set_log_commands(val);\n                    }\n                }\n\n                py_data_actor_ref.set_python_instance(&python_exec_algorithm)?;\n\n                let actor_id = py_data_actor_ref.actor_id();\n\n                Ok((python_exec_algorithm.unbind(), None, actor_id))","sourceCodeStart":1558,"sourceCodeEnd":1594,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/live/src/python/node.rs#L1558-L1594","documentation":"When wiring a Python data actor reference, the `exec_algorithm_id`/`actor_id` config value must be extractable as an `ActorId`, a Py `ActorId`, or a string parseable by `ActorId::new_checked`. If none succeeds, the code bails with this message. It is a type/format validation of the identifier supplied in the actor's config.","triggerScenarios":"Passing an `actor_id`/`exec_algorithm_id` in the actor config that is neither an ActorId instance nor a valid Uuid/identifier string — e.g. an int, None, dict, or a malformed string.","commonSituations":"Typos in config dicts, passing the actor object itself instead of its id, or a string with wrong format (not a valid Nautilus identifier).","solutions":["Pass the id as a string in the format `ActorId::new_checked` accepts (e.g. a valid 'NAME-001' style identifier or UUID).","Pass a nautilus_trader `ActorId` instance instead of an arbitrary object.","Log/inspect the actual type of the config value being passed.","Construct the id via `ActorId(value)` in Python and pass that object."],"exampleFix":"// before\nconfig = {\"actor_id\": 12345}\n// after\nconfig = {\"actor_id\": \"MyActor-001\"}","handlingStrategy":"validation","validationCode":"def valid_actor_id(v):\n    from nautilus_trader.model.identifiers import ActorId\n    if isinstance(v, ActorId):\n        return True\n    if isinstance(v, str) and v:\n        try:\n            ActorId(v)\n            return True\n        except Exception:\n            return False\n    return False\n\nassert valid_actor_id(config[\"actor_id\"]), \"actor_id must be ActorId or valid id string\"","typeGuard":"def is_actor_id(v) -> bool:\n    from nautilus_trader.model.identifiers import ActorId\n    return isinstance(v, (ActorId, str)) and bool(v)","tryCatchPattern":"try:\n    node.add_data_actor(...)\nexcept Exception as e:\n    if \"Invalid `exec_algorithm_id`/`actor_id` type\" in str(e):\n        print(\"fix actor_id: pass ActorId(...) or a valid identifier string\")\n    raise","preventionTips":["Always construct actor ids with ActorId(...) instead of raw values.","Never pass ints, None, or actor objects as actor_id.","Validate config dicts against expected key types before wiring actors."],"tags":["type-mismatch","actor-id","python","config"],"backgroundTag":"invalid-argument-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}