{"record":{"id":"975bae09b2b614df","repo":"windmill-labs/windmill","slug":"could-not-fetch-schema-to-validate-args-e-messa","errorCode":null,"errorMessage":"Could not fetch schema to validate args: ${e.message}","messagePattern":"Could not fetch schema to validate args: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/flow/flow.ts","lineNumber":443,"sourceCode":"  if (opts.silent) {\n    log.setSilent(true);\n  }\n  const workspace = await resolveWorkspace(opts);\n  await requireLogin(opts);\n\n  const input = opts.data ? await resolve(opts.data) : {};\n\n  // Validate required args against schema when no data provided\n  if (!opts.data) {\n    try {\n      const flow = await wmill.getFlowByPath({\n        workspace: workspace.workspaceId,\n        path,\n      });\n      validateRequiredArgs(flow.schema as Record<string, unknown>);\n    } catch (e: any) {\n      if (e.message?.startsWith(\"Missing required\")) throw e;\n      log.warn(`Could not fetch schema to validate args: ${e.message}`);\n    }\n  }\n\n  const id = await wmill.runFlowByPath({\n    workspace: workspace.workspaceId,\n    path,\n    tag: opts.tag,\n    requestBody: input,\n  });\n\n  // Build step label map from raw_flow if available\n  const stepLabels = new Map<string, string>();\n  try {\n    const initialJob = await wmill.getJob({\n      workspace: workspace.workspaceId,\n      id,\n    });\n    const rawFlow = (initialJob as any).raw_flow;","sourceCodeStart":425,"sourceCodeEnd":461,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/flow/flow.ts#L425-L461","documentation":"In `wmill flow run`, the CLI fetches the flow's schema from the workspace to validate that all required args are supplied. If that schema fetch/validation fails for any reason other than a genuine 'Missing required' error, it warns and proceeds to run the flow without arg validation.","triggerScenarios":"Running `wmill flow run <path>` when the schema fetch fails: offline/unreachable backend, invalid or expired credentials, flow path not found, or a transient network error during `wmill.getFlowByPath`.","commonSituations":"VPN/proxy down or flaky network; workspace token expired; typos in the flow path so the schema 404s; backend temporarily unavailable in self-hosted setups; the flow was deleted after the command line was composed.","solutions":["Check backend reachability and credentials: `wmill workspace show` and a simple `wmill flow list`.","Verify the flow path exists in the workspace and is spelled correctly.","Provide all required args explicitly with `-e/--extra-args` or a value file so validation failure does not matter.","Re-authenticate: `wmill login` to refresh the token."],"exampleFix":"// before: relies on server-side schema, fails silently offline\nwmill flow run u/company/etl\n// after: supply args explicitly so the run is correct even without validation\nwmill flow run u/company/etl --extra-args '{\"date\":\"2026-09-03\"}'","handlingStrategy":"try-catch","validationCode":"// preflight: confirm the flow is fetchable before relying on schema validation\ntry { await wmill.getFlowByPath(path); console.log('flow reachable'); }\ncatch (e) { console.error('backend/path unreachable:', e.message); }","typeGuard":"null","tryCatchPattern":"try {\n  await wmill.runFlowByPath({ workspace, path, args });\n} catch (e: any) {\n  if (/Could not fetch schema|ECONNREFUSED|401|404/.test(e.message ?? '')) {\n    // check `wmill workspace show`, then retry with explicit --extra-args\n  }\n  throw e;\n}","preventionTips":["Verify workspace connectivity (`wmill workspace show`) before scripted runs.","Always pass required args via `--extra-args` instead of relying on schema validation.","Keep tokens fresh; re-run `wmill login` after long sessions."],"tags":["cli","network","schema-validation","flow-run"],"backgroundTag":"schema-fetch-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}