vitessio/vitess · error

missing value for 'path'

Error message

missing value for 'path'

What it means

Like the 'rate' case, the 'path' key in --pprof-profile-flag must be given as path=<value> so parseProfileFlag can set the profile output directory. A bare 'path' token (no '=') leaves no value to assign, so parsing fails immediately.

Source

Thrown at go/vt/servenv/pprof.go:116

	}

	for _, kv := range pf[1:] {
		var err error
		fields := strings.SplitN(kv, "=", 2)

		switch fields[0] {
		case "rate":
			if len(fields) == 1 {
				return nil, errors.New("missing value for 'rate'")
			}
			p.rate, err = strconv.Atoi(fields[1])
			if err != nil {
				return nil, fmt.Errorf("invalid profile rate %q: %v", fields[1], err)
			}

		case "path":
			if len(fields) == 1 {
				return nil, errors.New("missing value for 'path'")
			}
			p.path = fields[1]

		case "quiet":
			if len(fields) == 1 {
				p.quiet = true
				continue
			}

			p.quiet, err = strconv.ParseBool(fields[1])
			if err != nil {
				return nil, fmt.Errorf("invalid quiet flag %q: %v", fields[1], err)
			}
		case "waitSig":
			if len(fields) == 1 {
				p.waitSig = true
				continue
			}

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Set --pprof-profile-flag=path=/desired/dir
  2. Remove the bare 'path' token to use the default profile location
  3. Inspect the actual argv of the failing process to verify the flag content

Example fix

// before
--pprof-profile-flag=path,quiet
// after
--pprof-profile-flag=path=/tmp,quiet
Defensive patterns

Strategy: validation

Validate before calling

for _, kv := range strings.Split(profileFlag, ",") {
    if strings.HasPrefix(kv, "path") && !strings.Contains(kv, "=") {
        return errors.New("pprof flag 'path' needs a value: path=<dir>")
    }
}

Prevention

When it happens

Trigger: Starting a server with --pprof-profile-flag=path (or a list segment 'path' without '=dir').

Common situations: Misspelled or value-dropped flags in systemd/k8s configs; copying an example like path=/tmp without the value in a heredoc that ate the '=' argument.

Understand the failure class

Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/2623a803ac1c552c. Report an issue: GitHub.