tinyhumansai/openhuman · error · anyhow::Error

failed to load dotenv from OPENHUMAN_DOTENV_PATH=

Error message

failed to load dotenv from OPENHUMAN_DOTENV_PATH={path}: {e}

What it means

Loader diagnostic in the CLI dotenv bootstrap: an explicit `OPENHUMAN_DOTENV_PATH` was set but dotenv failed to parse/read that file. The named path is user-specified (search-path guessing is a separate branch), so the file at that path is missing, unreadable, or malformed.

Solutions

  1. Verify the path in OPENHUMAN_DOTENV_PATH exists and is readable
  2. Fix KEY=VALUE syntax errors in the .env file
  3. Unset OPENHUMAN_DOTENV_PATH to fall back to .env discovery from the current directory
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/cli.rs:341 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/d102c94aab80d261. Report an issue: GitHub.

Appendix: source

Thrown at src/core/cli.rs:341

        "sentry-test unavailable: built without the crash-reporting feature — \
         rebuild with `--features crash-reporting`"
    ))
}

/// Loads key/value pairs from a `.env` file into the process environment.
///
/// This is used for all CLI entrypoints so direct namespace commands pick up
/// the same repo-local configuration as `run` / `serve`.
///
/// Precedence:
/// 1. Variables already set in the process environment are **not** overwritten.
/// 2. If `OPENHUMAN_DOTENV_PATH` is set, that file is loaded.
/// 3. Otherwise, it searches for `.env` in the current working directory.
pub(crate) fn load_dotenv_for_cli() -> Result<()> {
    match std::env::var("OPENHUMAN_DOTENV_PATH") {
        Ok(path) if !path.trim().is_empty() => {
            dotenvy::from_path(&path).map_err(|e| {
                anyhow::anyhow!("failed to load dotenv from OPENHUMAN_DOTENV_PATH={path}: {e}")
            })?;
        }
        _ => {
            let _ = dotenvy::dotenv();
        }
    }
    Ok(())
}

/// Handles the `run` subcommand to start the core HTTP/JSON-RPC server.
///
/// This command boots the main application server, including its JSON-RPC
/// endpoint, Socket.IO bridge, and background services (voice, vision, etc.).
///
/// # Arguments
///
/// * `args` - Command-line arguments for the `run` command (e.g., `--port`).
fn run_server_command(args: &[String]) -> Result<()> {

View on GitHub (pinned to 7491200858)