{"record":{"id":"bfc652b73ed16177","repo":"t8y2/dbx","slug":"cannot-reconnect-xugu-session-without-connection-p","errorCode":null,"errorMessage":"cannot reconnect Xugu session without connection parameters","messagePattern":"cannot reconnect Xugu session without connection parameters","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/xugu/main.go","lineNumber":4226,"sourceCode":"\ts.activeCanceled = false\n\tif queryErr == nil && !timedOut && !canceled {\n\t\ts.activeRows[rows] = cancel\n\t}\n\ts.activeCancelMu.Unlock()\n\tif queryErr != nil || timedOut || canceled {\n\t\tcancel()\n\t\tif rows != nil {\n\t\t\t_ = rows.Close()\n\t\t}\n\t\tqueryErr = xuguOperationResultError(timedOut, canceled, timeoutSecs, queryErr)\n\t}\n\treturn rows, queryErr\n}\n\nfunc (s *server) reconnectBusinessSession() error {\n\tparams := s.params\n\tif strings.TrimSpace(params.Host) == \"\" && strings.TrimSpace(params.ConnectionString) == \"\" {\n\t\treturn errors.New(\"cannot reconnect Xugu session without connection parameters\")\n\t}\n\tcurrentDatabase := s.currentDatabase\n\tif _, err := s.connectWithControl(params, nil, false); err != nil {\n\t\treturn err\n\t}\n\treturn s.restoreBusinessSessionDatabase(currentDatabase)\n}\n\nfunc (s *server) restoreBusinessSessionDatabase(database string) error {\n\tif strings.TrimSpace(database) == \"\" {\n\t\treturn nil\n\t}\n\treturn s.useDatabase(database)\n}\n\nfunc (s *server) execWithReconnect(statement string) error {\n\tdb, err := s.requireDB()\n\tif err != nil {","sourceCodeStart":4208,"sourceCodeEnd":4244,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/xugu/main.go#L4208-L4244","documentation":"This error is returned by reconnectBusinessSession when the stored connection parameters contain neither a Host nor a ConnectionString. Without either, the driver cannot re-establish the Xugu session after a disconnect.","triggerScenarios":"Invoking reconnect on a server instance whose params were built with an empty Host and empty ConnectionString — typically a session constructed only for in-process or control purposes.","commonSituations":"Sessions created without persisted connection config that later lose connectivity; configuration lost across process restarts; params struct partially populated.","solutions":["Ensure params.Host or params.ConnectionString is set before enabling reconnect","Persist the original connection parameters on the server instance","Construct the session with a full connectWithControl-compatible parameter set"],"exampleFix":"// before\nparams := xugu.Params{} // no Host, no ConnectionString\ns.reconnectBusinessSession()\n// after\nparams := xugu.Params{Host: \"127.0.0.1\", Port: 5138, User: \"sysdba\", Password: \"...\"}\ns.reconnectBusinessSession()","handlingStrategy":"validation","validationCode":"func canReconnect(p xugu.Params) bool {\n    return strings.TrimSpace(p.Host) != \"\" || strings.TrimSpace(p.ConnectionString) != \"\"\n}","typeGuard":"func hasConnectionParams(p xugu.Params) bool {\n    return strings.TrimSpace(p.Host) != \"\" || strings.TrimSpace(p.ConnectionString) != \"\"\n}\n// guard: if !hasConnectionParams(s.params) { skip reconnect }","tryCatchPattern":"if err := s.reconnectBusinessSession(); err != nil {\n    if err.Error() == \"cannot reconnect Xugu session without connection parameters\" {\n        // surface config problem; do not retry\n        return fmt.Errorf(\"session reconnect misconfigured: %w\", err)\n    }\n    return err\n}","preventionTips":["Always store full connection params (Host or ConnectionString) on the server instance","Validate params at construction time so reconnect is always possible","Do not create business sessions from params that cannot be replayed"],"tags":["xugu","reconnect","configuration","connection"],"backgroundTag":"missing-connection-config","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}