juicedata/juicefs · error
failed to get pprof port: %v
Error message
failed to get pprof port: %v
What it means
Returned by collectPprof during `juicefs debug` when the pprof port of the target mount process cannot be determined (port discovery via the agent or process inspection failed). Without the port no profiling data can be fetched.
Source
Thrown at cmd/debug.go:362
}
defer closeFile(file)
if _, err := io.Copy(writer, file); err != nil {
return err
}
}
return nil
})
}
func collectPprof(ctx *cli.Context, cmd string, pid string, amp string, requireRootPrivileges bool, currDir string, wg *sync.WaitGroup) error {
if !checkAgent(cmd) {
logger.Warnf("No agent found, the pprof metrics will not be collected")
return nil
}
port, err := getPprofPort(pid, amp, requireRootPrivileges)
if err != nil {
return fmt.Errorf("failed to get pprof port: %v", err)
}
baseUrl := fmt.Sprintf("http://localhost:%d/debug/pprof/", port)
logger.Infof("The pprof base url: %s", baseUrl)
trace := ctx.Uint64("trace-sec")
profile := ctx.Uint64("profile-sec")
metrics := map[string]metricItem{
"allocs": {name: "allocs.pb.gz", url: baseUrl + "allocs"},
"blocks": {name: "block.pb.gz", url: baseUrl + "block"},
"cmdline": {name: "cmdline.txt", url: baseUrl + "cmdline"},
"goroutine": {name: "goroutine.pb.gz", url: baseUrl + "goroutine"},
"stack": {name: "goroutine.stack.txt", url: baseUrl + "goroutine?debug=1"},
"stack-detail": {name: "goroutine.stack.detail.txt", url: baseUrl + "goroutine?debug=2"},
"heap": {name: "heap.pb.gz", url: baseUrl + "heap"},
"mutex": {name: "mutex.pb.gz", url: baseUrl + "mutex"},
"threadcreate": {name: "threadcreate.pb.gz", url: baseUrl + "threadcreate"},
"trace": {name: fmt.Sprintf("trace.%ds.pb.gz", trace), url: fmt.Sprintf("%strace?seconds=%d", baseUrl, trace)},
"profile": {name: fmt.Sprintf("profile.%ds.pb.gz", profile), url: fmt.Sprintf("%sprofile?seconds=%d", baseUrl, profile)},
}View on GitHub (pinned to c9a67b23e8)
Solutions
- Verify the agent is running and the mount process exists
- Check that the debug agent port was registered for the mount
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at cmd/debug.go:362 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of juicedata/juicefs@c9a67b23e8 (2026-09-06).
Data as JSON: /api/errors/03ee19cfaf25de33.
Report an issue: GitHub.