infiniflow/ragflow · error
Invoke: invalid proxy URL %q: %v
Error message
Invoke: invalid proxy URL %q: %v
What it means
mustParseProxy panics when url.Parse rejects the operator-configured proxy string for the Invoke component. The helper intentionally crashes loudly because a malformed proxy URL is a deployment/configuration error, not a runtime data error: requests would otherwise silently bypass or break the proxy. The panic message embeds the offending raw string and the parse error.
Source
Thrown at internal/agent/component/invoke.go:450
}
}
// Outputs returns the response surface.
func (i *InvokeComponent) Outputs() map[string]string {
return map[string]string{
"result": "Response body as text.",
}
}
// mustParseProxy parses a proxy URL string. We keep this helper here
// (rather than calling url.Parse inline) so the panic-on-bad-input
// behavior is uniform across the package — proxy strings are operator-
// configured, a malformed one is a deployment error worth crashing
// loud on.
func mustParseProxy(raw string) *url.URL {
u, err := url.Parse(raw)
if err != nil {
panic(fmt.Sprintf("Invoke: invalid proxy URL %q: %v", raw, err))
}
// Defensive check: net/http.ProxyURL will silently no-op on a
// URL with no Host. Surface a clear panic instead.
if u.Host == "" {
panic(fmt.Sprintf("Invoke: proxy URL %q has no host", raw))
}
return u
}
// stripHTMLTags removes HTML tags from the input string. This is a
// best-effort implementation — it uses a simple regexp to remove
// everything between < and >. It is NOT a full HTML sanitizer and
// should only be used for cleaning up response text for consumption
// by downstream LLM nodes.
// Mirrors Python's `strip_html_tags` helper (invoke.py).
func stripHTMLTags(s string) string {
// Simple regexp-based approach: remove everything between < and >
re := strings.NewReplacer(View on GitHub (pinned to 554fb1133a)
Solutions
- Correct the proxy URL so it is a valid absolute URL, e.g. http://proxy.example.com:8080 or socks5://host:1080
- Remove stray whitespace, newlines, or unescaped percent signs introduced by templating/config files
- If the value comes from an env var or secret, print it with %q to spot invisible characters, then fix at the source
- Validate proxy strings with url.Parse in a pre-deploy config check before the workflow runs
Example fix
// before proxy: "http//proxy.corp:8080 %zz" // panic: Invoke: invalid proxy URL // after proxy: "http://proxy.corp:8080"
Defensive patterns
Strategy: validation
Validate before calling
if _, err := url.Parse(raw); err != nil {
return fmt.Errorf("invalid proxy URL %q: %w", raw, err)
} Prevention
- url.Parse every proxy string in a config-validation step before deploying the workflow
- Template proxy values from a single well-tested source rather than free-form fields
- Log proxy config with %q at startup to expose hidden whitespace/control characters
When it happens
Trigger: Configuring the Invoke component's proxy parameter with a string url.Parse cannot handle (control characters, invalid percent-escapes such as '%zz', embedded whitespace/newlines); the panic occurs when the proxy URL is parsed during component setup/invocation.
Common situations: Typo'd proxy in a canvas/workflow JSON (e.g. 'http//proxy:8080' copied with unescaped characters), secrets templating that leaves a newline in the value, hand-edited YAML/JSON config with stray quotes or whitespace, or environment-injected proxy values containing invalid escape sequences.
Related errors
- Invoke: proxy URL %q has no host
- Invalid Moodle API response
- failed to initialize logger: {err}
- ListOperations: nth requires n to be within the valid range
- ListOperations: head requires n to be within the valid range
AI-assisted analysis of infiniflow/ragflow@554fb1133a (2026-08-15).
Data as JSON: /api/errors/31e2173efa9c6f2a.
Report an issue: GitHub.