{"record":{"id":"f9e4df952a67a1cd","repo":"tracel-ai/burn","slug":"device-id-not-registered","errorCode":null,"errorMessage":"Device id not registered","messagePattern":"Device id not registered","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-remote/src/client/service/registry.rs","lineNumber":121,"sourceCode":"        .expect(\"Remote service has not connected to this device yet\")\n}\n\npub(crate) fn has_settings(id: u32) -> bool {\n    registry()\n        .lock()\n        .unwrap()\n        .by_index\n        .get(&id)\n        .is_some_and(|entry| entry.settings.get().is_some())\n}\n\npub(crate) fn settings_cell(id: u32) -> Arc<OnceLock<DeviceSettings>> {\n    registry()\n        .lock()\n        .unwrap()\n        .by_index\n        .get(&id)\n        .expect(\"Device id not registered\")\n        .settings\n        .clone()\n}\n\npub(crate) fn device_count_cell(id: u32) -> Arc<OnceLock<u32>> {\n    registry()\n        .lock()\n        .unwrap()\n        .by_index\n        .get(&id)\n        .expect(\"Device id not registered\")\n        .device_count\n        .clone()\n}\n\npub(crate) fn device_count_for(id: u32) -> Option<u32> {\n    registry()\n        .lock()","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-remote/src/client/service/registry.rs#L103-L139","documentation":"settings_cell looks up the device id in the client-side registry map by_index and expects it to exist. This panic means the requested device id was never registered in the burn-remote client registry.","triggerScenarios":"Calling settings_cell(id) (via settings_for or other registry accessors) with an id absent from by_index, typically because the device was never registered or a stale/invalid id is used.","commonSituations":"Using a device id from a previous session after registry reset; hardcoded ids that don't match the server's device list; race where registry was cleared.","solutions":["Confirm the device id is within 0..device_count and comes from the current registry","Re-register/refresh the device list before accessing settings","Check that the remote service successfully registered the device on connect","Guard with has_settings(id) before calling settings_for/settings_cell"],"exampleFix":"// before\nlet cell = settings_cell(id); // panics if unregistered\n// after\nassert!(has_settings(id), \"device {id} not registered\");\nlet cell = settings_cell(id);","handlingStrategy":"validation","validationCode":"let registered = registry::has_settings(id) || id < registry::device_count();\nif !registered {\n    return Err(anyhow!(\"device id {id} is not registered\"));\n}","typeGuard":null,"tryCatchPattern":"let cell = std::panic::catch_unwind(|| registry::settings_cell(id))\n    .map_err(|_| anyhow!(\"device id {id} not registered\"))?;","preventionTips":["Derive device ids from the registry, never hardcode them","Refresh the device list after every reconnection","Use Option-returning accessors where available"],"tags":["rust","remote","registry","invalid-id"],"backgroundTag":"device-id-not-registered","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}