tracel-ai/burn · error
Device id not registered
Error message
Device id not registered
What it means
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.
Source
Thrown at crates/burn-remote/src/client/service/registry.rs:121
.expect("Remote service has not connected to this device yet")
}
pub(crate) fn has_settings(id: u32) -> bool {
registry()
.lock()
.unwrap()
.by_index
.get(&id)
.is_some_and(|entry| entry.settings.get().is_some())
}
pub(crate) fn settings_cell(id: u32) -> Arc<OnceLock<DeviceSettings>> {
registry()
.lock()
.unwrap()
.by_index
.get(&id)
.expect("Device id not registered")
.settings
.clone()
}
pub(crate) fn device_count_cell(id: u32) -> Arc<OnceLock<u32>> {
registry()
.lock()
.unwrap()
.by_index
.get(&id)
.expect("Device id not registered")
.device_count
.clone()
}
pub(crate) fn device_count_for(id: u32) -> Option<u32> {
registry()
.lock()View on GitHub (pinned to d16f7ba2ed)
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
Example fix
// before
let cell = settings_cell(id); // panics if unregistered
// after
assert!(has_settings(id), "device {id} not registered");
let cell = settings_cell(id); Defensive patterns
Strategy: validation
Validate before calling
let registered = registry::has_settings(id) || id < registry::device_count();
if !registered {
return Err(anyhow!("device id {id} is not registered"));
} Try / catch
let cell = std::panic::catch_unwind(|| registry::settings_cell(id))
.map_err(|_| anyhow!("device id {id} not registered"))?; Prevention
- Derive device ids from the registry, never hardcode them
- Refresh the device list after every reconnection
- Use Option-returning accessors where available
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Can't register manually a tensor on a remote channel.
- Invalid response type for ReadTensor
- Service call failed
- Service call failed
- Remote service has not connected to this device yet
AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05).
Data as JSON: /api/errors/f9e4df952a67a1cd.
Report an issue: GitHub.