{"record":{"id":"1a3503a42da4e22c","repo":"rqlite/rqlite","slug":"query-parameter-not-set","errorCode":null,"errorMessage":"query parameter not set","messagePattern":"query parameter not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"http/query_params.go","lineNumber":56,"sourceCode":"\t\t\t_, err := time.ParseDuration(t)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"%s is not a valid duration\", k)\n\t\t\t}\n\t\t}\n\t}\n\tfor _, k := range []string{\"retries\", \"trailing_logs\"} {\n\t\tr, ok := qp[k]\n\t\tif ok {\n\t\t\t_, err := strconv.Atoi(r)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"%s is not a valid integer\", k)\n\t\t\t}\n\t\t}\n\t}\n\tq, ok := qp[\"q\"]\n\tif ok {\n\t\tif q == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"query parameter not set\")\n\t\t}\n\t}\n\treturn qp, nil\n}\n\n// Timings returns true if the query parameters indicate timings should be returned.\nfunc (qp QueryParams) Timings() bool {\n\treturn qp.HasKey(\"timings\")\n}\n\n// Tx returns true if the query parameters indicate the query should be executed in a transaction.\nfunc (qp QueryParams) Tx() bool {\n\treturn qp.HasKey(\"transaction\")\n}\n\n// Queue returns true if the query parameters request queued operation\nfunc (qp QueryParams) Queue() bool {\n\treturn qp.HasKey(\"queue\")","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/rqlite/rqlite/blob/7586a4d1bdbd9a5a80021664c5a863cd850adb60/http/query_params.go#L38-L74","documentation":"Sentinel validation error raised by NewQueryParams in http/query_params.go:56. After parsing optional duration and integer parameters, it checks the 'q' query parameter: if the key is present but its value is the empty string, the request is rejected with this error. It fires whenever a client explicitly passes an empty 'q' parameter (e.g. '?q=') — the caller (ServeHTTP, forwarded requests, or tests via mustGetQueryParams) receives a nil QueryParams and must surface the error instead of executing a statement. The correct fix is for the client to omit 'q' entirely or supply a non-empty SQL statement.","triggerScenarios":"Thrown at http/query_params.go:56 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-empty SQL statement in the q parameter, e.g. ?q=SELECT * FROM foo","Remove the empty q parameter if the statement is sent in the request body instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7586a4d1bdbd9a5a80021664c5a863cd850adb60","analyzedAt":"2026-09-03T07:03:02.260Z","contentChangedAt":"2026-09-03T07:03:02.260Z","schemaVersion":2},"datasetVersion":"2026-09-10T12:17:11.382Z"}