{"record":{"id":"5e4543415233b7b3","repo":"medusajs/medusa","slug":"base-must-be-a-file-basefile","errorCode":null,"errorMessage":"--base must be a file - ${baseFile}","messagePattern":"--base must be a file - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/oas/medusa-oas-cli/src/command-oas.ts","lineNumber":91,"sourceCode":"  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\n  console.log(`🟣 Generating OAS - ${apiType}`)\n\n  if (apiType === \"combined\") {\n    const adminOAS = !local\n      ? await getPublicOas(\"admin\")\n      : await getOASFromCodebase(\"admin\")\n    const storeOAS = !local","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/cli/oas/medusa-oas-cli/src/command-oas.ts#L73-L109","documentation":"The Redis engine's cancel() needs the specific transactionId identifying which execution of the workflow to cancel. Without it the engine cannot locate the running DistributedTransaction and throws a plain Error.","triggerScenarios":"Calling cancel(workflowId, undefined | '') — transactionId not captured when the workflow was started or lost between services.","commonSituations":"Fire-and-forget runs where the returned transactionId ('auto-<ULID>' when auto-generated) was never stored; cancelling from a dashboard where only the workflow id is known.","solutions":["Store the transactionId returned by run() at start time and use it for cancel","When you auto-generate ids, pass your own transactionId via context so it is known","Guard for falsy transactionId before calling cancel"],"exampleFix":"// before\nawait engine.cancel('orders', undefined)\n// after\nawait engine.cancel('orders', savedTxId) // saved from const { transactionId } = await engine.run(...)","handlingStrategy":"validation","validationCode":"if (!transactionId) throw new Error('transactionId is required to cancel')\nawait engine.cancel(workflowId, transactionId)","typeGuard":"const isTxId = (v: unknown): v is string => typeof v === 'string' && v.length > 0","tryCatchPattern":"catch (e) { if (e.message === 'Transaction ID is required') return badRequest('transactionId missing'); throw e }","preventionTips":["Supply your own context.transactionId when starting runs so it's always known","Save run metadata (workflowId, transactionId) to your database"],"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"}