{"record":{"id":"0ce3831624d9d5f4","repo":"portainer/portainer","slug":"missing-query-parameter","errorCode":null,"errorMessage":"Missing query parameter","messagePattern":"Missing query parameter","errorType":"validation","errorClass":"ErrMissingQueryParameter","httpStatus":400,"severity":"error","filePath":"pkg/libhttp/request/request.go","lineNumber":123,"sourceCode":"\treturn routeVar, nil\n}\n\n// RetrieveNumericRouteVariableValue returns the value of a route variable as an integer.\nfunc RetrieveNumericRouteVariableValue(request *http.Request, name string) (int, error) {\n\trouteVar, err := RetrieveRouteVariableValue(request, name)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn strconv.Atoi(routeVar)\n}\n\n// RetrieveQueryParameter returns the value of a query parameter as a string.\n// If optional is set to true, will not return an error when the query parameter is not found.\nfunc RetrieveQueryParameter(request *http.Request, name string, optional bool) (string, error) {\n\tqueryParameter := request.FormValue(name)\n\tif queryParameter == \"\" && !optional {\n\t\treturn \"\", errors.New(ErrMissingQueryParameter)\n\t}\n\n\treturn queryParameter, nil\n}\n\n// RetrieveNumericQueryParameter returns the value of a query parameter as an integer.\n// If optional is set to true, will not return an error when the query parameter is not found.\nfunc RetrieveNumericQueryParameter(request *http.Request, name string, optional bool) (int, error) {\n\tqueryParameter, err := RetrieveQueryParameter(request, name, optional)\n\tif err != nil {\n\t\treturn 0, err\n\t} else if queryParameter == \"\" && optional {\n\t\treturn 0, nil\n\t}\n\n\treturn strconv.Atoi(queryParameter)\n}\n","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/pkg/libhttp/request/request.go#L105-L141","documentation":"Error \"Missing query parameter\" thrown in portainer/portainer.","triggerScenarios":"Thrown at pkg/libhttp/request/request.go:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}