windmill-labs/windmill · warning

couldn't fetch the latest version - try again after sometime

Error message

couldn't fetch the latest version - try again after sometime

What it means

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.

Source

Thrown at cli/src/utils/upgrade.ts:30

export class NpmProvider extends Provider {
  name = "npm";
  private readonly repositoryUrl = "https://npmjs.org/";
  private readonly apiUrl = "https://registry.npmjs.org/";
  private readonly packageName?: string;

  constructor({ main, logger, ...options }: NpmProviderOptions) {
    super({ main, logger });

    this.packageName = "package" in options ? options.package : options.name;
  }

  async getVersions(name: string): Promise<any> {
    const response = await fetch(
      new URL(`${this.packageName ?? name}`, this.apiUrl)
    );
    if (!response.ok) {
      throw new Error(
        "couldn't fetch the latest version - try again after sometime"
      );
    }

    const {
      "dist-tags": { latest },
      versions,
    } = (await response.json()) as NpmApiPackageMetadata;

    return {
      latest,
      versions: Object.keys(versions).reverse(),
    };
  }

  getRepositoryUrl(name: string, version?: string): string {
    return new URL(
      `package/${this.packageName ?? name}${version ? `/v/${version}` : ""}`,

View on GitHub (pinned to e474e8803c)

Solutions

  1. Wait and retry `wmill upgrade` as the message suggests
  2. Check general connectivity to the registry host (curl the registry URL) and any proxy settings (HTTP_PROXY/HTTPS_PROXY)
  3. Upgrade via the original package manager instead (npm i -g windmill-cli@latest / brew upgrade) which uses its own registry config
  4. Pin/install a specific version manually if the registry is persistently unreachable

Example fix

// before
$ wmill upgrade   # couldn't fetch the latest version
// after
$ curl -I https://registry.example.com/windmill-cli   # diagnose
$ npm i -g windmill-cli@latest
Defensive patterns

Strategy: retry

Validate before calling

const res = await fetch(new URL("windmill-cli", registryUrl));
if (!res.ok) {
  console.warn(`Registry unreachable (HTTP ${res.status}) — upgrade will fail; check proxy/VPN or retry.`);
}

Type guard

null

Try / catch

try {
  await wmillUpgrade();
} catch (e) {
  if (String(e.message).includes("couldn't fetch the latest version")) {
    await retry(() => wmillUpgrade(), { attempts: 3, backoffMs: 2000 });
  } else throw e;
}

Prevention

When it happens

Trigger: Calling `wmill upgrade` (via getVersions) when the registry URL returns 4xx/5xx — registry outage, rate limiting, blocked network, or a wrong/misconfigured apiUrl.

Common situations: 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.

Related errors


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