{"record":{"id":"4729e26e92c6bb5f","repo":"XTLS/Xray-core","slug":"already-initialized-4729e2","errorCode":null,"errorMessage":"already initialized","messagePattern":"already initialized","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/vless/encryption/server.go","lineNumber":45,"sourceCode":"\tNfsPKeysBytes [][]byte\n\tHash32s       [][32]byte\n\tRelaysLength  int\n\tXorMode       uint32\n\tSecondsFrom   int64\n\tSecondsTo     int64\n\tPaddingLens   [][3]int\n\tPaddingGaps   [][3]int\n\n\tRWLock   sync.RWMutex\n\tClosed   bool\n\tLasts    map[int64][16]byte\n\tTickets  [][16]byte\n\tSessions map[[16]byte]*ServerSession\n}\n\nfunc (i *ServerInstance) Init(nfsSKeysBytes [][]byte, xorMode uint32, secondsFrom, secondsTo int64, padding string) (err error) {\n\tif i.NfsSKeys != nil {\n\t\treturn errors.New(\"already initialized\")\n\t}\n\tl := len(nfsSKeysBytes)\n\tif l == 0 {\n\t\treturn errors.New(\"empty nfsSKeysBytes\")\n\t}\n\ti.NfsSKeys = make([]any, l)\n\ti.NfsPKeysBytes = make([][]byte, l)\n\ti.Hash32s = make([][32]byte, l)\n\tfor j, k := range nfsSKeysBytes {\n\t\tif len(k) == 32 {\n\t\t\tif i.NfsSKeys[j], err = ecdh.X25519().NewPrivateKey(k); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti.NfsPKeysBytes[j] = i.NfsSKeys[j].(*ecdh.PrivateKey).PublicKey().Bytes()\n\t\t\ti.RelaysLength += 32 + 32\n\t\t} else {\n\t\t\tif i.NfsSKeys[j], err = mlkem.NewDecapsulationKey768(k); err != nil {\n\t\t\t\treturn","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/vless/encryption/server.go#L27-L63","documentation":"Error \"already initialized\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/vless/encryption/server.go:45 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"}