{"record":{"id":"53cb5b98e159e715","repo":"kovidgoyal/kitty","slug":"bad-config-lines-s-with-error-s","errorCode":null,"errorMessage":"Bad config lines: %s with error: %s","messagePattern":"Bad config lines: (.+?) with error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/ssh/main.go","lineNumber":912,"sourceCode":"\t\treturn 1, err\n\t}\n\tdefer func() {\n\t\tf.Close()\n\t\tos.Remove(f.Name())\n\t}()\n\t_, err = io.Copy(f, os.Stdin)\n\tif err != nil {\n\t\treturn 1, err\n\t}\n\tcd := &connection_data{\n\t\trequest_id: \"testing\", remote_args: []string{},\n\t\tusername: \"testuser\", hostname_for_match: \"host.test\", request_data: true,\n\t\ttest_script: args[0], echo_on: true,\n\t}\n\topts, bad_lines, err := load_config(cd.hostname_for_match, cd.username, nil, f.Name())\n\tif err == nil {\n\t\tif len(bad_lines) > 0 {\n\t\t\treturn 1, fmt.Errorf(\"Bad config lines: %s with error: %s\", bad_lines[0].Line, bad_lines[0].Err)\n\t\t}\n\t\tcd.host_opts = opts\n\t\terr = get_remote_command(cd)\n\t}\n\tif err != nil {\n\t\treturn 1, err\n\t}\n\tdata, err := json.Marshal(map[string]any{\"cmd\": cd.rcmd, \"shm_name\": cd.shm_name})\n\tif err == nil {\n\t\t_, err = os.Stdout.Write(data)\n\t\tos.Stdout.Close()\n\t}\n\tif err != nil {\n\t\treturn 1, err\n\t}\n\n\treturn\n}","sourceCodeStart":894,"sourceCodeEnd":930,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/ssh/main.go#L894-L930","documentation":"In the SSH kitten's self-test, load_config parsed a config file successfully but reported bad (unparseable) lines; the first bad line's content and parse error are reported. This mirrors real config-file syntax errors in ssh kitten config files.","triggerScenarios":"load_config() returns err == nil but bad_lines is non-empty — a config file contains a line with invalid syntax or an unknown option.","commonSituations":"Typos in ~/.config/kitty/ssh.conf or per-host INCLUDEd files; options from a newer/older kitty version; copy-pasted config with stray characters.","solutions":["Fix or remove the reported line in the config file (the error prints the exact line and reason)","Check option spelling against the kitty docs for your kitty version","Validate config after upgrades — option names change between kitty releases"],"exampleFix":"# before (ssh.conf)\nshare_cnx yes\n\n# after\nshare_connections yes","handlingStrategy":"validation","validationCode":"kitty +kitten ssh --config-file /dev/null host  # bypass suspicious config to isolate\nkitty +runpy 'from kittens.ssh.config import load_config' # smoke-test config loading","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Re-check ssh.conf syntax after kitty upgrades","Keep config minimal and version-controlled so bad lines are easy to spot"],"tags":["kitty","ssh","config","syntax-error"],"backgroundTag":"config-parse-error","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}