{"record":{"id":"76c9c8799708c54e","repo":"actix/actix","slug":"got-unknown-value","errorCode":null,"errorMessage":"Got unknown value: {:?}","messagePattern":"Got unknown value: (.+?)","errorType":"panic","errorClass":"panic","httpStatus":null,"severity":"error","filePath":"actix/src/registry.rs","lineNumber":303,"sourceCode":"        addr\n    }\n}\n\nimpl SystemRegistry {\n    pub(crate) fn new(system: ArbiterHandle) -> Self {\n        Self {\n            system,\n            registry: HashMap::default(),\n        }\n    }\n\n    /// Return address of the service. If service actor is not running\n    /// it get started in the system.\n    pub fn get<A: SystemService + Actor<Context = Context<A>>>(&mut self) -> Addr<A> {\n        if let Some(addr) = self.registry.get(&TypeId::of::<A>()) {\n            match addr.downcast_ref::<Addr<A>>() {\n                Some(addr) => return addr.clone(),\n                None => panic!(\"Got unknown value: {:?}\", addr),\n            }\n        }\n\n        let addr = A::start_service(&self.system);\n        self.registry\n            .insert(TypeId::of::<A>(), Box::new(addr.clone()));\n        addr\n    }\n\n    /// Check if actor is in registry, if so, return its address\n    pub fn query<A: SystemService + Actor<Context = Context<A>>>(&self) -> Option<Addr<A>> {\n        if let Some(addr) = self.registry.get(&TypeId::of::<A>()) {\n            match addr.downcast_ref::<Addr<A>>() {\n                Some(addr) => return Some(addr.clone()),\n                None => return None,\n            }\n        }\n","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/actix/actix/blob/36e5d97e41ebd16431c709365e6942db08d867d7/actix/src/registry.rs#L285-L321","documentation":"SystemRegistry::get panics when the registry holds a boxed value for this actor's TypeId that cannot be downcast to Addr<A>. Since the registry only inserts Addr<A> for type A, hitting this means internal invariant corruption — the stored entry's concrete type does not match the requested key type. It indicates a bug or unsafe manipulation of the registry.","triggerScenarios":"Calling SystemRegistry::get::<A>() when reg.registry contains an entry keyed by TypeId::of::<A>() whose downcast_ref::<Addr<A>>() returns None — only possible if a non-Addr<A> Box<dyn Any> was inserted under A's TypeId.","commonSituations":"Custom registry manipulation or unsafe code inserting foreign boxes; version mismatches where the same crate appears twice (distinct TypeIds for what looks like the same actor); memory corruption from unsafe code.","solutions":["Audit any code that inserts into the registry to ensure it only inserts Box::new(addr.clone()) of Addr<A> under TypeId::of::<A>().","Check for duplicate versions of the actix crate in your dependency tree (cargo tree -d) causing TypeId confusion.","Avoid unsafe insertion into SystemRegistry; use the public get/set API only.","If it persists, file a bug with a minimal reproduction since this should be unreachable."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":"// Check before relying on registry contents\nlet known = reg.registry.contains_key(&TypeId::of::<A>());","tryCatchPattern":"// Panic is not catchable in safe patterns; ensure only public API inserts into registry\nlet addr = SystemRegistry::get::<MyService>(); // starts or returns existing","preventionTips":["Never insert into the registry except via the public API","Avoid duplicate versions of the actix crate in your dependency tree (cargo tree -d)","Avoid unsafe code that inserts Box<dyn Any> values keyed by TypeId","Report reproducible occurrences as upstream bugs"],"tags":["actix","actor-registry","panic","downcast","invariant"],"backgroundTag":"internal-invariant-violation","analyzedSha":"36e5d97e41ebd16431c709365e6942db08d867d7","analyzedAt":"2026-09-11T16:51:51.370Z","contentChangedAt":"2026-09-11T16:51:51.370Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}