{"record":{"id":"d67aea98a2f1d8ad","repo":"weaviate/weaviate","slug":"missing-required-url-param-additional","errorCode":null,"errorMessage":"missing required url param 'additional'","messagePattern":"missing required url param 'additional'","errorType":"http","errorClass":null,"httpStatus":400,"severity":"warning","filePath":"adapters/handlers/rest/clusterapi/indices.go","lineNumber":503,"sourceCode":"\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\targs := i.regexpObject.FindStringSubmatch(r.URL.Path)\n\t\tif len(args) != 4 {\n\t\t\thttp.Error(w, \"invalid URI\", http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tindex, shard, id := args[1], args[2], args[3]\n\n\t\tdefer r.Body.Close()\n\n\t\tif r.URL.Query().Get(\"check_exists\") != \"\" {\n\t\t\ti.checkExists(w, r, index, shard, id)\n\t\t\treturn\n\t\t}\n\n\t\tadditionalEncoded := r.URL.Query().Get(\"additional\")\n\t\tif additionalEncoded == \"\" {\n\t\t\thttp.Error(w, \"missing required url param 'additional'\",\n\t\t\t\thttp.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tadditionalBytes, err := base64.StdEncoding.DecodeString(additionalEncoded)\n\t\tif err != nil {\n\t\t\thttp.Error(w, \"base64 decode 'additional' param: \"+err.Error(),\n\t\t\t\thttp.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tselectPropertiesEncoded := r.URL.Query().Get(\"selectProperties\")\n\t\tif selectPropertiesEncoded == \"\" {\n\t\t\thttp.Error(w, \"missing required url param 'selectProperties'\",\n\t\t\t\thttp.StatusBadRequest)\n\t\t\treturn\n\t\t}\n","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/adapters/handlers/rest/clusterapi/indices.go#L485-L521","documentation":"The internal GET object handler requires the query parameter 'additional' (base64-encoded JSON of additional.Properties). If the parameter is absent or empty, the handler responds 'missing required url param additional' with HTTP 400. The internal protocol always sends it; its absence means the caller did not follow the internal API contract.","triggerScenarios":"GET /schema/{index}/shard/{shard}/objects/{id} without ?additional=<base64-json> (and without check_exists), e.g. a hand-written replication client or curl probe omitting the parameter.","commonSituations":"Manual testing with curl/browser against the internal port, custom replication code written against an older internal protocol that made 'additional' optional, or URL construction dropping query parameters.","solutions":["Always include ?additional= with the base64-encoded JSON of additional.Properties (e.g. base64 of {\"vector\":false}).","Use the official weaviate Go client / internal replication code path instead of hand-building the request.","If using check_exists, add the check_exists query param instead — that path skips the 'additional' requirement.","Compare with the request format used by the same Weaviate version's replication module to confirm parameter names."],"exampleFix":"// before\nurl := fmt.Sprintf(\"/schema/%s/shard/%s/objects/%s\", index, shard, id)\n// after\naddJSON, _ := json.Marshal(additional.Properties{Vector: true})\nurl := fmt.Sprintf(\"/schema/%s/shard/%s/objects/%s?additional=%s\", index, shard, id,\n    base64.StdEncoding.EncodeToString(addJSON))","handlingStrategy":"validation","validationCode":"// Build the query with url.Values so required params can't be dropped\nq := url.Values{}\nq.Set(\"additional\", base64.StdEncoding.EncodeToString(addJSON))\nif q.Get(\"additional\") == \"\" {\n    return fmt.Errorf(\"additional param required\")\n}","typeGuard":"func hasRequiredQuery(u *url.URL) bool {\n    return u.Query().Get(\"additional\") != \"\" && u.Query().Get(\"selectProperties\") != \"\"\n}","tryCatchPattern":"if resp.StatusCode == http.StatusBadRequest && strings.Contains(readBody(resp), \"missing required url param\") {\n    return fmt.Errorf(\"internal GET malformed: %s\", readBody(resp))\n}","preventionTips":["Use url.Values.Encode() to build query strings — never string concatenation","Mirror the internal API contract: always send both additional and selectProperties","Reuse the repo's replication client helpers rather than hand-building requests","Add a unit test asserting the built URL contains all required params"],"tags":["http-400","query-params","internal-api","missing-parameter"],"backgroundTag":"missing-query-parameter","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}