{"record":{"id":"7e695fde1cb272d2","repo":"mislav/hub","slug":"unknown-config-s","errorCode":null,"errorMessage":"Unknown config %s","messagePattern":"Unknown config (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"git/git.go","lineNumber":262,"sourceCode":"\tremoteCmd.Stderr = nil\n\toutput, err := remoteCmd.Output()\n\treturn outputLines(output), err\n}\n\nfunc Config(name string) (string, error) {\n\treturn gitGetConfig(name)\n}\n\nfunc ConfigAll(name string) ([]string, error) {\n\tmode := \"--get-all\"\n\tif strings.Contains(name, \"*\") {\n\t\tmode = \"--get-regexp\"\n\t}\n\n\tconfigCmd := gitCmd(gitConfigCommand([]string{mode, name})...)\n\toutput, err := configCmd.Output()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"Unknown config %s\", name)\n\t}\n\treturn outputLines(output), nil\n}\n\nfunc GlobalConfig(name string) (string, error) {\n\treturn gitGetConfig(\"--global\", name)\n}\n\nfunc SetGlobalConfig(name, value string) error {\n\t_, err := gitConfig(\"--global\", name, value)\n\treturn err\n}\n\nfunc gitGetConfig(args ...string) (string, error) {\n\tconfigCmd := gitCmd(gitConfigCommand(args)...)\n\toutput, err := configCmd.Output()\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"Unknown config %s\", args[len(args)-1])","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/mislav/hub/blob/5c547ed804368763064e51f3990851e267e88edd/git/git.go#L244-L280","documentation":"ConfigAll runs `git config --get-regexp <name>` (or `--get-all`) and returns the output lines. This error is returned whenever the underlying `git config` command exits non-zero, which the library interprets as 'the requested config key has no value or the git command failed'. It wraps the raw git exit status into a single error carrying only the config key name, discarding stderr details.","triggerScenarios":"Calling ConfigAll(name) where no config entries match the pattern, or where git itself fails (bad gitConfigCommand arguments, missing git binary config, permission errors on config files). Any non-zero exit from configCmd.Output() produces it.","commonSituations":"Reading an org or per-host setting that was never set (e.g. `github.user`, `hub.host`) before first run; typos in the config key; querying git config in a environment with no HOME set so the global config can't be read; running sync or knownGitHubHosts in CI with a bare/minimal git installation.","solutions":["Set the config key first: `git config --global <name> <value>` (e.g. git config --global github.user yourlogin).","Verify the key name/spelling; --get-regexp takes a pattern, so confirm the pattern matches existing keys via `git config --get-regexp <pattern>` manually.","Check that git is installed and the environment (HOME, XDG_CONFIG_HOME) allows reading user/system config.","In code, treat this error as 'unset' and fall back to a default or prompt the user instead of failing."],"exampleFix":"// before\nval, err := git.ConfigAll(\"github.user\")\nif err != nil { return err }\n// after\nval, err := git.ConfigAll(\"github.user\")\nif err != nil {\n    val = nil // treat as unset, use default or prompt\n}","handlingStrategy":"fallback","validationCode":"if err := exec.Command(\"git\", \"config\", \"--get-regexp\", \"github.user\").Run(); err != nil {\n    // key unset — use default before calling ConfigAll\n}","typeGuard":null,"tryCatchPattern":"val, err := git.ConfigAll(\"github.user\")\nif err != nil {\n    log.Printf(\"config github.user unset, using default\")\n    val = defaultVal\n}","preventionTips":["Set all required config keys during setup/onboarding scripts before running the tool.","Check key existence with `git config --get-regexp` before calling.","Document required keys and validate them at startup with a clear message."],"tags":["git","config","missing-config-key"],"backgroundTag":"git-config-key-not-found","analyzedSha":"5c547ed804368763064e51f3990851e267e88edd","analyzedAt":"2026-09-01T03:34:15.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}