{"record":{"id":"1f3459a3a0b2380d","repo":"ruvnet/ruflo","slug":"no-vectors-to-ingest-pass-vector-or-pipe","errorCode":null,"errorMessage":"No vectors to ingest. Pass --vector \"[..]\" or pipe a JSON array on stdin.","messagePattern":"No vectors to ingest\\. Pass --vector \"\\[\\.\\.\\]\" or pipe a JSON array on stdin\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugin-iot-cognitum/src/cli-commands.ts","lineNumber":206,"sourceCode":"          const meta = metaRaw ? (JSON.parse(metaRaw) as Record<string, unknown>) : undefined;\n          vectors = [{ values: v, ...(meta ? { metadata: meta } : {}) }];\n        } else if (!process.stdin.isTTY) {\n          // Stdin path: expect a JSON array of {values, metadata?} or raw number[][]\n          const chunks: Buffer[] = [];\n          for await (const chunk of process.stdin) chunks.push(chunk as Buffer);\n          const text = Buffer.concat(chunks).toString('utf8').trim();\n          if (text) {\n            const parsed = JSON.parse(text) as unknown;\n            if (Array.isArray(parsed)) {\n              vectors = (parsed as unknown[]).map((entry) => {\n                if (Array.isArray(entry)) return { values: entry as number[] };\n                return entry as { values: number[]; metadata?: Record<string, unknown> };\n              });\n            }\n          }\n        }\n        if (vectors.length === 0) {\n          throw new Error('No vectors to ingest. Pass --vector \"[..]\" or pipe a JSON array on stdin.');\n        }\n        const result = await coordinator.ingestDeviceTelemetry(args['device-id'] as string, vectors);\n        console.log(`Ingested ${result.ingested} vector(s) for device ${result.deviceId}`);\n      },\n    },\n    {\n      name: 'iot mesh',\n      description: 'Show mesh network topology for a device',\n      arguments: [{ name: 'device-id', description: 'Device identifier', required: true }],\n      handler: async (args) => {\n        const coordinator = requireCoordinator(getCoordinator);\n        const topology = await coordinator.getDeviceMeshTopology(args._[0]!);\n        console.log(`Device:      ${topology.deviceId}`);\n        console.log(`AP Active:   ${topology.apActive}`);\n        console.log(`Auto Mesh:   ${topology.autoMesh}`);\n        console.log(`Cluster:     ${topology.clusterEnabled}`);\n        console.log(`Peers:       ${topology.peerCount}`);\n        if (topology.peers.length > 0) {","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugin-iot-cognitum/src/cli-commands.ts#L188-L224","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Pass --vector '[...]' or pipe a non-empty JSON array on stdin: echo '[[0.1,0.2],[0.2,0.3]]' | iot ingest --device-id ...","Check that the upstream producer actually emitted data before invoking the command","Verify the flag spelling is exactly --vector"],"exampleFix":"# before\n$ iot ingest --device-id seed-42 < /dev/null\n# Error: No vectors to ingest.\n\n# after\n$ echo '[[0.1,0.2],[0.2,0.3]]' | iot ingest --device-id seed-42","handlingStrategy":"validation","validationCode":"const payload = produceVectors(); // unknown[]\nif (!Array.isArray(payload) || payload.length === 0) {\n  throw new Error('upstream produced no vectors; skipping iot ingest');\n}\nspawnSync('iot', ['ingest', '--device-id', deviceId], { input: JSON.stringify(payload) });","typeGuard":null,"tryCatchPattern":"try {\n  await runIngest(stdinPayload);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('No vectors to ingest')) {\n    // log which source (flag/stdin) was empty and skip; do not retry with the same empty input\n  } else throw e;\n}","preventionTips":["Fail the producer on empty batches instead of invoking the CLI","Wire stdin explicitly (cat batch.json | iot ingest ...) rather than relying on terminal input","Smoke-test ingestion pipelines with one known-good vector"],"tags":["cli","iot","stdin","input-validation"],"backgroundTag":"missing-required-input","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}