{"record":{"id":"3c8257758da50f58","repo":"windmill-labs/windmill","slug":"script-snapshot-creation-was-not-successful-req","errorCode":null,"errorMessage":"Script snapshot creation was not successful: ${req.status} - ${req.statusText} - ${await req.text()} ","messagePattern":"Script snapshot creation was not successful: (.+?) - (.+?) - (.+?) ","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/script/script.ts","lineNumber":1038,"sourceCode":"    );\n\n    const url =\n      workspace.remote +\n      \"api/w/\" +\n      workspace.workspaceId +\n      \"/scripts/create_snapshot?\" +\n      skipIfNoop;\n    const req = await fetch(url, {\n      method: \"POST\",\n      headers: {\n        Authorization: `Bearer ${workspace.token} `,\n        ...extraHeaders,\n      },\n      body: form,\n    });\n    await detectAuthGatewayChallenge(req, url);\n    if (req.status != 201) {\n      throw Error(\n        `Script snapshot creation was not successful: ${req.status} - ${\n          req.statusText\n        } - ${await req.text()} `\n      );\n    }\n  }\n  return performance.now() - start;\n}\n\n/**\n * A script metadata file could not be paired with exactly one script file on\n * disk, so nothing can be deployed for it. Distinct from a deploy that reached\n * the remote and was rejected: callers that can carry on with the rest of a\n * changeset catch this specifically.\n */\nexport class UnresolvableScriptContentFileError extends Error {}\n\n/**","sourceCodeStart":1020,"sourceCodeEnd":1056,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L1020-L1056","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// nginx before\nclient_max_body_size 1m;\n// after\nclient_max_body_size 50m;","handlingStrategy":"try-catch","validationCode":"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');","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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"],"tags":["http","api","multipart","cli"],"backgroundTag":"http-request-failed","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"}