{"record":{"id":"e9eccd65860c959a","repo":"nautechsystems/nautilus_trader","slug":"dataactor-actor-id-registration-incomplete-val","errorCode":null,"errorMessage":"DataActor {actor_id} registration incomplete - validation failed","messagePattern":"DataActor (.+?) registration incomplete - validation failed","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/common/src/actor/data_actor.rs","lineNumber":4151,"sourceCode":"        }\n\n        // Validate clock by attempting to access it\n        {\n            let _timestamp = clock.borrow().timestamp_ns();\n        }\n\n        // Validate cache by attempting to access it\n        {\n            let _cache_borrow = cache.borrow();\n        }\n\n        self.trader_id = Some(trader_id);\n        self.clock = Some(clock);\n        self.cache = Some(cache);\n\n        // Verify complete registration\n        if !self.is_properly_registered() {\n            anyhow::bail!(\n                \"DataActor {} registration incomplete - validation failed\",\n                self.actor_id\n            );\n        }\n\n        log::debug!(\"Registered {} with trader {trader_id}\", self.actor_id);\n        Ok(())\n    }\n\n    /// Register an event type for warning log levels.\n    pub fn register_warning_event(&mut self, event_type: &str) {\n        self.warning_events.insert(event_type.to_string());\n        log::debug!(\"Registered event type '{event_type}' for warning logs\");\n    }\n\n    /// Deregister an event type from warning log levels.\n    pub fn deregister_warning_event(&mut self, event_type: &str) {\n        self.warning_events.remove(event_type);","sourceCodeStart":4133,"sourceCodeEnd":4169,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/common/src/actor/data_actor.rs#L4133-L4169","documentation":"After `register` writes trader_id, clock, and cache fields, it calls `is_properly_registered()` as an invariant check. If any of the three fields is still unset (or the check fails), registration is deemed incomplete and the actor bails rather than operating with a half-initialized state.","triggerScenarios":"A registration call where validation passed but post-assignment state does not satisfy `is_properly_registered()` — e.g. an internal path clearing one of trader_id/clock/cache, or a subclass overriding registration bookkeeping incorrectly.","commonSituations":"Custom actor subclasses that override or interfere with registration fields; partial registration followed by a retry where state was cleared; an internal bug where clock/cache references were dropped before verification.","solutions":["Inspect `is_properly_registered()` and ensure trader_id, clock, and cache are all set before the check","Use the standard `register` entry point rather than setting fields manually","Check custom subclasses for overrides that clear or skip the clock/cache fields"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"debug_assert!(trader_id_set && clock_set && cache_set, \"all registration inputs required\");","typeGuard":null,"tryCatchPattern":"actor.register(trader_id, clock, cache).map_err(|e| {\n    eprintln!(\"registration incomplete: {e}; check is_properly_registered conditions\");\n    e\n})?;","preventionTips":["Use the standard register entry point; never set trader_id/clock/cache manually","Avoid subclass overrides that clear registration fields","Keep clock and cache Rc handles alive for the actor's lifetime"],"tags":["actor","registration","invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}