cilium/cilium · error
failed marshalling UUID to %v: %w
Error message
failed marshalling UUID to %v: %w
What it means
AdvertisePath marshals the UUID returned by gobgp's AddPath reply into the agent Path's UUID bytes via resp[0].UUID.MarshalBinary(). This error means the binary UUID marshalling failed - the reply's UUID is malformed or of an unexpected type/version.
Source
Thrown at pkg/bgp/gobgp/server.go:242
func (g *GoBGPServer) AdvertisePath(ctx context.Context, p types.PathRequest) (types.PathResponse, error) {
gobgpPath, err := ToGoBGPPath(p.Path)
if err != nil {
return types.PathResponse{}, fmt.Errorf("failed converting Path to %v: %w", p.Path.NLRI, err)
}
resp, err := g.server.AddPath(apiutil.AddPathRequest{Paths: []*apiutil.Path{gobgpPath}})
if err != nil {
return types.PathResponse{}, fmt.Errorf("failed adding Path to %v: %w", gobgpPath.Nlri, err)
}
agentPath, err := ToAgentPath(gobgpPath)
if err != nil {
return types.PathResponse{}, fmt.Errorf("failed converting Path to %v: %w", gobgpPath.Nlri, err)
}
if len(resp) > 0 {
agentPath.UUID, err = resp[0].UUID.MarshalBinary()
if err != nil {
return types.PathResponse{}, fmt.Errorf("failed marshalling UUID to %v: %w", gobgpPath.Nlri, err)
}
} else {
return types.PathResponse{}, fmt.Errorf("empty AddPath reply for %v", gobgpPath.Nlri)
}
return types.PathResponse{
Path: agentPath,
}, err
}
// WithdrawPath withdraws a Path produced by AdvertisePath from this BgpServer.
func (g *GoBGPServer) WithdrawPath(ctx context.Context, p types.PathRequest) error {
id, err := uuid.FromBytes(p.Path.UUID)
if err != nil {
return fmt.Errorf("failed converting UUID %v: %w", p.Path.UUID, err)
}
err = g.server.DeletePath(apiutil.DeletePathRequest{
UUIDs: []uuid.UUID{id},View on GitHub (pinned to ac7b90affa)
Solutions
- Check the wrapped error to confirm the UUID length/type problem
- Pin and align gobgp/api versions with the Cilium build (uuid.APIv1 vs v2 mismatches)
- Restart/recreate the BGP server to get fresh, valid UUIDs from AddPath
- If reproducible, file/report a bug - a valid AddPath reply should always carry a marshalable UUID
Defensive patterns
Strategy: retry
Try / catch
resp, err := srv.AdvertisePath(ctx, req)
if err != nil && strings.Contains(err.Error(), "failed marshalling UUID") {
return fmt.Errorf("gobgp returned a corrupt UUID; check gobgp version pinning: %w", err)
} Prevention
- Pin gobgp/api versions to the ones Cilium was built against
- Restart the BGP server if corrupt UUIDs persist
- Report reproducible UUID marshal failures as library bugs
- Watch for upgrades that change the uuid package (APIv1 vs v2)
When it happens
Trigger: AdvertisePath receives a non-empty AddPath reply whose first Path carries a UUID that fails MarshalBinary (wrong length, nil, or corrupt UUID from gobgp).
Common situations: gobgp library version skew where the UUID type changed; corrupted or uninitialized path UUIDs in the gobgp reply; extremely rare, usually indicates an internal bug or mismatched gobgp API version.
Related errors
- failed converting UUID %v: %w
- failed converting Path to %v: %w
- failed adding Path to %v: %w
- empty AddPath reply for %v
- nil policy in the RoutePolicyRequest
AI-assisted analysis of cilium/cilium@ac7b90affa (2026-08-31).
Data as JSON: /api/errors/c75a700fcadbd6c1.
Report an issue: GitHub.