{"record":{"id":"21272ab1736cdf2e","repo":"windmill-labs/windmill","slug":"could-not-fetch-datatable-schemas-err-message","errorCode":null,"errorMessage":"Could not fetch datatable schemas: ${err.message}","messagePattern":"Could not fetch datatable schemas: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/pipeline/docs.ts","lineNumber":258,"sourceCode":"    }\n    log.info(`No pipeline scripts in f/${f}.`);\n    return;\n  }\n\n  let datatableSchemas: any[] = [];\n  const hasExplicitWorkspace =\n    !!opts.workspace ||\n    (!!opts.baseUrl && !!opts.token) ||\n    (!!process.env[\"WM_WORKSPACE\"] &&\n      !!process.env[\"WM_TOKEN\"] &&\n      !!(process.env[\"BASE_INTERNAL_URL\"] ?? process.env[\"BASE_URL\"]));\n  if (!opts.local || hasExplicitWorkspace) {\n    try {\n      const schemaWorkspace = workspace ?? await resolveWorkspace(opts);\n      if (opts.local) await requireLogin(opts);\n      datatableSchemas = await wmill.listDataTableSchemas({ workspace: schemaWorkspace.workspaceId });\n    } catch (err: any) {\n      log.warn(colors.yellow(`Could not fetch datatable schemas: ${err.message}`));\n    }\n  }\n\n  const md = generatePipelineMarkdown(f, graph, datatableSchemas, !!opts.local);\n  const folderDir = path.join(root, \"f\", f);\n  await writeFile(path.join(folderDir, \"PIPELINE.md\"), md, \"utf-8\");\n\n  // PIPELINE.md is ours to own. AGENTS.md / CLAUDE.md are commonly user-authored,\n  // so write the pointer only when the file is ABSENT or is byte-for-byte the\n  // exact pointer we generate — never clobber hand-written instructions, even a\n  // file that merely references `@PIPELINE.md` alongside its own content.\n  const written = [\"PIPELINE.md\"];\n  const pointers: Array<[string, string]> = [\n    [\"AGENTS.md\", `See @PIPELINE.md for this pipeline's graph, assets, and how to run it.\\n`],\n    [\"CLAUDE.md\", `Instructions are in @PIPELINE.md\\n`],\n  ];\n  for (const [name, content] of pointers) {\n    const p = path.join(folderDir, name);","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/pipeline/docs.ts#L240-L276","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure a valid workspace is configured: `wmill workspace list` / `wmill workspace bind`, or pass --workspace (and --base-url/--token) explicitly.","Refresh credentials: re-login (`wmill login`) or regenerate the token used in WM_TOKEN.","Verify the instance is reachable and up to date enough to expose the datatable schema endpoint; read the warning body for status codes.","If you only want local docs without backend schemas, drop explicit workspace flags/env so the fetch step is skipped entirely.","Treat PIPELINE.md as generated without the datatable schema section and regenerate later once connectivity/auth is fixed."],"exampleFix":"// before\nwmill pipeline docs f/my_pipeline   # no workspace configured\n// after\nwmill pipeline docs f/my_pipeline --workspaceadmins --token $WM_TOKEN --base-url https://app.windmill.dev","handlingStrategy":"try-catch","validationCode":"// check auth + reachability before asking for schemas\nif (!process.env.WM_TOKEN) throw new Error(\"WM_TOKEN not set — schema fetch will be skipped\");\nconst res = await fetch(`${baseUrl}/api/w/${workspaceId}/datatables/list_schemas`, {\n  headers: { Authorization: `Bearer ${process.env.WM_TOKEN}` },\n});\nif (!res.ok) console.warn(`datatable schema fetch will fail: HTTP ${res.status}`);","typeGuard":"function hasMessage(err: unknown): err is { message: string } {\n  return typeof err === \"object\" && err !== null && \"message\" in err && typeof (err as { message: unknown }).message === \"string\";\n}","tryCatchPattern":"try {\n  datatableSchemas = await wmill.listDataTableSchemas({ workspace: schemaWorkspace.workspaceId });\n} catch (err) {\n  const msg = hasMessage(err) ? err.message : String(err);\n  log.warn(colors.yellow(`Could not fetch datatable schemas: ${msg} — continuing without schemas`));\n}","preventionTips":["Configure/verify a workspace (`wmill workspace list`, `wmill login`) before generating docs in CI.","Set WM_WORKSPACE, WM_TOKEN and BASE_INTERNAL_URL together when running docs with --local plus backend enrichment.","Check the instance version exposes the datatable schemas endpoint before relying on the schema section.","Pass --workspace/--base-url/--token explicitly instead of relying on interactive resolution in non-TTY environments."],"tags":["network","cli","datatables","authentication","docs"],"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"}