hashicorp/nomad · warning

Pprof profile not found profile:

Pprof profile not found profile:

Error message

%s %s

What it means

Nomad's agent command package exposes pprof runtime profiles via HTTP. NewErrProfileNotFound wraps a failed pprof.Lookup(name) call, i.e. the requested profile name does not exist among Go's registered pprof profiles (goroutine, heap, allocs, threadcreate, block, mutex, trace, etc.). IsErrProfileNotFound detects it by string-matching the prefix 'Pprof profile not found profile:'.

Source

Thrown at command/agent/pprof/pprof.go:37

	"strings"
	"time"
)

type ReqType string

const (
	CmdReq    ReqType = "cmdline"
	CPUReq    ReqType = "cpu"
	TraceReq  ReqType = "trace"
	LookupReq ReqType = "lookup"

	ErrProfileNotFoundPrefix = "Pprof profile not found profile:"
)

// NewErrProfileNotFound returns a new error caused by a pprof.Lookup
// profile not being found
func NewErrProfileNotFound(profile string) error {
	return fmt.Errorf("%s %s", ErrProfileNotFoundPrefix, profile)
}

// IsErrProfileNotFound returns whether the error is due to a pprof profile
// being invalid
func IsErrProfileNotFound(err error) bool {
	return err != nil && strings.Contains(err.Error(), ErrProfileNotFoundPrefix)
}

// Cmdline responds with the running program's
// command line, with arguments separated by NUL bytes.
func Cmdline() ([]byte, map[string]string, error) {
	var buf bytes.Buffer
	fmt.Fprint(&buf, strings.Join(os.Args, "\x00"))

	return buf.Bytes(),
		map[string]string{
			"X-Content-Type-Options": "nosniff",
			"Content-Type":           "text/plain; charset=utf-8",

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Fix the profile name in the request URL to a valid pprof.Lookup name (goroutine, heap, allocs, threadcreate, block, mutex, trace)
  2. List available profiles by querying the pprof index page at /debug/pprof/ to see valid names
  3. If using a tool/scraper, update its profile list to match the runtime's registered profiles
  4. Check IsErrProfileNotFound(err) and return 404 to callers instead of a 500

Example fix

// before
curl http://localhost:4646/debug/pprof/heaps
// after
curl http://localhost:4646/debug/pprof/heap
Defensive patterns

Strategy: try-catch

Validate before calling

valid := map[string]bool{"goroutine":true,"heap":true,"allocs":true,"threadcreate":true,"block":true,"mutex":true,"trace":true}
if !valid[profileName] { return fmt.Errorf("unknown pprof profile: %s", profileName) }

Type guard

func IsErrProfileNotFound(err error) bool {
	return err != nil && strings.Contains(err.Error(), "Pprof profile not found profile:")
}

Try / catch

prof, err := Profile(name)
if err != nil {
	if IsErrProfileNotFound(err) {
		// treat as 404 / skip profile
		return nil
	}
	return err
}

Prevention

When it happens

Trigger: An HTTP request to the agent's pprof endpoint with an unrecognized profile name path (e.g. /debug/pprof/bogus), causing pprof.Lookup(name) to return nil and Profile to call NewErrProfileNotFound(profile).

Common situations: Typo in a profiling URL (heap vs heep), requesting a Go profile that requires a runtime build tag or is not registered (e.g. 'trace' vs 'cpuprofile'), automated tooling scraping a profile name not present in the Nomad agent's Go version.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/817c3bf9bd6f800f. Report an issue: GitHub.