sipeed/picoclaw · error
Gateway not available
Error message
Gateway not available
What it means
Sent as a 503 by the WebSocket proxy handler when gatewayAvailableForProxy() reports the upstream gateway is not running or not reachable, so the proxy cannot forward the connection. A warning is also logged server-side.
Solutions
- Start or restart the gateway process the proxy depends on
- Verify the gateway's address/port configuration matches what the backend expects
- Retry the WebSocket connection once the gateway is up
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at web/backend/api/pico.go:155 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/22daec0e84606897.
Report an issue: GitHub.
Appendix: source
Thrown at web/backend/api/pico.go:155
if changed != nil {
resp["changed"] = *changed
}
if picoCfg.Token.String() != "" {
resp["configured"] = true
}
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(resp)
}
// handleWebSocketProxy wraps a reverse proxy to handle WebSocket connections.
// It relies on launcher dashboard auth, then injects the raw pico token only
// on the upstream gateway request.
func (h *Handler) handleWebSocketProxy() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if !h.gatewayAvailableForProxy() {
logger.Warnf("Gateway not available for WebSocket proxy")
http.Error(w, "Gateway not available", http.StatusServiceUnavailable)
return
}
upstreamProtocol := picoGatewayProtocol()
if upstreamProtocol == "" {
logger.Warn("Pico token unavailable for WebSocket proxy")
http.Error(w, "Pico channel not configured", http.StatusServiceUnavailable)
return
}
var origProtocol string
if prot := r.Header.Values(protocolKey); len(prot) > 0 {
origProtocol = prot[0]
}
h.createWsProxy(origProtocol, upstreamProtocol).ServeHTTP(w, r)
}
}View on GitHub (pinned to 49183d7e8d)