{"record":{"id":"4b8e8521587c7117","repo":"weaviate/weaviate","slug":"build-payload-w","errorCode":null,"errorMessage":"build payload: %w","messagePattern":"build payload: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"usecases/telemetry/telemetry.go","lineNumber":217,"sourceCode":"\t\t\t\tWithField(\"action\", \"telemetry_push\").\n\t\t\t\tWithField(\"payload\", fmt.Sprintf(\"%+v\", payload)).\n\t\t\t\tError(err.Error())\n\t\t\treturn err\n\t\t}\n\t\ttel.logger.\n\t\t\tWithField(\"action\", \"telemetry_push\").\n\t\t\tWithField(\"payload\", fmt.Sprintf(\"%+v\", payload)).\n\t\t\tInfo(\"telemetry terminated\")\n\n\t\treturn nil\n\t}\n}\n\n// push sends telemetry data to the consumer url\nfunc (tel *Telemeter) push(ctx context.Context, payloadType string) (*Payload, error) {\n\tpayload, err := tel.buildPayload(ctx, payloadType)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"build payload: %w\", err)\n\t}\n\n\tb, err := json.Marshal(payload)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"marshal payload: %w\", err)\n\t}\n\n\turl, err := base64.StdEncoding.DecodeString(tel.consumer)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"decode url: %w\", err)\n\t}\n\n\tresp, err := http.Post(string(url), \"application/json\", bytes.NewReader(b))\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to send request: %w\", err)\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/telemetry/telemetry.go#L199-L235","documentation":"Weaviate's telemetry Telemeter.push() wraps any failure from buildPayload() with \"build payload: %w\". buildPayload collects used modules, object counts, collection counts, and client usage; any of those steps failing (module lookup, node status fetch, schema access) is bubbled up as this error. It is non-fatal: telemetry pushes happen on a background interval and a failed payload is simply logged.","triggerScenarios":"Periodic or startup/shutdown telemetry push (Telemeter.Start/Stop goroutine) calls push(), and buildPayload fails — e.g. tel.nodesStatusGetter.LocalNodeStatus returns an error, tel.schemaManager.GetSchemaSkipAuth fails, or getUsedModules fails while enumerating enabled modules.","commonSituations":"Telemetry push fires while the node is still starting or shutting down so the schema manager or node-status endpoint is unavailable; custom module configurations cause module enumeration errors; the cluster is in a degraded state so LocalNodeStatus cannot be served.","solutions":["Check the wrapped inner error in the log line; it names the failing sub-step (get used modules / get object count / get collections count) and fix that root cause.","If telemetry pushes during startup noise bother you, disable telemetry by setting ENABLE_TELEMETRY=false (or the telemetry enabled config) — pushes then never run.","Ensure the node is fully started and the schema is loaded; verify via the /v1/nodes endpoint that LocalNodeStatus works.","Verify module configuration (ENABLE_MODULES) references valid module names so getUsedModules does not fail."],"exampleFix":"// log shows: build payload: get object count: received nil node stats\n// after: ensure shards are loaded / node healthy before expecting counts,\n// or silence by disabling telemetry in config:\n// before\nENABLE_TELEMETRY=true\n// after\nENABLE_TELEMETRY=false","handlingStrategy":"fallback","validationCode":"import \"net/http\"\nresp, err := http.Get(\"http://localhost:8080/v1/nodes\")\nif err != nil || resp.StatusCode != 200 {\n    // node status unavailable; telemetry payload build will fail\n}","typeGuard":null,"tryCatchPattern":"if err := tel.PushTelemetry(ctx, telemetry.PayloadType.Periodic); err != nil {\n    var wrappedErr error\n    if errors.Unwrap(err) != nil { wrappedErr = errors.Unwrap(err) }\n    log.Warnf(\"telemetry push skipped (non-fatal): %v (cause: %v)\", err, wrappedErr)\n}","preventionTips":["Keep ENABLE_TELEMETRY=false in environments where node health is not guaranteed.","Treat telemetry errors as non-fatal log noise; never gate application logic on them.","Check the unwrapped cause to identify the failing sub-step."],"tags":["telemetry","go","weaviate"],"backgroundTag":"telemetry-payload-build-failed","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"}