{"record":{"id":"cb0806257518d674","repo":"kovidgoyal/kitty","slug":"s-does-not-exist","errorCode":null,"errorMessage":"%s does not exist","messagePattern":"(.+?) does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/ssh/config.go","lineNumber":192,"sourceCode":"\t}\n\tans := os.ExpandEnv(paths_ctx.ExpandHome(spec))\n\tif !filepath.IsAbs(ans) {\n\t\tans = paths_ctx.AbspathFromHome(ans)\n\t}\n\tif is_glob {\n\t\tfiles, err := doublestar.FilepathGlob(ans)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"%s is not a valid glob pattern with error: %w\", spec, err)\n\t\t}\n\t\tif len(files) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"%s matches no files\", spec)\n\t\t}\n\t\treturn files, nil\n\t}\n\terr := unix.Access(ans, unix.R_OK)\n\tif err != nil {\n\t\tif errors.Is(err, os.ErrNotExist) {\n\t\t\treturn nil, fmt.Errorf(\"%s does not exist\", spec)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"Cannot read from: %s with error: %w\", spec, err)\n\t}\n\treturn []string{ans}, nil\n}\n\nfunc get_arcname(loc, dest, home string) (arcname string) {\n\tif dest != \"\" {\n\t\tarcname = dest\n\t} else {\n\t\tarcname = filepath.Clean(loc)\n\t\tif strings.HasPrefix(arcname, home) {\n\t\t\tra, err := filepath.Rel(home, arcname)\n\t\t\tif err == nil {\n\t\t\t\tarcname = ra\n\t\t\t}\n\t\t}\n\t}","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/ssh/config.go#L174-L210","documentation":"For non-glob file specs, resolve_file_spec checks readability with unix.Access(R_OK). If the error is os.ErrNotExist, this specific 'does not exist' message naming the spec is returned (other access errors get a different message).","triggerScenarios":"A copy: or env copy_from_local spec pointing at a path that does not exist on the local machine, after home-relative resolution.","commonSituations":"Relative paths being resolved against the wrong home (~ of the wrong user, sudo vs user), files not yet created, or deleted files referenced by stale config.","solutions":["Check the absolute path after home expansion actually exists","Fix relative vs absolute path confusion — specs are resolved via AbspathFromHome","Create the missing file or remove the copy directive"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, err := os.Stat(paths_ctx.AbspathFromHome(spec)); errors.Is(err, os.ErrNotExist) { /* reject early */ }","typeGuard":"func fileExists(p string) bool { _, err := os.Stat(p); return err == nil }","tryCatchPattern":null,"preventionTips":["Expand home-relative paths explicitly and verify existence","Keep configs in sync when local files move or are deleted"],"tags":["filesystem","config","validation","ssh"],"backgroundTag":"file-not-found","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}