{"record":{"id":"7585d7f837c25d6a","repo":"nexu-io/open-design","slug":"vela-label-did-not-write-the-requested-output-f","errorCode":null,"errorMessage":"Vela ${label} did not write the requested output file","messagePattern":"Vela (.+?) did not write the requested output file","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/media/vela.ts","lineNumber":120,"sourceCode":"  // A configured OD alias is already the provider-facing wire name. Only\n  // remove the catalogue namespace when the alias layer left the id intact.\n  if (wireModel !== model) return wireModel;\n  return model.startsWith('vela/') ? model.slice('vela/'.length) : model;\n}\n\nfunction extensionForImageMime(mime: string): string {\n  if (mime === 'image/jpeg') return '.jpg';\n  if (mime === 'image/webp') return '.webp';\n  if (mime === 'image/png') return '.png';\n  throw new Error(`Vela image returned unsupported mime_type ${mime}`);\n}\n\nasync function readNonEmptyOutput(outputPath: string, label: string): Promise<Buffer> {\n  let outputStat;\n  try {\n    outputStat = await stat(outputPath);\n  } catch {\n    throw new Error(`Vela ${label} did not write the requested output file`);\n  }\n  if (!outputStat.isFile() || outputStat.size <= 0) {\n    throw new Error(`Vela ${label} wrote an empty output file`);\n  }\n  return readFile(outputPath);\n}\n\nfunction assertInputImageCount(imageRefs: VelaMediaImageRef[]): void {\n  if (imageRefs.length > VELA_MAX_INPUT_IMAGES) {\n    throw new Error(\n      `Vela media accepts at most ${VELA_MAX_INPUT_IMAGES} input images; received ${imageRefs.length}`,\n    );\n  }\n}\n\nasync function stageInputImages(\n  imageRefs: VelaMediaImageRef[],\n  tempDir: string,","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/media/vela.ts#L102-L138","documentation":"Thrown by readNonEmptyOutput() when stat() on the expected output file throws — meaning Vela's --output path was never created. The daemon tells Vela where to write the result (outputPath), then reads it back; a missing file means the CLI accepted the request but produced no output artifact.","triggerScenarios":"Vela image gen/edit or video command completed (returned JSON) but did not write to the --output path the daemon supplied. The label identifies which command (e.g. 'image gen', 'image edit').","commonSituations":"Vela CLI bug where --output is ignored under certain flags; permissions issue on the temp directory; the CLI wrote to a different path; disk full; the CLI was killed mid-write.","solutions":["Run the same Vela command with --output <path> manually and check whether the file appears","Verify the temp directory (os.tmpdir()) is writable and not full","Check the Vela CLI version for known --output regressions","Inspect Vela stderr/logs for write errors"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { stat } from 'node:fs/promises';\n\nasync function outputExists(p: string): Promise<boolean> {\n  try { return (await stat(p)).isFile(); } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try {\n  const bytes = await readNonEmptyOutput(outputPath, label);\n} catch (err) {\n  if (err instanceof Error && /did not write the requested output file/.test(err.message)) {\n    // rerun the vela command, or inspect stderr for the write failure\n  } else throw err;\n}","preventionTips":["Confirm the temp directory is writable and has free space before the Vela call","Capture Vela stderr so a missing-output failure has a diagnostic","Pin the Vela CLI version and test --output behavior after upgrades"],"tags":["vela","filesystem","output","upstream"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}