{"record":{"id":"e2361940ece7fee8","repo":"XTLS/Xray-core","slug":"unknown-status","errorCode":null,"errorMessage":"unknown status: ","messagePattern":"unknown status: ","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/mux/server.go","lineNumber":354,"sourceCode":"func (w *ServerWorker) handleFrame(ctx context.Context, reader *buf.BufferedReader) error {\n\tvar meta FrameMetadata\n\terr := meta.Unmarshal(reader, session.IsReverseMuxFromContext(ctx))\n\tif err != nil {\n\t\treturn errors.New(\"failed to read metadata\").Base(err)\n\t}\n\n\tswitch meta.SessionStatus {\n\tcase SessionStatusKeepAlive:\n\t\terr = w.handleStatusKeepAlive(&meta, reader)\n\tcase SessionStatusEnd:\n\t\terr = w.handleStatusEnd(&meta, reader)\n\tcase SessionStatusNew:\n\t\terr = w.handleStatusNew(session.ContextWithIsReverseMux(ctx, false), &meta, reader)\n\tcase SessionStatusKeep:\n\t\terr = w.handleStatusKeep(&meta, reader)\n\tdefault:\n\t\tstatus := meta.SessionStatus\n\t\treturn errors.New(\"unknown status: \", status).AtError()\n\t}\n\n\tif err != nil {\n\t\treturn errors.New(\"failed to process data\").Base(err)\n\t}\n\treturn nil\n}\n\nfunc (w *ServerWorker) run(ctx context.Context) {\n\tdefer func() {\n\t\tcommon.Must(w.done.Close())\n\t}()\n\n\treader := &buf.BufferedReader{Reader: w.link.Reader}\n\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/common/mux/server.go#L336-L372","documentation":"FrameMetadata.Unmarshal succeeded but the decoded SessionStatus is none of KeepAlive(0), End(1), New(2), Keep(3). The frame's status byte holds an undefined value, so the server cannot route it to a handler and returns the error marked AtError, breaking the mux connection.","triggerScenarios":"Status byte >= 4 or otherwise invalid: corrupted stream, incompatible protocol implementation, or a stream that was never mux traffic but happened to decode a length+status pair.","commonSituations":"Protocol version drift (newer status values unknown to the old side), custom mux clients, or feeding arbitrary bytes into a mux inbound.","solutions":["Log the numeric status value: a stable value points to protocol mismatch; random values point to corruption/desync.","Upgrade both endpoints to the same Xray-core release.","Verify no extra protocol layer (e.g. SOCKS/HTTP bytes) is being piped into the mux reader.","Capture traffic and check the frame right before the failure for an earlier desync."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := worker.handleFrame(ctx, reader); err != nil {\n    if strings.Contains(err.Error(), \"unknown status\") {\n        // protocol mismatch or corruption: close and renegotiate versions\n    }\n}","preventionTips":["Lock client/server versions when protocol constants may evolve.","Custom encoders: restrict status bytes to the four defined values.","A stable invalid status byte means mismatch; a random one means corruption/desync — check earlier frames."],"tags":["mux","protocol","validation","xray"],"backgroundTag":null,"analyzedSha":"7d214f8b094f75322fa3990f8aadad1c912f24f5","analyzedAt":"2026-08-15T14:26:24.325Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}