ruvnet/ruflo · error · Error

No vectors to ingest. Pass --vector "[..]" or pipe a JSON ar

Error message

No vectors to ingest. Pass --vector "[..]" or pipe a JSON array on stdin.

What it means

The iot ingest command gathers vectors from the --vector flag and/or a JSON array piped on stdin; if after consulting both sources the list is empty it refuses to call the coordinator. A syntactically valid but empty array on stdin ([]) also lands here, as does a non-array stdin payload that leaves the vectors list untouched.

Source

Thrown at v3/@claude-flow/plugin-iot-cognitum/src/cli-commands.ts:206

          const meta = metaRaw ? (JSON.parse(metaRaw) as Record<string, unknown>) : undefined;
          vectors = [{ values: v, ...(meta ? { metadata: meta } : {}) }];
        } else if (!process.stdin.isTTY) {
          // Stdin path: expect a JSON array of {values, metadata?} or raw number[][]
          const chunks: Buffer[] = [];
          for await (const chunk of process.stdin) chunks.push(chunk as Buffer);
          const text = Buffer.concat(chunks).toString('utf8').trim();
          if (text) {
            const parsed = JSON.parse(text) as unknown;
            if (Array.isArray(parsed)) {
              vectors = (parsed as unknown[]).map((entry) => {
                if (Array.isArray(entry)) return { values: entry as number[] };
                return entry as { values: number[]; metadata?: Record<string, unknown> };
              });
            }
          }
        }
        if (vectors.length === 0) {
          throw new Error('No vectors to ingest. Pass --vector "[..]" or pipe a JSON array on stdin.');
        }
        const result = await coordinator.ingestDeviceTelemetry(args['device-id'] as string, vectors);
        console.log(`Ingested ${result.ingested} vector(s) for device ${result.deviceId}`);
      },
    },
    {
      name: 'iot mesh',
      description: 'Show mesh network topology for a device',
      arguments: [{ name: 'device-id', description: 'Device identifier', required: true }],
      handler: async (args) => {
        const coordinator = requireCoordinator(getCoordinator);
        const topology = await coordinator.getDeviceMeshTopology(args._[0]!);
        console.log(`Device:      ${topology.deviceId}`);
        console.log(`AP Active:   ${topology.apActive}`);
        console.log(`Auto Mesh:   ${topology.autoMesh}`);
        console.log(`Cluster:     ${topology.clusterEnabled}`);
        console.log(`Peers:       ${topology.peerCount}`);
        if (topology.peers.length > 0) {

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Pass --vector '[...]' or pipe a non-empty JSON array on stdin: echo '[[0.1,0.2],[0.2,0.3]]' | iot ingest --device-id ...
  2. Check that the upstream producer actually emitted data before invoking the command
  3. Verify the flag spelling is exactly --vector

Example fix

# before
$ iot ingest --device-id seed-42 < /dev/null
# Error: No vectors to ingest.

# after
$ echo '[[0.1,0.2],[0.2,0.3]]' | iot ingest --device-id seed-42
Defensive patterns

Strategy: validation

Validate before calling

const payload = produceVectors(); // unknown[]
if (!Array.isArray(payload) || payload.length === 0) {
  throw new Error('upstream produced no vectors; skipping iot ingest');
}
spawnSync('iot', ['ingest', '--device-id', deviceId], { input: JSON.stringify(payload) });

Try / catch

try {
  await runIngest(stdinPayload);
} catch (e) {
  if (e instanceof Error && e.message.startsWith('No vectors to ingest')) {
    // log which source (flag/stdin) was empty and skip; do not retry with the same empty input
  } else throw e;
}

Prevention

When it happens

Trigger: Running iot ingest with no --vector and an empty or closed stdin; piping whitespace or '[]'; a typo'd flag name (e.g. --vectors) so no flag matched while stdin was empty.

Common situations: Cron/CI jobs whose stdin is not wired to the producer; an upstream pipeline emitting an empty batch; interactive use where the user supplied neither input channel.

Related errors


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