{"record":{"id":"9ed7a61219a5732f","repo":"wavetermdev/waveterm","slug":"wcloud-ping-endpoint-not-set","errorCode":null,"errorMessage":"wcloud ping endpoint not set","messagePattern":"wcloud ping endpoint not set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/wcloud/wcloud.go","lineNumber":272,"sourceCode":"\treturn nil\n}\n\nfunc SendNoTelemetryUpdate(ctx context.Context, clientId string, noTelemetryVal bool) error {\n\treq, err := makeAnonPostReq(ctx, NoTelemetryUrl, NoTelemetryInputType{ClientId: clientId, Value: noTelemetryVal})\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = doRequest(req, nil, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\nfunc makePingPostReq(ctx context.Context, apiUrl string, data interface{}) (*http.Request, error) {\n\tendpoint := GetPingEndpoint()\n\tif endpoint == \"\" {\n\t\treturn nil, errors.New(\"wcloud ping 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 := endpoint + 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.Close = true\n\treturn req, nil","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/wcloud/wcloud.go#L254-L290","documentation":"makePingPostReq (used by SendDiagnosticPing) checks GetPingEndpoint() and returns this error when the dedicated ping endpoint configuration is empty. This is separate from the main wcloud endpoint, so the main endpoint may be set while the ping endpoint is missing. It guards diagnostic pings from being sent to an invalid URL.","triggerScenarios":"Calling wcloud.SendDiagnosticPing when GetPingEndpoint() returns \"\" — e.g. the ping endpoint config key was never set, was cleared, or only the main endpoint was configured.","commonSituations":"Deployments that configure the main wcloud endpoint but forget the separate ping endpoint; environment-specific configs where the ping URL differs per region and is missing in some; upgrades introducing the ping endpoint to existing configs.","solutions":["Set the ping endpoint configuration value (GetPingEndpoint's backing config key) to the correct URL.","Check GetPingEndpoint() == \"\" before calling SendDiagnosticPing and skip gracefully.","Confirm the config file/env actually carries the ping endpoint key — it is independent of the main endpoint.","Update deployment templates so new environments include both endpoint values."],"exampleFix":"// before\nerr := wcloud.SendDiagnosticPing(diagData)\nif err != nil {\n    return err\n}\n// after\nif wcloud.GetPingEndpoint() == \"\" {\n    return nil // ping endpoint not configured; skip diagnostic ping\n}\nerr := wcloud.SendDiagnosticPing(diagData)\nif err != nil {\n    return err\n}","handlingStrategy":"fallback","validationCode":"if wcloud.GetPingEndpoint() == \"\" {\n    // ping endpoint unset: skip diagnostic ping\n    return nil\n}","typeGuard":null,"tryCatchPattern":"err := wcloud.SendDiagnosticPing(data)\nif err != nil && strings.Contains(err.Error(), \"wcloud ping endpoint not set\") {\n    log.Printf(\"diagnostic ping skipped: ping endpoint not configured\")\n    return nil // non-fatal\n}\nif err != nil {\n    return err\n}","preventionTips":["Configure the ping endpoint separately from — and in addition to — the main wcloud endpoint.","Add both endpoint keys to environment/deployment templates.","Check GetPingEndpoint() before scheduling diagnostic pings.","Alert on empty ping endpoint in config validation at startup."],"tags":["go","network","configuration","diagnostics","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"}