{"record":{"id":"91ca3777b555ecdf","repo":"netbirdio/netbird","slug":"expected-d-response-but-got-s","errorCode":null,"errorMessage":"expected %d response but got %s","messagePattern":"expected (.+?) response but got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/kubernetes.go","lineNumber":196,"sourceCode":"\tclusterURL, err := url.Parse(\"https://\" + fqdn)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tversionURL, err := clusterURL.Parse(\"/version\")\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, versionURL.String(), nil)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tresp, err := httpClient.Do(req)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, \"\", fmt.Errorf(\"expected %d response but got %s\", http.StatusOK, resp.Status)\n\t}\n\tb, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tversionData := map[string]string{}\n\terr = json.Unmarshal(b, &versionData)\n\tif err != nil {\n\t\treturn nil, \"\", err\n\t}\n\tversion, ok := versionData[\"gitVersion\"]\n\tif !ok {\n\t\treturn nil, \"\", errors.New(\"no version found in response\")\n\t}\n\treturn clusterURL, version, nil\n}\n\nfunc resolveKubeconfigPath(cmd *cobra.Command) (string, error) {","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/kubernetes.go#L178-L214","documentation":"The HTTPS /version probe sent to a peer's Kubernetes API endpoint returned a non-200 status. Fingerprinting uses the version endpoint to derive the cluster identity, so any error page or auth-challenge response (401, 403, 503) makes the cluster unfingerprintable.","triggerScenarios":"Thrown at client/cmd/kubernetes.go:196 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the returned status: 401/403 usually mean the API server requires auth for /version and the cluster cannot be fingerprinted this way","Confirm the peer's Kubernetes API is healthy and serving on the expected port","Verify network reachability to the peer before the fingerprint attempt"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","contentChangedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}