BoundaryML/baml · error

No credentials found

Error message

No credentials found

What it means

Credential lookup failure in the PropelAuth auth client: the stored credentials file (creds.json in the user's config dir) is absent, so there is no refresh token to use. It fires from read_from_storage when the user has never logged in on this machine or the config directory was wiped; the code's TODO notes the intent to tell the user to log in.

Source

Thrown at engine/cli/src/propelauth.rs:349

            anyhow::bail!("Failed to refresh access token: {}", response.text().await?);
        }

        let body: RefreshAccessTokenResponse = response
            .json()
            .await
            .context("Failed to parse refresh access token response")?;

        Ok(body)
    }

    pub(crate) fn read_from_storage() -> Result<Self> {
        let creds_path = app_strategy()
            .context("Unable to get project directories")?
            .in_config_dir("creds.json");

        // TODO: if these fail we should tell the user to login
        if !creds_path.exists() {
            anyhow::bail!("No credentials found");
        }

        // TODO: if these fail we should tell the user to login
        let creds_content = std::fs::read_to_string(creds_path)?;
        let creds: Self = serde_json::from_str(&creds_content)?;

        Ok(creds)
    }

    pub(crate) fn write_to_storage(&self) -> Result<()> {
        let strategy = app_strategy().context("Unable to get project directories")?;
        let config_dir = strategy.config_dir();
        std::fs::create_dir_all(&config_dir)?;
        let creds_path = config_dir.join("creds.json");

        let creds_content = serde_json::to_string(&self)?;

        log::debug!("Writing credentials to {creds_path:?}");

View on GitHub (pinned to bd85ce9dee)

Solutions

  1. Run `baml login` to create the credentials file
  2. Check that you run the command as the same OS user that logged in (same config dir)
  3. In CI, restore/cache the creds.json or inject auth via environment rather than interactive login
Defensive patterns

Strategy: validation

Validate before calling

const { execSync } = require('child_process');
const cfgDir = process.env.XDG_CONFIG_HOME || require('os').homedir() + '/.config';
let loggedIn = true;
try { execSync('baml whoami', { stdio: 'ignore' }); } catch { loggedIn = false; }
if (!loggedIn) execSync('baml login', { stdio: 'inherit' });

Try / catch

try {
  await deploy();
} catch (e) {
  if (String(e).includes('No credentials found')) {
    execSync('baml login', { stdio: 'inherit' });
  }
}

Prevention

When it happens

Trigger: Calling any authenticated CLI command (deploy, whoami, etc.) when read_from_storage finds creds.json absent in the OS config directory.

Common situations: Fresh machine or fresh install; running as a different user/OS user so the config dir differs; setting HOME/XDG_CONFIG_HOME differently in CI; deleting credentials manually.

Related errors


AI-assisted analysis of BoundaryML/baml@bd85ce9dee (2026-09-12). Data as JSON: /api/errors/8cf72fde13b54083. Report an issue: GitHub.