windmill-labs/windmill · warning
Could not fetch datatables: ${errorMessage}
Error message
Could not fetch datatables: ${errorMessage} What it means
This is a non-fatal warning from `wmill app new` (newApp). While scaffolding a raw app the CLI fetches the workspace's datatables and their schemas via wmill.listDataTables/listDataTableSchemas purely to power the interactive datatable picker. If that API call fails for any reason (network, auth, API error), the CLI catches the error, prints this warning with the underlying message, and continues with an empty datatable list instead of aborting the app creation.
Source
Thrown at cli/src/commands/app/new.ts:313
log.info(colors.gray("Fetching available datatables..."));
datatables = await wmill.listDataTables({ workspace: workspaceId });
if (datatables.length > 0) {
// Fetch schemas for all datatables
const schemaData = await wmill.listDataTableSchemas({
workspace: workspaceId,
});
for (const dt of schemaData) {
if (dt.schemas && !dt.error) {
const schemaNames = Object.keys(dt.schemas);
datatableSchemas.set(dt.datatable_name, schemaNames);
}
}
}
} catch (error: unknown) {
const errorMessage =
error instanceof Error ? error.message : String(error);
log.warn(
colors.yellow(`Could not fetch datatables: ${errorMessage}`)
);
}
// Ask for summary (skipped if --summary is provided)
let summary: string;
if (opts.summary !== undefined) {
if (opts.summary.trim().length === 0) {
log.error(colors.red("--summary cannot be empty"));
return;
}
summary = opts.summary;
} else {
summary = await Input.prompt({
message: "App summary (short description):",
minLength: 1,
validate: (value: string) => {
if (value.trim().length === 0) {View on GitHub (pinned to e474e8803c)
Solutions
- Verify connectivity and credentials: run `wmill workspace show` / any other command against the same workspace to confirm auth and instance URL work.
- Check that the instance has datatables enabled (enterprise feature); if not, ignore the warning and configure a datatable later or via --datatable only when the feature exists.
- Re-login (`wmill login`) or refresh the token if the API returned 401/403.
- Retry the command once the backend is reachable; the warning is transient-safe and app creation still proceeds.
Example fix
// before: only the CLI's own handling
log.warn(colors.yellow(`Could not fetch datatables: ${errorMessage}`));
// after (caller-side): pre-check the API before running app new
try { await wmill.listDataTables({ workspace }); } catch (e) {
console.error('Datatables API unavailable, fix auth/instance first:', e.message);
process.exit(1); // or proceed knowing the picker will be empty
} Defensive patterns
Strategy: fallback
Validate before calling
let datatablesOk = true;
try { await wmill.listDataTables({ workspace }); } catch { datatablesOk = false; }
if (!datatablesOk) console.warn('Datatable picker will be empty; fix auth/instance before relying on --datatable.'); Type guard
function isApiError(e: unknown): e is Error & { statusCode?: number } {
return e instanceof Error;
} Try / catch
try {
datatables = await wmill.listDataTables({ workspace });
} catch (error) {
const msg = error instanceof Error ? error.message : String(error);
log.warn(`Datatables unavailable (continuing without): ${msg}`);
datatables = []; // explicit fallback so downstream code sees a defined state
} Prevention
- Verify workspace auth (`wmill workspace show`) before running scaffolding commands in CI.
- Confirm your instance supports datatables (EE feature) before scripting --datatable usage.
- Run wmill commands on a machine with confirmed connectivity to the instance URL.
- Treat this warning as expected when datatables are intentionally disabled; don't wrap app new in code that retries on it.
When it happens
Trigger: Calling `wmill app new` (interactive or with flags) when wmill.listDataTables({workspace}) or wmill.listDataTableSchemas({workspace}) throws: e.g. the workspace backend is unreachable, the stored token is expired/invalid, the workspace lacks the datatables feature (EE-only), or the API returns an error response.
Common situations: Running against a self-hosted instance without the datatables enterprise feature; stale WM_TOKEN after token rotation; offline/VPN-down laptop; pointing at the wrong instance URL so /datatables endpoints 404; temporary backend restart while scaffolding.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- Could not fetch datatable schemas: ${err.message}
- App ${appPath} not found
- Dependency generation failed: ${queueResponse.status} ${queu
- Failed to poll dependencies job ${jobId}: ${e?.message ?? e}
- No response body for SSE stream
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/7d588e6202c2c915.
Report an issue: GitHub.