windmill-labs/windmill · error · Error

Script creation for ${body.path} with parent ${body.parent_h

Error message

Script creation for ${body.path} with parent ${body.parent_hash}  was not successful: ${e.body ?? e.message} 

What it means

The catch wrapper around script creation in the Windmill CLI rethrows any failure (network error, HTTP error, parse error) with context: the script path, its parent hash, and the inner error body/message. Developers see this when a `wmill script push`/deploy fails to create the script server-side.

Source

Thrown at cli/src/commands/script/script.ts:1006

        "/scripts/create?" +
        skipIfNoop;
      const req = await fetch(url, {
        method: "POST",
        headers: {
          Authorization: `Bearer ${workspace.token}`,
          "Content-Type": "application/json",
          ...extraHeaders,
        },
        body: JSON.stringify(body),
      });
      await detectAuthGatewayChallenge(req, url);
      if (req.status != 201) {
        throw Error(
          `${req.status} - ${req.statusText} - ${await req.text()}`
        );
      }
    } catch (e: any) {
      throw Error(
        `Script creation for ${body.path} with parent ${
          body.parent_hash
        }  was not successful: ${e.body ?? e.message} `
      );
    }
  } else {
    const form = new FormData();
    form.append("script", JSON.stringify(body));
    form.append(
      "file",
      typeof bundleContent == "string"
        ? bundleContent
        : bundleContent
    );

    const url =
      workspace.remote +
      "api/w/" +

View on GitHub (pinned to e474e8803c)

Solutions

  1. Inspect the trailing reason in the message (e.body ?? e.message) for the root cause
  2. If a parent hash was passed, verify it exists (it may have been deleted or belong to another workspace)
  3. Check connectivity to the instance and re-authenticate if the reason indicates 401/403
  4. Fix the underlying validation problem reported by the server (path, schema, etc.)

Example fix

// before
wmill script push f/scripts/x --parent 00000000-0000-0000-0000-000000000000
// after
wmill script push f/scripts/x --parent $(wmill script get f/scripts/original | jq -r .hash)
Defensive patterns

Strategy: try-catch

Validate before calling

if (body.parent_hash) { const res = await fetch(`${workspace.remote}api/w/${workspaceId}/scripts/get/${body.parent_hash}`); if (!res.ok) throw new Error(`parent hash ${body.parent_hash} not found in workspace`); }

Type guard

function hasRootCause(e: unknown): e is { message: string; body?: unknown } { return e instanceof Error && typeof e.message === 'string'; }

Try / catch

try { await deploy(); } catch (e) { const m = /Script creation for (.+) with parent (.+) was not successful: (.+)/.exec(e.message); if (m) console.error(`Path ${m[1]}: cause ${m[3]}`); else throw e; }

Prevention

When it happens

Trigger: Any exception raised inside the POST to /scripts/create (including error 1291's throw) is caught and re-wrapped as 'Script creation for <path> with parent <parent_hash> was not successful: <reason>'.

Common situations: Invalid parent hash supplied via --parent; network/proxy failure; auth token expired; server rejecting the script payload; e.body undefined so only e.message is shown.

Understand the failure class

Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.

Related errors


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