{"record":{"id":"7612e1eef84f3a1e","repo":"gastownhall/beads","slug":"reading-s-w","errorCode":null,"errorMessage":"reading %s: %w","messagePattern":"reading (.+?): %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/configfile/proxied_server_client_info.go","lineNumber":33,"sourceCode":"\tConfigPath  string              `json:\"config_path,omitempty\"`\n\tLogPath     string              `json:\"log_path,omitempty\"`\n\tPort        int                 `json:\"port,omitempty\"`\n\tIdleTimeout time.Duration       `json:\"idle_timeout,omitempty\"`\n\tExternal    *ExternalDoltConfig `json:\"external,omitempty\"`\n}\n\nfunc ProxiedServerClientInfoPath(beadsDir string) string {\n\treturn filepath.Join(beadsDir, ProxiedServerClientInfoFileName)\n}\n\nfunc LoadProxiedServerClientInfo(beadsDir string) (*ProxiedServerClientInfo, error) {\n\tpath := ProxiedServerClientInfoPath(beadsDir)\n\tdata, err := os.ReadFile(path) // #nosec G304 - controlled path\n\tif os.IsNotExist(err) {\n\t\treturn nil, nil\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reading %s: %w\", ProxiedServerClientInfoFileName, err)\n\t}\n\tvar info ProxiedServerClientInfo\n\tif err := json.Unmarshal(data, &info); err != nil {\n\t\treturn nil, fmt.Errorf(\"parsing %s: %w\", ProxiedServerClientInfoFileName, err)\n\t}\n\treturn &info, nil\n}\n\nfunc SaveProxiedServerClientInfo(beadsDir string, info *ProxiedServerClientInfo) error {\n\tif info == nil {\n\t\tinfo = &ProxiedServerClientInfo{}\n\t}\n\tdata, err := json.MarshalIndent(info, \"\", \"  \")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"marshaling %s: %w\", ProxiedServerClientInfoFileName, err)\n\t}\n\tpath := ProxiedServerClientInfoPath(beadsDir)\n\tif err := os.WriteFile(path, data, 0o600); err != nil {","sourceCodeStart":15,"sourceCodeEnd":51,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/configfile/proxied_server_client_info.go#L15-L51","documentation":"LoadProxiedServerClientInfo failed to read the proxied server client info JSON file and wraps the os.ReadFile error. A missing file is treated as \"no info\" (returns nil, nil), so this error means the file exists but could not be read — permissions, I/O error, or it is a directory. It surfaces when the tool tries to load connection info for a proxied Dolt server.","triggerScenarios":"Calling LoadProxiedServerClientInfo when ProxiedServerClientInfoFileName inside the beads dir exists but is unreadable by the current user, is a directory, or the filesystem returns an I/O error.","commonSituations":"File created by a different user (e.g. root ran bd once, then a normal user); stale file replaced by a directory; NFS/network filesystem hiccup; restrictive umask or sandboxed environment blocking read.","solutions":["Check ownership/permissions: ls -l .beads/proxied_server_client_info.json; chown/chmod so the current user can read it, or delete it and let the server re-create it.","If the path is a directory, remove it and restart the proxied server to regenerate the file.","Re-run the command that starts/registers the proxied server so SaveProxiedServerClientInfo rewrites the file.","Inspect the wrapped %w error for the exact OS reason (EACCES, EISDIR, EIO) and address accordingly."],"exampleFix":"// before\n# ls -l .beads/proxied_server_client_info.json -> owned by root\n// after\n# sudo chown $USER .beads/proxied_server_client_info.json","handlingStrategy":"try-catch","validationCode":"info, err := configfile.LoadProxiedServerClientInfo(beadsDir)\nif err != nil {\n    if perr, ok := err.(*fs.PathError); ok && perr.Err == syscall.EACCES {\n        log.Fatalf(\"cannot read proxied server info (permissions): %v\", perr)\n    }\n    return err\n}","typeGuard":null,"tryCatchPattern":"info, err := configfile.LoadProxiedServerClientInfo(beadsDir)\nif err != nil {\n    var perr *fs.PathError\n    if errors.As(err, &perr) {\n        log.Printf(\"proxied server info unreadable (%v); attempting regeneration\", perr.Err)\n        os.Remove(filepath.Join(beadsDir, configfile.ProxiedServerClientInfoFileName))\n    }\n    return err\n}","preventionTips":["Run all bd commands as the same user to avoid ownership mismatches","Do not replace the info file with a directory or symlink","Treat the file as machine-generated: never hand-edit or version-control it"],"tags":["filesystem","io","json","config"],"backgroundTag":"config-file-read-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}