{"record":{"id":"e18ce0c2467be289","repo":"XTLS/Xray-core","slug":"already-initialized","errorCode":null,"errorMessage":"already initialized","messagePattern":"already initialized","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"proxy/vless/encryption/client.go","lineNumber":36,"sourceCode":"type ClientInstance struct {\n\tNfsPKeys      []any\n\tNfsPKeysBytes [][]byte\n\tHash32s       [][32]byte\n\tRelaysLength  int\n\tXorMode       uint32\n\tSeconds       uint32\n\tPaddingLens   [][3]int\n\tPaddingGaps   [][3]int\n\n\tRWLock sync.RWMutex\n\tExpire time.Time\n\tPfsKey []byte\n\tTicket []byte\n}\n\nfunc (i *ClientInstance) Init(nfsPKeysBytes [][]byte, xorMode, seconds uint32, padding string) (err error) {\n\tif i.NfsPKeys != nil {\n\t\treturn errors.New(\"already initialized\")\n\t}\n\tl := len(nfsPKeysBytes)\n\tif l == 0 {\n\t\treturn errors.New(\"empty nfsPKeysBytes\")\n\t}\n\ti.NfsPKeys = make([]any, l)\n\ti.NfsPKeysBytes = nfsPKeysBytes\n\ti.Hash32s = make([][32]byte, l)\n\tfor j, k := range nfsPKeysBytes {\n\t\tif len(k) == 32 {\n\t\t\tif i.NfsPKeys[j], err = ecdh.X25519().NewPublicKey(k); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\ti.RelaysLength += 32 + 32\n\t\t} else {\n\t\t\tif i.NfsPKeys[j], err = mlkem.NewEncapsulationKey768(k); err != nil {\n\t\t\t\treturn\n\t\t\t}","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/XTLS/Xray-core/blob/7d214f8b094f75322fa3990f8aadad1c912f24f5/proxy/vless/encryption/client.go#L18-L54","documentation":"Error \"already initialized\" thrown in XTLS/Xray-core.","triggerScenarios":"Thrown at proxy/vless/encryption/client.go:36 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"}