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

  1. Confirm the device id is within 0..device_count and comes from the current registry
  2. Re-register/refresh the device list before accessing settings
  3. Check that the remote service successfully registered the device on connect
  4. 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

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


AI-assisted analysis of tracel-ai/burn@d16f7ba2ed (2026-09-05). Data as JSON: /api/errors/f9e4df952a67a1cd. Report an issue: GitHub.