windmill-labs/windmill · warning

Could not fetch schema to validate args: ${e.message}

Error message

Could not fetch schema to validate args: ${e.message}

What it means

`wmill script run` (by path) tries to fetch the remote script's schema to validate that all required args were provided before executing. If the schema fetch or parse fails for any reason other than missing args, it warns instead of failing the run — the script is executed without arg validation.

Source

Thrown at cli/src/commands/script/script.ts:1423

  if (opts.silent) {
    log.setSilent(true);
  }
  const workspace = await resolveWorkspace(opts);
  await requireLogin(opts);

  const input = opts.data ? await resolve(opts.data) : {};

  // Validate required args against schema when no data provided
  if (!opts.data) {
    try {
      const script = await wmill.getScriptByPath({
        workspace: workspace.workspaceId,
        path,
      });
      validateRequiredArgs(script.schema as Record<string, unknown>);
    } catch (e: any) {
      if (e.message?.startsWith("Missing required")) throw e;
      log.warn(`Could not fetch schema to validate args: ${e.message}`);
    }
  }

  let id: string;
  try {
    id = await wmill.runScriptByPath({
      workspace: workspace.workspaceId,
      path,
      tag: opts.tag,
      requestBody: input,
    });
  } catch (e: any) {
    if (e?.status === 404) {
      // Script might exist but have a lock/deployment error — check before giving up
      try {
        const script = await wmill.getScriptByPath({
          workspace: workspace.workspaceId,
          path,

View on GitHub (pinned to e474e8803c)

Solutions

  1. Verify the script path and workspace are correct (`wmill workspaces current`, check the path exists remotely)
  2. Fix connectivity/auth (wmill login / token) so the schema can be fetched, then re-run
  3. Inspect the embedded e.message for the actual fetch cause and fix that underlying issue

Example fix

// before
wmill script run f/scripts/foo --data '{}'
# Could not fetch schema to validate args: ...
// after
wmill workspaces current            # confirm workspace
wmill script run f/scripts/foo --data '{"required_arg": 1}'  # with correct path/workspace
Defensive patterns

Strategy: validation

Validate before calling

const s = await wmill.getScriptByPath({workspace, path}); checkRequiredArgs(s.schema, args);

Type guard

function hasSchema(s: unknown): s is { required: string[]; properties: Record<string, unknown> } { return typeof s === 'object' && s !== null && Array.isArray((s as any).required); }

Try / catch

try { await wmill.runScriptByPath({workspace, path, args}); } catch (e) { if (/schema/i.test(String(e))) console.warn('args not validated'); throw e; }

Prevention

When it happens

Trigger: The workspace is unreachable or the script path does not exist remotely; the API returned an error fetching the script; the script has no/invalid schema and validation parsing throws a non-'Missing required' error.

Common situations: Running against a stale workspace or wrong --workspace flag; typo in the script path so fetch fails; older backend versions that do not return schema; network hiccup right before the run.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/5532cf54a2ebdb86. Report an issue: GitHub.