windmill-labs/windmill · error · Error
Script snapshot creation was not successful: ${req.status} -
Error message
Script snapshot creation was not successful: ${req.status} - ${req.statusText} - ${await req.text()} What it means
When a script is pushed WITH a bundle (bundleContent present), the CLI POSTs multipart form data to /scripts/create_snapshot and requires 201. Any other status throws this error carrying status, statusText and the response body.
Source
Thrown at cli/src/commands/script/script.ts:1038
);
const url =
workspace.remote +
"api/w/" +
workspace.workspaceId +
"/scripts/create_snapshot?" +
skipIfNoop;
const req = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${workspace.token} `,
...extraHeaders,
},
body: form,
});
await detectAuthGatewayChallenge(req, url);
if (req.status != 201) {
throw Error(
`Script snapshot creation was not successful: ${req.status} - ${
req.statusText
} - ${await req.text()} `
);
}
}
return performance.now() - start;
}
/**
* A script metadata file could not be paired with exactly one script file on
* disk, so nothing can be deployed for it. Distinct from a deploy that reached
* the remote and was rejected: callers that can carry on with the rest of a
* changeset catch this specifically.
*/
export class UnresolvableScriptContentFileError extends Error {}
/**View on GitHub (pinned to e474e8803c)
Solutions
- Read the response body appended to the error for the server's rejection reason
- Check permissions of the token for the target workspace
- Test whether a proxy/reverse-proxy body-size limit is truncating the multipart upload (raise client_max_body_size on nginx etc.)
- Retry after confirming the path is valid and not occupied by an incompatible object
Example fix
// nginx before client_max_body_size 1m; // after client_max_body_size 50m;
Defensive patterns
Strategy: try-catch
Validate before calling
const bundleSize = typeof bundleContent === 'string' ? new Blob([bundleContent]).size : bundleContent.size; if (bundleSize > 50 * 1024 * 1024) console.warn('Bundle may exceed server/proxy body limits'); Try / catch
try { await createScript(bundle, ...); } catch (e) { if (String(e.message).includes('create_snapshot was not successful')) { console.error('Server rejected the snapshot:', e.message); } else throw e; } Prevention
- Raise reverse-proxy client_max_body_size to accommodate bundles
- Ensure the token has write permission on the target workspace
- Check the response body in the error for the backend's validation reason
When it happens
Trigger: Pushing a bundled script (e.g. with a lockfile/bundle) where the server returns non-201: oversized bundle, invalid multipart payload, auth failure, path conflict, backend validation error.
Common situations: Bundler produced a bundle the backend rejects; token lacks write permission; instance behind a proxy that strips multipart or enforces body-size limits; wrong workspace path.
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
- ${req.status} - ${req.statusText} - ${await req.text()}
- Script creation for ${body.path} with parent ${body.parent_h
- Failed to queue flow dependencies job: ${queueResponse.statu
- Couldn't fetch resource types from hub ${hubBaseUrl}: ${(awa
- Couldn't fetch resource types from public hub:
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/3c8257758da50f58.
Report an issue: GitHub.