{"record":{"id":"0fd86b871c9fea41","repo":"medusajs/medusa","slug":"paths-must-be-a-directory-additionalpath","errorCode":null,"errorMessage":"--paths must be a directory - ${additionalPath}","messagePattern":"--paths must be a directory - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/oas/medusa-oas-cli/src/command-oas.ts","lineNumber":84,"sourceCode":"export async function execute(cliParams: OptionValues) {\n  /**\n   * Process CLI options\n   */\n  const dryRun = !!cliParams.dryRun\n  const force = !!cliParams.force\n  const v2 = !!cliParams.v2\n  const local = !!cliParams.local\n\n  const apiType: ApiType = cliParams.type\n\n  const outDir = path.resolve(cliParams.outDir)\n\n  const additionalPaths = (cliParams.paths ?? []).map((additionalPath) =>\n    path.resolve(additionalPath)\n  )\n  for (const additionalPath of additionalPaths) {\n    if (!(await isDirectory(additionalPath))) {\n      throw new Error(`--paths must be a directory - ${additionalPath}`)\n    }\n  }\n\n  const baseFile = cliParams.base ? path.resolve(cliParams.base) : undefined\n  if (baseFile) {\n    if (!(await isFile(cliParams.base))) {\n      throw new Error(`--base must be a file - ${baseFile}`)\n    }\n  }\n\n  /**\n   * Command execution\n   */\n  if (!dryRun) {\n    await mkdir(outDir, { recursive: true })\n  }\n\n  let oas: OpenAPIObject","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/cli/oas/medusa-oas-cli/src/command-oas.ts#L66-L102","documentation":"The Redis engine's cancel() requires the workflow id (string or object with getName()) to locate the flow definition. A falsy id throws a plain Error 'Workflow ID is required' before anything is cancelled.","triggerScenarios":"Calling cancel(undefined | '', transactionId) — e.g. destructuring workflowId from a job payload where the field is absent.","commonSituations":"Cancelling workflows from queue messages/events where the workflowId field was not propagated; API endpoints that accept optional workflow ids and pass them through unchecked.","solutions":["Validate and pass a real workflowId when calling cancel","Persist workflowId alongside transactionId when the run starts","Return 400 early in API layers when workflowId is missing"],"exampleFix":"// before\nawait engine.cancel(body.wf, body.tx)\n// after\nif (!body.wf || !body.tx) throw new MedusaError(MedusaError.Types.INVALID_DATA, 'workflowId and transactionId required')\nawait engine.cancel(body.wf, body.tx)","handlingStrategy":"validation","validationCode":"if (!workflowId || !transactionId) throw new Error('workflowId and transactionId are required to cancel')\nawait engine.cancel(workflowId, transactionId)","typeGuard":"const isCancelArgs = (wf: unknown, tx: unknown): wf is string => typeof wf === 'string' && wf.length > 0 && typeof tx === 'string' && tx.length > 0","tryCatchPattern":"catch (e) { if (e.message === 'Workflow ID is required') return badRequest('workflowId missing'); throw e }","preventionTips":["Persist workflowId+transactionId pairs when runs start","Validate cancel requests at the API boundary"],"tags":["workflow-engine","redis","validation","cancel"],"backgroundTag":"missing-required-argument","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}