juspay/hyperswitch · error

Failed to create PostgreSQL connection pool

Error message

Failed to create PostgreSQL connection pool

What it means

Error "Failed to create PostgreSQL connection pool" thrown in juspay/hyperswitch.

Source

Thrown at crates/drainer/src/connection.rs:34

// TODO: use stores defined in storage_impl instead
/// # Panics
///
/// Will panic if could not create a db pool
#[allow(clippy::expect_used)]
pub async fn diesel_make_pg_pool(
    database: &Database,
    _test_transaction: bool,
    schema: &str,
) -> PgPool {
    let database_url = database.get_database_url(schema);
    let manager = async_bb8_diesel::ConnectionManager::<DejaPgConnection>::new(database_url);
    let pool = bb8::Pool::builder()
        .max_size(database.pool_size)
        .connection_timeout(std::time::Duration::from_secs(database.connection_timeout));

    pool.build(manager)
        .await
        .expect("Failed to create PostgreSQL connection pool")
}

#[allow(clippy::expect_used)]
pub async fn pg_connection(
    pool: &PgPool,
) -> PooledConnection<'_, async_bb8_diesel::ConnectionManager<DejaPgConnection>> {
    pool.get()
        .await
        .expect("Couldn't retrieve PostgreSQL connection")
}

View on GitHub (pinned to 07df51534c)

Solutions

  1. Verify PostgreSQL is running and reachable and that the drainer database URL/credentials are correct

When it happens

Trigger: Thrown at crates/drainer/src/connection.rs:34 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of juspay/hyperswitch@07df51534c (2026-08-19). Data as JSON: /api/errors/147b8f66d84fc008. Report an issue: GitHub.