{"record":{"id":"1da60f73a96793e1","repo":"junegunn/fzf","slug":"failed-to-start-pprof-profiles-s","errorCode":null,"errorMessage":"failed to start pprof profiles: %s","messagePattern":"failed to start pprof profiles: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/options.go","lineNumber":3890,"sourceCode":"\t\t\t}\n\t\t\topts.MinHeight += borderLines(borderShape) + opts.HeaderLines\n\t\t}\n\t\tif len(opts.Preview.command) > 0 && (opts.Preview.position == posUp || opts.Preview.position == posDown) && opts.Preview.Visible() && opts.Preview.position == posUp {\n\t\t\tborderShape := opts.Preview.border\n\t\t\tif opts.Preview.border == tui.BorderLine {\n\t\t\t\tborderShape = tui.BorderTop\n\t\t\t}\n\t\t\topts.MinHeight += borderLines(borderShape) + 10\n\t\t}\n\t\tfor _, s := range []sizeSpec{opts.Margin[0], opts.Margin[2], opts.Padding[0], opts.Padding[2]} {\n\t\t\tif !s.percent {\n\t\t\t\topts.MinHeight += int(s.size)\n\t\t\t}\n\t\t}\n\t}\n\n\tif err := opts.initProfiling(); err != nil {\n\t\treturn errors.New(\"failed to start pprof profiles: \" + err.Error())\n\t}\n\n\talgo.Init(opts.Scheme)\n\n\treturn nil\n}\n\nfunc parseShellWords(str string) ([]string, error) {\n\tparser := shellwords.NewParser()\n\tparser.ParseComment = true\n\treturn parser.Parse(str)\n}\n\n// ParseOptions parses command-line options\nfunc ParseOptions(useDefaults bool, args []string) (*Options, error) {\n\topts := defaultOptions()\n\tindex := 0\n","sourceCodeStart":3872,"sourceCodeEnd":3908,"githubUrl":"https://github.com/junegunn/fzf/blob/bd4efa277b49ef34ca4025bff9b1a288e1980eff/src/options.go#L3872-L3908","documentation":"fzf failed to start the pprof CPU/blockprofileng profiles requested via --profile-cpu, --profile-mem, or --profile-block. opts.initProfiling() returned an error (typically a file creation/open failure for a profile path), and options.go:3890 wraps it as 'failed to start pprof profiles: <cause>'.","triggerScenarios":"Passing --profile-cpu (or mem/block) pointing to a path in a nonexistent directory, a path without write permission, or a directory instead of a file: os.Create inside initProfiling fails and the wrapped error is returned during option finalization.","commonSituations":"Profiling in containers or restricted environments where the target directory is read-only; relative profile paths resolved from an unexpected working directory; disk full; leftover root-owned profile files from a previous sudo run.","solutions":["Check the wrapped cause: 'no such file or directory' means the parent directory must be created; 'permission denied' means fixing ownership/permissions","Use an absolute path in a writable directory, e.g. --profile-cpu=/tmp/fzf.pprof","Ensure the path names a file (not a directory) and the disk is not full","Remove stale root-owned profile files from earlier sudo runs"],"exampleFix":"# before\nfzf --profile-cpu=/var/log/fzf/cpu.pprof\n# after\nmkdir -p /tmp/fzf-prof && fzf --profile-cpu=/tmp/fzf-prof/cpu.pprof","handlingStrategy":"try-catch","validationCode":"# Shell: ensure the profile directory is writable before launch\nprof_dir=/tmp/fzf-prof\nmkdir -p \"$prof_dir\" && [ -w \"$prof_dir\" ] || { echo \"cannot write $prof_dir\" >&2; exit 1; }\nexec fzf --profile-cpu=\"$prof_dir/cpu.pprof\"","typeGuard":null,"tryCatchPattern":"In Go, capture exec.ExitError stderr; if it starts with 'failed to start pprof profiles:', surface the wrapped cause (usually 'no such file or directory' or 'permission denied') and fail fast — retrying will not help until the path is fixed.","preventionTips":["Use absolute profile paths under a directory you create first (/tmp is safe)","Check directory writability and disk space before starting a profiled run","Never reuse root-owned files left by sudo runs; delete stale profile files","Profiles are debug-only flags — keep them out of production wrappers"],"tags":["fzf","cli","profiling","pprof","filesystem"],"backgroundTag":null,"analyzedSha":"bd4efa277b49ef34ca4025bff9b1a288e1980eff","analyzedAt":"2026-08-15T06:11:46.983Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}