windmill-labs/windmill · info
Cannot fetch backend version from ${workspace.remote} (works
Error message
Cannot fetch backend version from ${workspace.remote} (workspace: ${workspace.name}): ${e} What it means
When a `version`-style command runs with an active workspace, main.ts calls fetchVersion(workspace.remote) to get the Windmill backend's version. If that HTTP call fails (server down, wrong remote URL, TLS error, network unreachable), the catch prints this console.warn including the remote, workspace name and error, then continues. It only affects printing the backend version.
Source
Thrown at cli/src/main.ts:248
if (versions.latest !== VERSION) {
console.log(
`CLI is outdated. Latest version ${versions.latest} is available. Run \`wmill upgrade\` to update.`
);
} else {
console.log("CLI is up to date");
}
} catch (e) {
console.warn(
`Cannot fetch latest CLI version on npmjs to check if up-to-date: ${e}`
);
}
const workspace = await getActiveWorkspace(opts as GlobalOptions);
if (workspace) {
try {
const backendVersion = await fetchVersion(workspace.remote);
console.log("Backend Version: " + backendVersion);
} catch (e) {
console.warn(
`Cannot fetch backend version from ${workspace.remote} (workspace: ${workspace.name}): ${e}`
);
}
} else {
console.warn(
"Cannot fetch backend version: no active workspace selected, choose one to pick a remote to fetch version of"
);
}
})
.command(
"upgrade",
new UpgradeCommand({
provider: new NpmProvider({ package: "windmill-cli" }),
}).error((e: any) => {
log.error(e);
log.info(
"Try running with sudo and otherwise check the result of the command: npm uninstall windmill-cli && npm install -g windmill-cli"
);View on GitHub (pinned to e474e8803c)
Solutions
- Verify the backend is running: curl <workspace.remote>/api/version (should return a version string).
- Check the workspace remote URL: `wmill workspace list` / switch, and fix typos or http/https mismatch.
- Connect VPN / open firewall access to the instance.
- For self-signed certs, add the CA to the trust store or use an HTTPS-capable setup.
- Ignore the warning if you only needed CLI-side functionality.
Example fix
// before wmill version // Cannot fetch backend version from https://windmill.corp (workspace: prod): fetch failed // after: confirm the remote is reachable and correct wmill workspace switch prod wmill workspace set-remote prod https://windmill.corp.example.com wmill version
Defensive patterns
Strategy: retry
Validate before calling
// probe the backend before running wmill
try {
const r = await fetch(`${remote}/api/version`);
if (!r.ok) throw new Error(`backend responded ${r.status}`);
} catch {
throw new Error(`backend at ${remote} unreachable — start it or fix the workspace remote`);
} Try / catch
for (let i = 0; i < 3; i++) {
try {
await $`wmill version`;
break;
} catch (e) {
if (i === 2 || !String(e).includes("Cannot fetch backend version")) throw e;
await new Promise((r) => setTimeout(r, 2000));
}
} Prevention
- Health-check the instance URL in CI before invoking wmill
- Keep workspace remotes correct: `wmill workspace list` and verify
- Use retry loops when the backend may be restarting (deploy pipelines)
- Add the instance's CA to the trust store for self-signed TLS
When it happens
Trigger: Running a command that prints the backend version while fetchVersion throws: the instance at workspace.remote is down/restarting, the remote URL is wrong or uses http vs https incorrectly, a self-signed certificate, firewall blocking the instance, or no network.
Common situations: Local dev instance not started (localhost:8000 down); pointing at a stopped Kubernetes ingress; expired TLS certificate; VPN not connected when targeting a private instance.
Understand the failure class
Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.
Related errors
- Couldn't fetch resource types from hub ${hubBaseUrl}: ${(awa
- Couldn't fetch resource types from public hub:
- GET assets/graph -> ${res.status}: ${await res.text()}
- GET ${path} -> ${response.status}: ${body}
- Preview failed: ${response.status} - ${response.statusText}
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/9d2c8e702f037448.
Report an issue: GitHub.