{"record":{"id":"28c1d4902d9b475f","repo":"v2rayA/v2rayA","slug":"given-server-cannot-be-found-in-database","errorCode":null,"errorMessage":"given server cannot be found in database","messagePattern":"given server cannot be found in database","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/db/configure/configure.go","lineNumber":398,"sourceCode":"\tif wt.Outbound == \"\" {\n\t\twt.Outbound = \"proxy\"\n\t}\n\tbucket := fmt.Sprintf(\"outbound.%v\", wt.Outbound)\n\tvar wcs Whiches\n\t_ = db.Get(bucket, \"connectedServers\", &wcs)\n\t// Normalize Outbound field of existing entries for consistent comparison\n\tfor _, v := range wcs.Touches {\n\t\tif v.Outbound == \"\" {\n\t\t\tv.Outbound = \"proxy\"\n\t\t}\n\t}\n\tfor i, v := range wcs.Touches {\n\t\tif v.EqualTo(wt) {\n\t\t\twcs.Touches = append(wcs.Touches[:i], wcs.Touches[i+1:]...)\n\t\t\treturn db.Set(bucket, \"connectedServers\", wcs)\n\t\t}\n\t}\n\treturn fmt.Errorf(\"given server cannot be found in database\")\n}\n\nfunc GetOutbounds() (outbounds []string) {\n\t// keep order\n\tmembers, _ := db.StringSetGetAll(\"outbounds\", \"names\")\n\tfor _, m := range members {\n\t\tif m != \"proxy\" {\n\t\t\toutbounds = append(outbounds, m)\n\t\t}\n\t}\n\tsort.Strings(outbounds)\n\t// \"proxy\" is always the first outbound.\n\toutbounds = append([]string{\"proxy\"}, outbounds...)\n\treturn\n}\n\n// InitDefaultOutbound ensures the default \"proxy\" outbound group exists in the database.\n// It should be called during system initialization.","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/v2rayA/v2rayA/blob/71e5442fc548c05680ee55eae943e6c0afe9ac51/service/db/configure/configure.go#L380-L416","documentation":"Returned by RemoveConnect when the requested server touch is not present in the connectedServers list of the given outbound bucket: after normalizing empty outbound names to \"proxy\" and scanning all stored touches, none matched the WhichToRemove via EqualTo, so there is nothing to disconnect.","triggerScenarios":"Thrown at service/db/configure/configure.go:398 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the UI/server list and retry","Check for concurrent disconnects that already removed the server","Restart the service if DB state is inconsistent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"71e5442fc548c05680ee55eae943e6c0afe9ac51","analyzedAt":"2026-09-05T20:04:37.459Z","contentChangedAt":"2026-09-05T20:04:37.459Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}