windmill-labs/windmill · warning

Could not fetch datatable schemas: ${err.message}

Error message

Could not fetch datatable schemas: ${err.message}

What it means

When generating pipeline documentation (`wmill pipeline docs`), the CLI attempts to list datatable schemas from the backend via wmill.listDataTableSchemas to enrich PIPELINE.md. Because the docs are still useful without schemas, any error from that fetch (including resolveWorkspace/requireLogin failures) is caught and logged as this warning; generation proceeds with an empty schema list.

Source

Thrown at cli/src/commands/pipeline/docs.ts:258

    }
    log.info(`No pipeline scripts in f/${f}.`);
    return;
  }

  let datatableSchemas: any[] = [];
  const hasExplicitWorkspace =
    !!opts.workspace ||
    (!!opts.baseUrl && !!opts.token) ||
    (!!process.env["WM_WORKSPACE"] &&
      !!process.env["WM_TOKEN"] &&
      !!(process.env["BASE_INTERNAL_URL"] ?? process.env["BASE_URL"]));
  if (!opts.local || hasExplicitWorkspace) {
    try {
      const schemaWorkspace = workspace ?? await resolveWorkspace(opts);
      if (opts.local) await requireLogin(opts);
      datatableSchemas = await wmill.listDataTableSchemas({ workspace: schemaWorkspace.workspaceId });
    } catch (err: any) {
      log.warn(colors.yellow(`Could not fetch datatable schemas: ${err.message}`));
    }
  }

  const md = generatePipelineMarkdown(f, graph, datatableSchemas, !!opts.local);
  const folderDir = path.join(root, "f", f);
  await writeFile(path.join(folderDir, "PIPELINE.md"), md, "utf-8");

  // PIPELINE.md is ours to own. AGENTS.md / CLAUDE.md are commonly user-authored,
  // so write the pointer only when the file is ABSENT or is byte-for-byte the
  // exact pointer we generate — never clobber hand-written instructions, even a
  // file that merely references `@PIPELINE.md` alongside its own content.
  const written = ["PIPELINE.md"];
  const pointers: Array<[string, string]> = [
    ["AGENTS.md", `See @PIPELINE.md for this pipeline's graph, assets, and how to run it.\n`],
    ["CLAUDE.md", `Instructions are in @PIPELINE.md\n`],
  ];
  for (const [name, content] of pointers) {
    const p = path.join(folderDir, name);

View on GitHub (pinned to e474e8803c)

Solutions

  1. Ensure a valid workspace is configured: `wmill workspace list` / `wmill workspace bind`, or pass --workspace (and --base-url/--token) explicitly.
  2. Refresh credentials: re-login (`wmill login`) or regenerate the token used in WM_TOKEN.
  3. Verify the instance is reachable and up to date enough to expose the datatable schema endpoint; read the warning body for status codes.
  4. If you only want local docs without backend schemas, drop explicit workspace flags/env so the fetch step is skipped entirely.
  5. Treat PIPELINE.md as generated without the datatable schema section and regenerate later once connectivity/auth is fixed.

Example fix

// before
wmill pipeline docs f/my_pipeline   # no workspace configured
// after
wmill pipeline docs f/my_pipeline --workspaceadmins --token $WM_TOKEN --base-url https://app.windmill.dev
Defensive patterns

Strategy: try-catch

Validate before calling

// check auth + reachability before asking for schemas
if (!process.env.WM_TOKEN) throw new Error("WM_TOKEN not set — schema fetch will be skipped");
const res = await fetch(`${baseUrl}/api/w/${workspaceId}/datatables/list_schemas`, {
  headers: { Authorization: `Bearer ${process.env.WM_TOKEN}` },
});
if (!res.ok) console.warn(`datatable schema fetch will fail: HTTP ${res.status}`);

Type guard

function hasMessage(err: unknown): err is { message: string } {
  return typeof err === "object" && err !== null && "message" in err && typeof (err as { message: unknown }).message === "string";
}

Try / catch

try {
  datatableSchemas = await wmill.listDataTableSchemas({ workspace: schemaWorkspace.workspaceId });
} catch (err) {
  const msg = hasMessage(err) ? err.message : String(err);
  log.warn(colors.yellow(`Could not fetch datatable schemas: ${msg} — continuing without schemas`));
}

Prevention

When it happens

Trigger: Running `wmill pipeline docs <folder>` (remote mode, or --local with an explicit workspace/env) when resolveWorkspace fails (no/bad workspace config), requireLogin fails, or the listDataTableSchemas API call errors: unreachable backend, 401/403, or endpoint missing on older instances.

Common situations: No workspace selected/bound in CI; expired WM_TOKEN; self-hosted instance without the datatable-schemas endpoint (version mismatch); --local mode where BASE_INTERNAL_URL/WM_WORKSPACE/WM_TOKEN env auth is incomplete so the backend fetch is skipped or fails.

Related errors


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