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

  1. Verify the backend is running: curl <workspace.remote>/api/version (should return a version string).
  2. Check the workspace remote URL: `wmill workspace list` / switch, and fix typos or http/https mismatch.
  3. Connect VPN / open firewall access to the instance.
  4. For self-signed certs, add the CA to the trust store or use an HTTPS-capable setup.
  5. 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

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


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