{"record":{"id":"0b5510171043300e","repo":"hashicorp/nomad","slug":"failed-to-parse-value-of-qq-v-as-a-bool-v","errorCode":null,"errorMessage":"Failed to parse value of %qq (%v) as a bool: %v","messagePattern":"Failed to parse value of %qq \\((.+?)\\) as a bool: (.+?)","errorType":"http","errorClass":null,"httpStatus":400,"severity":"error","filePath":"command/agent/job_endpoint.go","lineNumber":659,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"Failed to parse value of %q (%v) as a bool: %v\", \"global\", globalStr, err)\n\t\t}\n\t}\n\targs.Global = globalBool\n\n\t// Parse the eval priority from the request URL query if present.\n\tevalPriority, err := parseInt(req, \"eval_priority\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Identify the no_shutdown_delay query param and parse.\n\tnoShutdownDelayStr := req.URL.Query().Get(\"no_shutdown_delay\")\n\tvar noShutdownDelay bool\n\tif noShutdownDelayStr != \"\" {\n\t\tvar err error\n\t\tnoShutdownDelay, err = strconv.ParseBool(noShutdownDelayStr)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Failed to parse value of %qq (%v) as a bool: %v\", \"no_shutdown_delay\", noShutdownDelayStr, err)\n\t\t}\n\t}\n\targs.NoShutdownDelay = noShutdownDelay\n\n\t// Validate the evaluation priority if the user supplied a non-default\n\t// value. It's more efficient to do it here, within the agent rather than\n\t// sending a bad request for the server to reject.\n\tif evalPriority != nil && *evalPriority > 0 {\n\t\tif err := validateEvalPriorityOpt(*evalPriority); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\targs.EvalPriority = *evalPriority\n\t}\n\n\ts.parseWriteRequest(req, &args.WriteRequest)\n\n\tvar out structs.JobDeregisterResponse\n\tif err := s.agent.RPC(\"Job.Deregister\", &args, &out); err != nil {","sourceCodeStart":641,"sourceCodeEnd":677,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/job_endpoint.go#L641-L677","documentation":"jobDelete (command/agent/job_endpoint.go:659) parses the ?no_shutdown_delay= query parameter with strconv.ParseBool and wraps failures in this error. Note the format string contains a typo (%qq instead of %q), so the field name is rendered with a stray 'q' in the message. The delete request is rejected; the job keeps its existing shutdown-delay behavior.","triggerScenarios":"DELETE /v1/job/<job-id>?no_shutdown_delay=<bad value> — e.g. no_shutdown_delay=yes, no_shutdown_delay=skip, no_shutdown_delay=0.0. Any non-empty string outside strconv.ParseBool's accepted literal set triggers it.","commonSituations":"Scripts passing human words ('skip', 'yes') for shutdown-delay override; clients passing a numeric 0/1.0 pair where '1.0' fails; query strings built from YAML/JSON config where the value was typed as a string instead of bool.","solutions":["Send no_shutdown_delay=true or no_shutdown_delay=false (1/0/t/f variants also accepted).","Omit the parameter to leave the job's shutdown delay unchanged.","Ignore the stray 'q' in the message; it is a formatting typo — the quoted field is still no_shutdown_delay and %v shows the bad value.","Fix the serializing client to emit Go-acceptable boolean strings."],"exampleFix":"// before\ncurl -X DELETE 'http://127.0.0.1:4646/v1/job/web?no_shutdown_delay=yes'\n// after\ncurl -X DELETE 'http://127.0.0.1:4646/v1/job/web?no_shutdown_delay=true'","handlingStrategy":"validation","validationCode":"// Before DELETE with no_shutdown_delay\nif nsd != \"\" {\n    if _, err := strconv.ParseBool(nsd); err != nil {\n        return fmt.Errorf(\"no_shutdown_delay must be a bool, got %q\", nsd)\n    }\n}","typeGuard":"func isNoShutdownDelayParam(s string) bool {\n    _, err := strconv.ParseBool(s)\n    return s == \"\" || err == nil\n}","tryCatchPattern":"resp, err := httpDo(http.MethodDelete, jobURL+\"?no_shutdown_delay=\"+nsd, nil)\nif err != nil { return err }\nif resp.StatusCode == 400 {\n    // message contains a formatting typo (%qq) but cause is the same: bad bool\n    return deleteJob(jobID, \"no_shutdown_delay=false\")\n}","preventionTips":["Send no_shutdown_delay=true or false only; numeric 0/1.0 will fail ('1.0' is invalid).","Treat the stray 'q' in the error message as cosmetic; the failing field is still no_shutdown_delay.","Omit the param unless overriding shutdown delay is intended.","Type config values as booleans upstream, not strings."],"tags":["http","query-parameter","boolean","job-delete","nomad"],"backgroundTag":"invalid-query-parameter","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}