{"record":{"id":"6769de5e11387635","repo":"XTLS/Xray-core","slug":"failed-to-unmarshal-addons-protobuf-value","errorCode":null,"errorMessage":"failed to unmarshal addons protobuf value","messagePattern":"failed to unmarshal addons protobuf value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/vless/encoding/addons.go","lineNumber":53,"sourceCode":"\n\treturn nil\n}\n\nfunc DecodeHeaderAddons(buffer *buf.Buffer, reader io.Reader) (*Addons, error) {\n\taddons := new(Addons)\n\tbuffer.Clear()\n\tif _, err := buffer.ReadFullFrom(reader, 1); err != nil {\n\t\treturn nil, errors.New(\"failed to read addons protobuf length\").Base(err)\n\t}\n\n\tif length := int32(buffer.Byte(0)); length != 0 {\n\t\tbuffer.Clear()\n\t\tif _, err := buffer.ReadFullFrom(reader, length); err != nil {\n\t\t\treturn nil, errors.New(\"failed to read addons protobuf value\").Base(err)\n\t\t}\n\n\t\tif err := proto.Unmarshal(buffer.Bytes(), addons); err != nil {\n\t\t\treturn nil, errors.New(\"failed to unmarshal addons protobuf value\").Base(err)\n\t\t}\n\n\t\t// Verification.\n\t\tswitch addons.Flow {\n\t\tdefault:\n\t\t}\n\t}\n\n\treturn addons, nil\n}\n\n// EncodeBodyAddons returns a Writer that auto-encrypt content written by caller.\nfunc EncodeBodyAddons(writer buf.Writer, request *protocol.RequestHeader, requestAddons *Addons, state *proxy.TrafficState, isUplink bool, context context.Context, conn net.Conn, ob *session.Outbound) buf.Writer {\n\tif request.Command == protocol.RequestCommandUDP {\n\t\treturn NewMultiLengthPacketWriter(writer)\n\t}\n\tif requestAddons.Flow == vless.XRV {\n\t\treturn proxy.NewVisionWriter(writer, state, isUplink, context, conn, ob, request.User.Account.(*vless.MemoryAccount).Testseed)","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/vless/encoding/addons.go#L35-L71","documentation":"Error \"failed to unmarshal addons protobuf value\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/vless/encoding/addons.go:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}