ruvnet/ruflo · error · Error

Fleet ${fleetId} not found

Error message

Fleet ${fleetId} not found

What it means

The central fleet lookup: getFleet throws when repo.findById returns null, and most fleet operations (updateFirmwarePolicy, getFleetDeviceCount, ...) delegate to it, so essentially any reference to an unknown fleetId surfaces here.

Source

Thrown at v3/@claude-flow/plugin-iot-cognitum/src/domain/services/fleet-topology-service.ts:81

      name: options.name,
      description: options.description ?? '',
      zoneId: options.zoneId,
      deviceIds: [],
      topology: options.topology ?? 'star',
      firmwarePolicy: { ...DEFAULT_FIRMWARE_POLICY, ...options.firmwarePolicy },
      telemetryPolicy: { ...DEFAULT_TELEMETRY_POLICY, ...options.telemetryPolicy },
      healthThresholds: { ...DEFAULT_HEALTH_THRESHOLDS, ...options.healthThresholds },
      createdAt: new Date(),
      updatedAt: new Date(),
    };

    await this.repo.save(fleet);
    return fleet;
  }

  async getFleet(fleetId: string): Promise<DeviceFleet> {
    const fleet = await this.repo.findById(fleetId);
    if (!fleet) throw new Error(`Fleet ${fleetId} not found`);
    return fleet;
  }

  async listFleets(): Promise<FleetSummary[]> {
    const fleets = await this.repo.findAll();
    return fleets.map((f) => ({
      fleetId: f.fleetId,
      name: f.name,
      zoneId: f.zoneId,
      deviceCount: f.deviceIds.length,
      topology: f.topology,
      createdAt: f.createdAt,
    }));
  }

  async addDeviceToFleet(fleetId: string, deviceId: string): Promise<DeviceFleet> {
    const fleet = await this.getFleet(fleetId);
    if (fleet.deviceIds.includes(deviceId)) {

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Confirm the ID via listFleets and use the exact fleetId returned
  2. Create the fleet first if it should exist
  3. Check for concurrent deletion or a repo-backend mismatch (in-memory vs persisted) between processes

Example fix

// before
await fleetService.updateFirmwarePolicy('flt-99', { channel: 'stable' }); // unknown ID

// after
const fleets = await fleetService.listFleets();
const fleet = fleets.find((f) => f.name === 'Factory Floor');
if (!fleet) throw new Error('fleet missing; create it first');
await fleetService.updateFirmwarePolicy(fleet.fleetId, { channel: 'stable' });
Defensive patterns

Strategy: validation

Validate before calling

const ids = new Set((await fleetService.listFleets()).map((f) => f.fleetId));
if (!ids.has(fleetId)) {
  throw new Error(`unknown fleet ${fleetId}; known: ${[...ids].join(', ')}`);
}
await fleetService.updateFirmwarePolicy(fleetId, policy);

Try / catch

try {
  await fleetService.updateFirmwarePolicy(fleetId, policy);
} catch (e) {
  if (e instanceof Error && e.message === `Fleet ${fleetId} not found`) {
    // re-list fleets; create the fleet or prompt for the correct ID
  } else throw e;
}

Prevention

When it happens

Trigger: Calling getFleet, updateFirmwarePolicy, or getFleetDeviceCount with a fleetId that was never created, was deleted, or lives in a different repository or persistence scope.

Common situations: Stale fleet IDs after an environment reset or store wipe; hand-typed IDs with typos; fleets created in an in-memory repo during tests while the caller reads a persisted repo.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/3aa7af0603c3727f. Report an issue: GitHub.