{"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":"DecodeHeaderAddons successfully read the length-prefixed addons blob but proto.Unmarshal could not parse it as an Addons protobuf message. The bytes on the wire are not a valid protobuf encoding — typically a protocol mismatch, a non-VLESS server, or stream corruption; the raw unmarshal error is chained.","triggerScenarios":"Thrown at proxy/vless/encoding/addons.go:53 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm client and server run compatible xray versions using the same VLESS addons schema","Verify the connection is not being intercepted/rewritten by a middlebox","Validate that the UUID and protocol settings (encryption, flow) match on both ends"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","contentChangedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}