windmill-labs/windmill · warning

Failed to upload scripts to temp storage (backend may be too

Error message

Failed to upload scripts to temp storage (backend may be too old): ${e}. Locks will be generated using deployed script versions only — locally modified relative imports may not be reflected.

What it means

`generateMetadata` uploads scripts to temp storage so the backend can resolve relative imports when generating locks. If the upload fails (classically because the backend lacks the `/raw_temp` endpoints), it warns and continues, generating locks from deployed script content only — locally modified relative imports will not be reflected.

Source

Thrown at cli/src/commands/generate-metadata/generate-metadata.ts:563

        workspace,
        opts,
        false,
        true, // noStaleMessage
        tree
      );
    }
  }

  // === Propagate staleness through imports ===
  tree.propagateStaleness();

  // Upload stale scripts to temp storage so the backend can resolve relative imports.
  // If this fails (e.g. backend is older and doesn't have /raw_temp endpoints),
  // degrade gracefully: locks will be generated using deployed script content only.
  try {
    await uploadScripts(tree, workspace);
  } catch (e) {
    log.warn(colors.yellow(
      `Failed to upload scripts to temp storage (backend may be too old): ${e}. ` +
      `Locks will be generated using deployed script versions only — locally modified ` +
      `relative imports may not be reflected.`
    ));
  }

  // === Populate staleItems from tree ===
  const staleItems: StaleItem[] = [];
  const seenFolders = new Set<string>();

  for (const p of tree.allPaths()) {
    const staleReason = tree.getStaleReason(p);
    if (!staleReason) continue;

    const itemType = tree.getItemType(p)!;
    const itemFolder = tree.getFolder(p)!;

    if (itemType === "dependencies") {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Upgrade the Windmill backend so `/raw_temp` upload endpoints exist.
  2. Push locally modified imported scripts first (`wmill sync push`) so deployed content already matches.
  3. Verify connectivity/credentials with `wmill workspace show`, then rerun `wmill generate-metadata`.
  4. Accept the degraded output only if your imports are unchanged locally.

Example fix

// before: locks generated from deployed imports, local edits lost
wmill generate-metadata
// after: ensure local edits are in the workspace first
wmill sync push && wmill generate-metadata
Defensive patterns

Strategy: fallback

Validate before calling

// ensure deployed content matches local before generating metadata
const res = await fetch(`${baseUrl}/api/w/${workspaceId}/scripts/raw_script_temp`, { method: 'HEAD', headers: { Authorization: token } });
if (res.status === 404) { await wmill.syncPush(); } // old backend: sync instead of temp-upload

Type guard

null

Try / catch

try {
  await wmill.generateMetadata({});
} catch (e: any) {
  if (/temp storage|backend may be too old/.test(e.message ?? '')) {
    await wmill.syncPush();
    await wmill.generateMetadata({});
  } else { throw e; }
}

Prevention

When it happens

Trigger: Running `wmill generate-metadata` (or flow lock regeneration) on a project with scripts that have local relative-import modifications when `uploadScripts` throws: old backend without `/raw_temp`, network error, or auth failure.

Common situations: Outdated self-hosted backend; offline development; CI runner with restricted network access; token revoked mid-run.

Related errors


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