juspay/hyperswitch · error

SQLX Pool Creation failed

Error message

SQLX Pool Creation failed

What it means

Error "SQLX Pool Creation failed" thrown in juspay/hyperswitch.

Source

Thrown at crates/analytics/src/sqlx.rs:52

    },
};

#[derive(Debug, Clone)]
pub struct SqlxClient {
    pool: Pool<Postgres>,
}

impl Default for SqlxClient {
    fn default() -> Self {
        let database_url = format!(
            "postgres://{}:{}@{}:{}/{}",
            "db_user", "db_pass", "localhost", 5432, "hyperswitch_db"
        );
        Self {
            #[allow(clippy::expect_used)]
            pool: PgPoolOptions::new()
                .connect_lazy(&database_url)
                .expect("SQLX Pool Creation failed"),
        }
    }
}

impl SqlxClient {
    pub async fn from_conf(conf: &Database, schema: &str) -> Self {
        let database_url = conf.get_database_url(schema);
        #[allow(clippy::expect_used)]
        let pool = PgPoolOptions::new()
            .max_connections(conf.max_pool_size)
            .min_connections(conf.min_idle_pool_size)
            .acquire_timeout(std::time::Duration::from_secs(conf.connection_timeout))
            .max_lifetime(std::time::Duration::from_secs(conf.max_lifetime))
            .idle_timeout(std::time::Duration::from_secs(conf.idle_timeout))
            .connect_lazy(&database_url)
            .expect("SQLX Pool Creation failed");
        Self { pool }
    }

View on GitHub (pinned to 705a321950)

Solutions

  1. Verify the analytics database URL/credentials and that the database is reachable
  2. Check pool configuration values (size, timeouts) in the analytics config

When it happens

Trigger: Thrown at crates/analytics/src/sqlx.rs:52 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of juspay/hyperswitch@705a321950 (2026-08-19). Data as JSON: /api/errors/964baad2abfca53c. Report an issue: GitHub.