{"record":{"id":"9d2c8e702f037448","repo":"windmill-labs/windmill","slug":"cannot-fetch-backend-version-from-workspace-remo","errorCode":null,"errorMessage":"Cannot fetch backend version from ${workspace.remote} (workspace: ${workspace.name}): ${e}","messagePattern":"Cannot fetch backend version from (.+?) \\(workspace: (.+?)\\): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"cli/src/main.ts","lineNumber":248,"sourceCode":"      if (versions.latest !== VERSION) {\n        console.log(\n          `CLI is outdated. Latest version ${versions.latest} is available. Run \\`wmill upgrade\\` to update.`\n        );\n      } else {\n        console.log(\"CLI is up to date\");\n      }\n    } catch (e) {\n      console.warn(\n        `Cannot fetch latest CLI version on npmjs to check if up-to-date: ${e}`\n      );\n    }\n    const workspace = await getActiveWorkspace(opts as GlobalOptions);\n    if (workspace) {\n      try {\n        const backendVersion = await fetchVersion(workspace.remote);\n        console.log(\"Backend Version: \" + backendVersion);\n      } catch (e) {\n        console.warn(\n          `Cannot fetch backend version from ${workspace.remote} (workspace: ${workspace.name}): ${e}`\n        );\n      }\n    } else {\n      console.warn(\n        \"Cannot fetch backend version: no active workspace selected, choose one to pick a remote to fetch version of\"\n      );\n    }\n  })\n  .command(\n    \"upgrade\",\n    new UpgradeCommand({\n      provider: new NpmProvider({ package: \"windmill-cli\" }),\n    }).error((e: any) => {\n      log.error(e);\n      log.info(\n        \"Try running with sudo and otherwise check the result of the command: npm uninstall windmill-cli && npm install -g windmill-cli\"\n      );","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/main.ts#L230-L266","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nwmill version\n// Cannot fetch backend version from https://windmill.corp (workspace: prod): fetch failed\n\n// after: confirm the remote is reachable and correct\nwmill workspace switch prod\nwmill workspace set-remote prod https://windmill.corp.example.com\nwmill version","handlingStrategy":"retry","validationCode":"// probe the backend before running wmill\ntry {\n  const r = await fetch(`${remote}/api/version`);\n  if (!r.ok) throw new Error(`backend responded ${r.status}`);\n} catch {\n  throw new Error(`backend at ${remote} unreachable — start it or fix the workspace remote`);\n}","typeGuard":null,"tryCatchPattern":"for (let i = 0; i < 3; i++) {\n  try {\n    await $`wmill version`;\n    break;\n  } catch (e) {\n    if (i === 2 || !String(e).includes(\"Cannot fetch backend version\")) throw e;\n    await new Promise((r) => setTimeout(r, 2000));\n  }\n}","preventionTips":["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"],"tags":["cli","network","http","backend-unreachable"],"backgroundTag":"connection-refused","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"}