{"record":{"id":"671f2a6ec535269e","repo":"windmill-labs/windmill","slug":"couldn-t-fetch-the-latest-version-try-again-afte","errorCode":null,"errorMessage":"couldn't fetch the latest version - try again after sometime","messagePattern":"couldn't fetch the latest version - try again after sometime","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/utils/upgrade.ts","lineNumber":30,"sourceCode":"\nexport class NpmProvider extends Provider {\n  name = \"npm\";\n  private readonly repositoryUrl = \"https://npmjs.org/\";\n  private readonly apiUrl = \"https://registry.npmjs.org/\";\n  private readonly packageName?: string;\n\n  constructor({ main, logger, ...options }: NpmProviderOptions) {\n    super({ main, logger });\n\n    this.packageName = \"package\" in options ? options.package : options.name;\n  }\n\n  async getVersions(name: string): Promise<any> {\n    const response = await fetch(\n      new URL(`${this.packageName ?? name}`, this.apiUrl)\n    );\n    if (!response.ok) {\n      throw new Error(\n        \"couldn't fetch the latest version - try again after sometime\"\n      );\n    }\n\n    const {\n      \"dist-tags\": { latest },\n      versions,\n    } = (await response.json()) as NpmApiPackageMetadata;\n\n    return {\n      latest,\n      versions: Object.keys(versions).reverse(),\n    };\n  }\n\n  getRepositoryUrl(name: string, version?: string): string {\n    return new URL(\n      `package/${this.packageName ?? name}${version ? `/v/${version}` : \"\"}`,","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/utils/upgrade.ts#L12-L48","documentation":"getVersions queries the npm-style registry (dist-tags.latest) to find the newest CLI version for `wmill upgrade`/`wmill version`. If the registry responds with a non-OK HTTP status, it throws this generic Error telling the user to retry later. It is a transient/network-class failure, not a local problem.","triggerScenarios":"Calling `wmill upgrade` (via getVersions) when the registry URL returns 4xx/5xx — registry outage, rate limiting, blocked network, or a wrong/misconfigured apiUrl.","commonSituations":"Corporate proxy or firewall blocking the registry host; npm registry rate-limiting or outage; offline/VPN issues; an air-gapped environment where the registry is unreachable.","solutions":["Wait and retry `wmill upgrade` as the message suggests","Check general connectivity to the registry host (curl the registry URL) and any proxy settings (HTTP_PROXY/HTTPS_PROXY)","Upgrade via the original package manager instead (npm i -g windmill-cli@latest / brew upgrade) which uses its own registry config","Pin/install a specific version manually if the registry is persistently unreachable"],"exampleFix":"// before\n$ wmill upgrade   # couldn't fetch the latest version\n// after\n$ curl -I https://registry.example.com/windmill-cli   # diagnose\n$ npm i -g windmill-cli@latest","handlingStrategy":"retry","validationCode":"const res = await fetch(new URL(\"windmill-cli\", registryUrl));\nif (!res.ok) {\n  console.warn(`Registry unreachable (HTTP ${res.status}) — upgrade will fail; check proxy/VPN or retry.`);\n}","typeGuard":"null","tryCatchPattern":"try {\n  await wmillUpgrade();\n} catch (e) {\n  if (String(e.message).includes(\"couldn't fetch the latest version\")) {\n    await retry(() => wmillUpgrade(), { attempts: 3, backoffMs: 2000 });\n  } else throw e;\n}","preventionTips":["Check HTTP_PROXY/HTTPS_PROXY and VPN connectivity before upgrading in restricted networks","Prefer upgrading via your package manager (npm/brew), which shares your normal registry config","Watch registry status pages if upgrades fail repeatedly","In air-gapped environments, download and install CLI versions manually instead of relying on wmill upgrade"],"tags":["network","cli","upgrade","http"],"backgroundTag":"registry-unreachable","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"}