cloudflare/cloudflared · error

unsupported error type: %s

Error message

unsupported error type: %s

What it means

dispatchRequest builds the response payload for an incoming edge request based on request.Type. When the request type is not one of the known types (e.g. not a connection flow/rpc type), it returns an "unsupported error type" error so the caller (handleDataStream) can report an unknown request class back to the edge. This guards against protocol drift where the edge sends a request type this cloudflared version does not implement.

Source

Thrown at connection/quic_connection.go:245

	case pogs.ConnectionTypeHTTP, pogs.ConnectionTypeWebsocket:
		tracedReq, err := buildHTTPRequest(ctx, request, stream, q.connIndex, q.logger)
		if err != nil {
			return err, false
		}
		w := newHTTPResponseAdapter(stream)
		return originProxy.ProxyHTTP(&w, tracedReq, request.Type == pogs.ConnectionTypeWebsocket), w.connectResponseSent

	case pogs.ConnectionTypeTCP:
		rwa := &streamReadWriteAcker{RequestServerStream: stream}
		metadata := request.MetadataMap()
		return originProxy.ProxyTCP(ctx, rwa, &TCPRequest{
			Dest:      request.Dest,
			FlowID:    metadata[QUICMetadataFlowID],
			CfTraceID: metadata[tracing.TracerContextName],
			ConnIndex: q.connIndex,
		}), rwa.connectResponseSent
	default:
		return fmt.Errorf("unsupported error type: %s", request.Type), false
	}
}

// UpdateConfiguration is the RPC method invoked by edge when there is a new configuration
func (q *quicConnection) UpdateConfiguration(ctx context.Context, version int32, config []byte) *pogs.UpdateConfigurationResponse {
	return q.orchestrator.UpdateConfig(version, config)
}

// streamReadWriteAcker is a light wrapper over QUIC streams with a callback to send response back to
// the client.
type streamReadWriteAcker struct {
	*rpcquic.RequestServerStream
	connectResponseSent bool
}

// AckConnection acks response back to the proxy.
func (s *streamReadWriteAcker) AckConnection(tracePropagation string) error {
	metadata := []pogs.Metadata{}

View on GitHub (pinned to 2253eeeb25)

Solutions

  1. Upgrade cloudflared to the latest release so it understands the request types the edge sends
  2. If you operate a fixed cloudflared version, pin a compatible edge protocol via Cloudflare support
  3. Check cloudflared logs for the exact %s value reported to identify the unknown request type
  4. Report persistent occurrences to Cloudflare support with the request type string

Example fix

// before
default:
	return fmt.Errorf("unsupported error type: %s", request.Type), false
// after
default:
	// keep old behavior but log the unknown type for diagnostics
	q.logger.Error().Msgf("unsupported request type: %s", request.Type)
	return fmt.Errorf("unsupported error type: %s", request.Type), false
Defensive patterns

Strategy: try-catch

Validate before calling

// Go has no runtime enum for request.Type; keep a known-types set and check before dispatch
var knownRequestTypes = map[string]bool{"flowRPC": true, "webSocket": true}
if !knownRequestTypes[request.Type] {
	log.Printf("skipping unknown request type %q", request.Type)
}

Try / catch

if _, err := dispatchRequest(ctx, req); err != nil {
	if strings.HasPrefix(err.Error(), "unsupported error type") {
		// log and continue; likely version skew — schedule an upgrade check
		log.Warn(err)
	} else {
		return err
	}
}

Prevention

When it happens

Trigger: An edge request arrives via handleDataStream whose request.Type does not match any known case in dispatchRequest's switch (e.g. a newer edge protocol request type hitting an older cloudflared binary, or a corrupted/unexpected request metadata payload).

Common situations: Running a stale cloudflared version against a newer edge that emits new request types; protocol/version skew during rolling deploys; custom or intermediate proxies replaying malformed tunnel frames.

Related errors


AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06). Data as JSON: /api/errors/923f21a614678aae. Report an issue: GitHub.