{"record":{"id":"beff76c8bc7534c0","repo":"wavetermdev/waveterm","slug":"wcloud-endpoint-not-set","errorCode":null,"errorMessage":"wcloud endpoint not set","messagePattern":"wcloud endpoint not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/wcloud/wcloud.go","lineNumber":93,"sourceCode":"\tif !wavebase.IsDevMode() {\n\t\treturn WCloudEndpoint\n\t}\n\tendpoint := WCloudEndpoint_VarCache\n\treturn endpoint\n}\n\nfunc GetPingEndpoint() string {\n\tif !wavebase.IsDevMode() {\n\t\treturn WCloudPingEndpoint\n\t}\n\tendpoint := WCloudPingEndpoint_VarCache\n\treturn endpoint\n}\n\nfunc makeAnonPostReq(ctx context.Context, apiUrl string, data interface{}) (*http.Request, error) {\n\tendpoint := GetEndpoint()\n\tif endpoint == \"\" {\n\t\treturn nil, errors.New(\"wcloud endpoint not set\")\n\t}\n\tvar dataReader io.Reader\n\tif data != nil {\n\t\tbyteArr, err := json.Marshal(data)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error marshaling json for %s request: %v\", apiUrl, err)\n\t\t}\n\t\tdataReader = bytes.NewReader(byteArr)\n\t}\n\tfullUrl := GetEndpoint() + apiUrl\n\treq, err := http.NewRequestWithContext(ctx, \"POST\", fullUrl, dataReader)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating %s request: %v\", apiUrl, err)\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"X-PromptAPIVersion\", strconv.Itoa(APIVersion))\n\treq.Header.Set(\"X-PromptAPIUrl\", apiUrl)\n\treq.Close = true","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wcloud/wcloud.go#L75-L111","documentation":"wcloud's makeAnonPostReq builds an HTTP request but first checks GetEndpoint(); if the wcloud endpoint configuration is empty (\"\"), it refuses to make the call and returns this error. It prevents anonymous telemetry/event posts from being sent to a bogus relative URL. Callers include sendTEventsBatch, sendTelemetry, and SendNoTelemetryUpdate.","triggerScenarios":"Calling wcloud telemetry APIs (SendTelemetry, SendTEventsBatch, SendNoTelemetryUpdate) when the endpoint config value is unset, empty string, or explicitly cleared (often used intentionally to disable telemetry).","commonSituations":"Fresh installs with no wcloud endpoint configured; dev/offline builds; ops intentionally blanking the endpoint to disable cloud telemetry; config migrations dropping the endpoint key.","solutions":["Check GetEndpoint() before sending and skip telemetry calls when empty — treat unset endpoint as 'telemetry disabled'.","Set the wcloud endpoint configuration value to the correct URL for your environment.","If telemetry should be disabled, gate the calling code on the config flag instead of letting it error.","Verify no config migration/reset wiped the endpoint key."],"exampleFix":"// before\nerr := wcloud.SendTelemetry(telemetryData)\nif err != nil {\n    return err\n}\n// after\nif wcloud.GetEndpoint() == \"\" {\n    return nil // telemetry disabled\n}\nerr := wcloud.SendTelemetry(telemetryData)\nif err != nil {\n    return err\n}","handlingStrategy":"fallback","validationCode":"if wcloud.GetEndpoint() == \"\" {\n    // endpoint unset: telemetry disabled\n    return nil\n}","typeGuard":null,"tryCatchPattern":"err := wcloud.SendTelemetry(data)\nif err != nil && strings.Contains(err.Error(), \"wcloud endpoint not set\") {\n    log.Printf(\"telemetry skipped: endpoint not configured\")\n    return nil // non-fatal\n}\nif err != nil {\n    return err\n}","preventionTips":["Gate all telemetry calls on GetEndpoint() != \"\" at startup.","Treat unset endpoint as intentional telemetry-disable, not a failure.","Include the endpoint value in deployment config checklists/health checks.","Send telemetry asynchronously so a misconfiguration never blocks the main flow."],"tags":["go","network","telemetry","configuration","http"],"backgroundTag":"missing-env-var","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}