juspay/hyperswitch · error

Unable to construct application configuration

Error message

Unable to construct application configuration

What it means

Error "Unable to construct application configuration" thrown in juspay/hyperswitch.

Source

Thrown at crates/drainer/src/main.rs:13

use std::collections::HashMap;

use drainer::{errors::DrainerResult, logger, services, settings, start_drainer, start_web_server};
use router_env::tracing::Instrument;

#[tokio::main]
async fn main() -> DrainerResult<()> {
    // Get configuration
    let cmd_line = <settings::CmdLineConf as clap::Parser>::parse();

    #[allow(clippy::expect_used)]
    let conf = settings::Settings::with_config_path(cmd_line.config_path)
        .expect("Unable to construct application configuration");
    #[allow(clippy::expect_used)]
    conf.validate()
        .expect("Failed to validate drainer configuration");

    let state = settings::AppState::new(conf.clone()).await;

    let mut stores = HashMap::new();
    for (tenant_name, tenant) in conf.multitenancy.get_tenants() {
        let store = std::sync::Arc::new(services::Store::new(&state.conf, false, tenant).await);
        stores.insert(tenant_name.clone(), store);
    }

    #[allow(clippy::print_stdout)] // The logger has not yet been initialized
    #[cfg(feature = "vergen")]
    {
        println!("Starting drainer (Version: {})", router_env::git_tag!());
    }

View on GitHub (pinned to 705a321950)

Solutions

  1. Check the drainer configuration file/environment variables for missing or invalid values

When it happens

Trigger: Thrown at crates/drainer/src/main.rs:13 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/ebb432312c75e093. Report an issue: GitHub.