jdx/mise · error

{details}

Error message

{details}

What it means

This is the fallback arm of poll_access_token's error matching: when GitHub returns any device-flow error other than authorization_pending, slow_down, expired_token, or access_denied, the code bails with the response's error_description if present, or the raw error string. GitHub's error_description is user-readable (e.g. device flow not enabled for the app, invalid client).

Solutions

  1. Read the detailed message — it echoes GitHub's error_description for the exact cause
  2. Verify the OAuth app's Client ID is correct and device flow is enabled in the app's developer settings
  3. Check GitHub API status (githubstatus.com) for incidents
  4. Retry; if persistent, re-create or fix the OAuth app configuration
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight: confirm the OAuth app client id is configured and device flow is possible
assert!(!client_id.is_empty(), "OAuth client_id must be set before device flow");

Try / catch

// Surface GitHub's error_description verbatim and retry transient classes
if let Err(e) = token {
    tracing::error!("device flow failed: {e}");
    if is_transient(&e) { retry_with_backoff(); }
}

Prevention

When it happens

Trigger: token_async -> poll_access_token receives an unrecognized error field from https://github.com/login/oauth/access_token, e.g. 'incorrect_client_credentials', 'unsupported_grant_type', 'device_flow_disabled', or malformed client configuration.

Common situations: OAuth app client ID misconfigured or deleted; GitHub-side app setting changed (device flow disabled); proxy or API version returning an unexpected error shape; GitHub API incidents.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/f5decced2419dec9. Report an issue: GitHub.

Appendix: source

Thrown at src/github/oauth.rs:371

                debug!("transient error polling GitHub OAuth token: {err:#}");
                continue;
            }
        };

        match response.error.as_deref() {
            None => return Ok(response),
            Some("authorization_pending") => continue,
            Some("slow_down") => {
                interval += 5;
                continue;
            }
            Some("expired_token") => bail!("GitHub device authorization expired"),
            Some("access_denied") => bail!("GitHub device authorization was denied"),
            Some(error) => {
                let details = response
                    .error_description
                    .unwrap_or_else(|| error.to_string());
                bail!("{details}");
            }
        }
    }
}

async fn refresh_token(cached: &CachedToken) -> Result<Option<CachedToken>> {
    let Some(refresh_token) = cached.refresh_token.as_deref() else {
        return Ok(None);
    };
    if cached
        .refresh_expires_at
        .is_some_and(|exp| exp <= chrono::Utc::now())
    {
        return Ok(None);
    }

    let settings = Settings::get();
    let url = format!(

View on GitHub (pinned to 533346cc37)