{"record":{"id":"4f70a4c2e6535433","repo":"netbirdio/netbird","slug":"could-not-determine-home-directory-w","errorCode":null,"errorMessage":"could not determine home directory: %w","messagePattern":"could not determine home directory: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/kubernetes.go","lineNumber":227,"sourceCode":"\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) {\n\tif cmd.Flags().Changed(\"kubeconfig\") {\n\t\tpath, err := cmd.Flags().GetString(\"kubeconfig\")\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn path, nil\n\t}\n\tif env := os.Getenv(\"KUBECONFIG\"); env != \"\" {\n\t\treturn env, nil\n\t}\n\thome, err := os.UserHomeDir()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"could not determine home directory: %w\", err)\n\t}\n\treturn filepath.Join(home, \".kube\", \"config\"), nil\n}\n\nfunc writeKubeconfig(kubeconfigPath string, kc kubernetesCluster) error {\n\tb, err := os.ReadFile(kubeconfigPath)\n\tif err != nil && !errors.Is(err, os.ErrNotExist) {\n\t\treturn err\n\t}\n\tvar cfg map[string]any\n\tif err := yaml.Unmarshal(b, &cfg); err != nil {\n\t\treturn err\n\t}\n\tif cfg == nil {\n\t\tcfg = map[string]any{\n\t\t\t\"apiVersion\": \"v1\",\n\t\t\t\"kind\":       \"Config\",\n\t\t}","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/kubernetes.go#L209-L245","documentation":"Error \"could not determine home directory: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/cmd/kubernetes.go:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}