slimtoolkit/slim · error
invalid HTTP probe command: %s
Error message
invalid HTTP probe command: %s
What it means
ParseHTTPProbes splits each raw probe on ':' and supports 0-3 segments. If a raw string contains more than 3 colon-separated parts (default branch), it cannot be interpreted as proto:method:resource and the parser rejects it with this error.
Source
Thrown at pkg/app/master/command/clifvparser.go:635
return nil, fmt.Errorf("invalid HTTP probe command protocol: %+v", raw)
}
proto = strings.ToLower(parts[0])
if parts[1] != "" && !isMethod(parts[1]) {
return nil, fmt.Errorf("invalid HTTP probe command method: %+v", raw)
}
method = strings.ToUpper(parts[1])
if parts[2] == "" || !isResource(parts[2]) {
return nil, fmt.Errorf("invalid HTTP probe command resource: %+v", raw)
}
resource = parts[2]
default:
return nil, fmt.Errorf("invalid HTTP probe command: %s", raw)
}
cmd := config.HTTPProbeCmd{
Protocol: proto,
Method: method,
Resource: resource,
Crawl: crawl,
}
probes = append(probes, cmd)
}
return probes, nil
}
func ParseHTTPProbesFile(filePath string) ([]config.HTTPProbeCmd, error) {
probes := []config.HTTPProbeCmd{}
if filePath != "" {View on GitHub (pinned to 81940d17fa)
Solutions
- Reduce the probe to at most 3 colon-separated segments: PROTOCOL:METHOD:RESOURCE
- Escape or remove extra colons (ports, IPv6, query values) from the probe string
- Use the JSON probe config file (ParseHTTPProbesFile) instead, which takes structured fields and avoids colon splitting
Example fix
// before
GetHTTPProbes("http:GET:/api:8080/health")
// error: invalid HTTP probe command
// after
GetHTTPProbes("http:GET:/api/health") // put the port in a separate config field, not the resource string Defensive patterns
Strategy: validation
Validate before calling
if strings.Count(probe, ":") > 2 {
return fmt.Errorf("probe %q must have at most 3 colon-separated segments", probe)
} Try / catch
probes, err := GetHTTPProbes(raw)
if err != nil {
if strings.Contains(err.Error(), "invalid HTTP probe command:") {
return nil, fmt.Errorf("probe %q has too many ':' segments; move ports to config", raw)
}
return nil, err
} Prevention
- Never embed URLs with ports or IPv6 addresses in probe strings
- Strip scheme prefixes like 'http://' before passing (extra colons/slashes break parsing)
- Use the JSON probe config file for anything beyond PROTO:METHOD:PATH
When it happens
Trigger: GetHTTPProbes/ParseHTTPProbes called with a raw value like 'http:GET:/path:extra' (4+ parts), or URLs that embed unescaped colons such as 'http:GET:/a:b' or 'localhost:8080/health'.
Common situations: Users pasting full URLs with ports ('http://host:8080/x') into the probe field, IPv6 addresses with colons, or query strings containing ':' characters.
Related errors
- invalid HTTP probe command port: %v
- podPort cannot be empty
- unexpected HTTP status code
- file path is not absolute
- file is not a binary
AI-assisted analysis of slimtoolkit/slim@81940d17fa (2026-08-31).
Data as JSON: /api/errors/8fd288292a034620.
Report an issue: GitHub.