JuliusBrussee/caveman · error
provider %q upstream URL must be an absolute URL with a host
Error message
provider %q upstream URL must be an absolute URL with a host
What it means
parseBaseURL requires an absolute URL with a non-empty host; the configured upstream for the named provider is relative or hostless, so there is no valid destination to proxy to.
Source
Thrown at proxy/providers/openaicompat/openaicompat.go:348
return fmt.Errorf("ambiguous escaped path sequence %s", escape)
}
}
return nil
}
func parseBaseURL(raw, provider string) (*url.URL, error) {
if strings.TrimSpace(raw) == "" {
return nil, fmt.Errorf("provider %q has no configured upstream URL", provider)
}
u, err := url.Parse(strings.TrimSpace(raw))
if err != nil {
return nil, err
}
if u.Scheme != "http" && u.Scheme != "https" {
return nil, fmt.Errorf("provider %q upstream URL scheme %q is not allowed", provider, u.Scheme)
}
if !u.IsAbs() || u.Host == "" || u.Hostname() == "" {
return nil, fmt.Errorf("provider %q upstream URL must be an absolute URL with a host", provider)
}
if u.User != nil {
return nil, fmt.Errorf("provider %q upstream URL must not include userinfo", provider)
}
if u.Fragment != "" {
return nil, fmt.Errorf("provider %q upstream URL must not include a fragment", provider)
}
if err := validatePathComponents(u.Path, u.RawPath); err != nil {
return nil, fmt.Errorf("provider %q upstream URL path rejected: %w", provider, err)
}
return u, nil
}
View on GitHub (pinned to 5184b3d11a)
Solutions
- Include scheme and host, e.g. https://api.example.com/v1
- Reject or fix config values missing the authority component
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at proxy/providers/openaicompat/openaicompat.go:305 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@5184b3d11a (2026-08-18).
Data as JSON: /api/errors/89077585981d47c6.
Report an issue: GitHub.