{"record":{"id":"964baad2abfca53c","repo":"juspay/hyperswitch","slug":"sqlx-pool-creation-failed","errorCode":null,"errorMessage":"SQLX Pool Creation failed","messagePattern":"SQLX Pool Creation failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/analytics/src/sqlx.rs","lineNumber":52,"sourceCode":"    },\n};\n\n#[derive(Debug, Clone)]\npub struct SqlxClient {\n    pool: Pool<Postgres>,\n}\n\nimpl Default for SqlxClient {\n    fn default() -> Self {\n        let database_url = format!(\n            \"postgres://{}:{}@{}:{}/{}\",\n            \"db_user\", \"db_pass\", \"localhost\", 5432, \"hyperswitch_db\"\n        );\n        Self {\n            #[allow(clippy::expect_used)]\n            pool: PgPoolOptions::new()\n                .connect_lazy(&database_url)\n                .expect(\"SQLX Pool Creation failed\"),\n        }\n    }\n}\n\nimpl SqlxClient {\n    pub async fn from_conf(conf: &Database, schema: &str) -> Self {\n        let database_url = conf.get_database_url(schema);\n        #[allow(clippy::expect_used)]\n        let pool = PgPoolOptions::new()\n            .max_connections(conf.max_pool_size)\n            .min_connections(conf.min_idle_pool_size)\n            .acquire_timeout(std::time::Duration::from_secs(conf.connection_timeout))\n            .max_lifetime(std::time::Duration::from_secs(conf.max_lifetime))\n            .idle_timeout(std::time::Duration::from_secs(conf.idle_timeout))\n            .connect_lazy(&database_url)\n            .expect(\"SQLX Pool Creation failed\");\n        Self { pool }\n    }","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/juspay/hyperswitch/blob/705a3219504c3cf9034e71d956455f8834ea4e64/crates/analytics/src/sqlx.rs#L34-L70","documentation":"Error \"SQLX Pool Creation failed\" thrown in juspay/hyperswitch.","triggerScenarios":"Thrown at crates/analytics/src/sqlx.rs:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the analytics database URL/credentials and that the database is reachable","Check pool configuration values (size, timeouts) in the analytics config"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"705a3219504c3cf9034e71d956455f8834ea4e64","analyzedAt":"2026-08-19T10:36:43.745Z","contentChangedAt":"2026-08-19T10:36:43.745Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}