{"record":{"id":"ca983f9b8bafbd9a","repo":"windmill-labs/windmill","slug":"arg-spec-must-be-script-param-json-or","errorCode":null,"errorMessage":"--arg '${spec}' must be <script>:<param>=<json-or-string>","messagePattern":"--arg '(.+?)' must be <script>:<param>=<json-or-string>","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/pipeline/pipelineUpload.ts","lineNumber":50,"sourceCode":"\nexport type ArgBinding = { scriptTok: string; param: string; value: unknown };\n\n/**\n * Parse an `--arg` spec: `<script>:<param>=<value>`. Split on the FIRST `=`\n * (values may contain `=`); the value is JSON when it parses as JSON, else the\n * raw string — so `stats:limit=10` is a number and\n * `daily_report:partition=2026-07-02` a string. `:<param>` is required: unlike\n * `--upload` there is no single-S3Object convention to infer it from.\n */\nexport function parseArgBinding(spec: string): ArgBinding {\n  const eq = spec.indexOf(\"=\");\n  const left = eq < 0 ? \"\" : spec.slice(0, eq).trim();\n  const raw = eq < 0 ? \"\" : spec.slice(eq + 1).trim();\n  const colon = left.indexOf(\":\");\n  const scriptTok = colon < 0 ? \"\" : left.slice(0, colon).trim();\n  const param = colon < 0 ? \"\" : left.slice(colon + 1).trim();\n  if (!scriptTok || !param) {\n    throw new Error(`--arg '${spec}' must be <script>:<param>=<json-or-string>`);\n  }\n  let value: unknown;\n  try {\n    value = JSON.parse(raw);\n  } catch {\n    value = raw;\n  }\n  return { scriptTok, param, value };\n}\n\n/**\n * Names of a schema's S3Object properties. The resource name in `format`\n * varies by language parser — TS/python emit `resource-s3_object`, the SQL\n * dialects emit `resource-S3Object` — so match it case/underscore-insensitively\n * the way the frontend's ArgInput does.\n */\nexport function s3ObjectParams(schema: any): string[] {\n  const props = schema?.properties ?? {};","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/pipeline/pipelineUpload.ts#L32-L68","documentation":"Syntax validation in parseArgBinding: the --arg spec doesn't match <script>:<param>=<json-or-string>. Unlike --upload, the :<param> part is mandatory (there is no single-S3Object convention to infer the param from), so a spec missing the ':' or '=' — or with an empty script/param — triggers this. The input at fault is the --arg string as typed.","triggerScenarios":"Thrown at cli/src/commands/pipeline/pipelineUpload.ts:50 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Include all three parts: --arg myscript:limit=10","Quote values containing '=' or special characters so the first '=' split lands correctly","JSON-quote structured values: --arg s:cfg='{\\\"k\\\":1}'"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}