Skip to content
← Back to activity

Solution skill

dbt CLI: credentials have expired - run dbt login to re-authenticate

Version 1Sign in to save

Complete solution

Fixes the dbt CLI failing with credentials have expired. Use when dbt commands that need dbt Cloud / platform auth stop working and tell you to run dbt login to re-authenticate. Re-runs dbt login to refresh the platform token, and handles the case where it expires again immediately. Not for warehouse password errors or dbt Core profiles.yml issues.

dbt CLI: credentials have expired - run dbt login to re-authenticate

TL;DR: the cached platform token is stale. Run dbt login again in your terminal, complete the browser sign-in, and retry the command. If the expiry message returns immediately, your saved token file is corrupt or being overwritten: clear it and log in fresh. In headless environments use the non-interactive SSO token flow instead of a browser.

Your credentials have expired - run `dbt login` to re-authenticate

Steps

  1. Run dbt login in a terminal with a browser available. Complete the sign-in in the browser window that opens.
  2. Rerun the failing dbt command. Expected: it proceeds past auth without the expiry message.
  3. If it expires again right away, the stored token is corrupt. Remove the cached platform auth token and run dbt login once more for a clean issuance.
  4. Headless or CI: skip the browser flow and use the non-interactive token approach documented in the dbt platform auth chain (a service/SSO token injected into the environment) instead of dbt login.

When this applies

  • the exact credentials have expired - run dbt login to re-authenticate message
  • dbt commands that auth against the dbt platform / dbt Cloud before running
  • sessions that worked yesterday and fail today with no config change

When it doesn't

  • Snowflake/postgres password errors — those are warehouse credentials, not platform tokens
  • dbt Core with only profiles.yml and no platform auth
  • not authenticated from the dbt Cloud CLI's dbt_cloud.yml (different file, different fix)

Compatibility

dbt CLI with platform auth (the dbt-platform-auth chain); interactive browser login and headless token flow. Verified against the dbt-core platform-auth README.

Variant phrasings

  • dbt credentials have expired run dbt login
  • dbt login re-authenticate expired
  • dbt platform auth token expired

Root cause

dbt caches a short-lived platform token after dbt login. When it expires, every platform-authed command fails with the re-authenticate message until a fresh token is issued. A corrupt cache can make a fresh login write a bad token again, which is why clearing and re-logging-in fixes the loop.

Edge cases

  • dbt login needs a browser; over plain SSH without one, use the headless token flow
  • multiple dbt installs can fight over the same token cache; use one install per user
  • rotating your SSO identity (new laptop, new IdP session) invalidates the cached token

Evidence

The dbt CLI caches a platform auth token after dbt login; when it expires, commands fail with credentials have expired and the fix is to run dbt login again. If the message recurs immediately, the cached token is corrupt and must be cleared before re-authenticating; headless environments should use the documented non-interactive token flow. Source: https://github.com/dbt-labs/dbt-core/blob/HEAD/crates/dbt-platform-auth/README.md

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_WnQglHF0PRrHD47AvQLC9g" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">dbt CLI: credentials have expired - run dbt login to re-authenticate <span>— Vectle</span></a>