{"record":{"id":"411faa148323dc0e","repo":"weaviate/weaviate","slug":"unmarshal-meta-response-body-411faa","errorCode":null,"errorMessage":"unmarshal meta response body","messagePattern":"unmarshal meta response body","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/reranker-transformers/clients/ranker_meta.go","lineNumber":42,"sourceCode":"\treq, err := http.NewRequestWithContext(context.Background(), \"GET\", s.url(\"/meta\"), nil)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"create GET meta request\")\n\t}\n\n\tres, err := s.httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"send GET meta request\")\n\t}\n\tdefer res.Body.Close()\n\n\tbodyBytes, err := io.ReadAll(res.Body)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"read meta response body\")\n\t}\n\n\tvar resBody map[string]interface{}\n\tif err := json.Unmarshal(bodyBytes, &resBody); err != nil {\n\t\treturn nil, errors.Wrap(err, \"unmarshal meta response body\")\n\t}\n\treturn resBody, nil\n}\n","sourceCodeStart":24,"sourceCodeEnd":46,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/modules/reranker-transformers/clients/ranker_meta.go#L24-L46","documentation":"This error is wrapped around json.Unmarshal when parsing the HTTP response body from the reranker-transformers service's /meta endpoint. The MetaInfo call expects a JSON object (map[string]interface{}); if the body is not valid JSON or is not an object, this error is thrown. It indicates the inference container returned malformed or unexpected content.","triggerScenarios":"The /meta endpoint returns HTML (e.g. a proxy error page or 404 page), an empty body, truncated JSON, or a JSON array/string instead of an object. Also occurs when a wrong URL points at a non-inference service.","commonSituations":"Misconfigured RANKER_TRANSFORMERS_INFERENCE_URL pointing to the wrong port or service, a reverse proxy returning an error page, an outdated or incompatible reranker-transformers container version whose /meta route changed, or network middleware intercepting the request.","solutions":["Verify the URL in RANKER_TRANSFORMERS_INFERENCE_URL resolves to the reranker-transformers inference container, not another service or proxy.","Curl the /.well-known/ready and /meta endpoints directly from inside the cluster/network to inspect the raw response.","Check reranker-transformers container logs for panics or route changes and ensure the container version is compatible with your Weaviate version.","Retry after fixing: MetaInfo failures here are usually environmental, not a Weaviate code bug."],"exampleFix":"// before (misconfigured)\nRANKER_TRANSFORMERS_INFERENCE_URL=http://localhost:9999\n// after\nRANKER_TRANSFORMERS_INFERENCE_URL=http://reranker-transformers:8080","handlingStrategy":"validation","validationCode":"resp, err := http.Get(metaURL)\nif err != nil { return err }\nbody, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20))\nresp.Body.Close()\nvar probe map[string]interface{}\nif err := json.Unmarshal(body, &probe); err != nil {\n    return fmt.Errorf(\"meta endpoint did not return valid JSON object (status %d): %s\", resp.StatusCode, string(body[:min(len(body),200)]))\n}","typeGuard":"func isJSONObject(b []byte) bool {\n    var v map[string]interface{}\n    return json.Unmarshal(b, &v) == nil\n}","tryCatchPattern":null,"preventionTips":["Point the inference URL directly at the reranker-transformers container, not through proxies that can return HTML error pages.","Curl /meta once after deploying the container to confirm JSON output.","Pin compatible module/container versions."],"tags":["network","json","inference-container"],"backgroundTag":"invalid-json-response","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"}