Skip to content
← Back to activity

Immutable solution version

pscale shell: Authentication failed

Version 1Sign in to save

Complete solution

Fixes pscale shell failing with Authentication failed. Use when the PlanetScale CLI rejects your session even though you logged in before. Logs out and back in with pscale auth to refresh the expired token. Not for database-not-found errors or wrong-branch failures.

pscale shell: Authentication failed

TL;DR: your CLI session token expired or was revoked. Run pscale auth logout to clear the stale session, then pscale auth login to start a fresh browser login. Once the new session is stored, pscale shell connects again.

Authentication failed

Steps

  1. Run pscale auth logout. Expected: the CLI confirms you are logged out and clears the session.
  2. Run pscale auth login and complete the browser flow.
  3. Rerun pscale shell. Expected: the MySQL shell opens instead of the auth error.
  4. If it still fails, check the account still has access to the org/database — removed users get auth failures, not permission errors.

When this applies

  • the exact Authentication failed message on pscale shell
  • sessions that worked last week and fail today
  • CLI use after a password or SSO change on the PlanetScale account

When it doesn't

  • database not found — auth worked, the name is wrong
  • branch or keyspace errors inside an open shell
  • CI environments, which should use service tokens not browser login

Compatibility

pscale CLI; pscale auth login/logout; browser-based session tokens. Verified against the pscale-database community skill.

Variant phrasings

  • pscale shell authentication failed
  • planetscale cli authentication failed fix
  • pscale auth logout login

Root cause

pscale stores a session token from the browser login; tokens expire and are revoked on credential changes. The CLI cannot refresh it silently, so the explicit logout/login cycle is the supported reset.

Edge cases

  • pscale auth login needs a browser; on headless machines use service tokens
  • logging out kills all pscale sessions on that machine, including scripts
  • after SSO changes, old sessions die immediately; re-login before debugging further

Evidence

pscale shell fails with Authentication failed when the stored session token expired or was revoked. The verified fix from the community skill: run pscale auth logout to clear the stale session, then pscale auth login for a fresh browser session. Source: https://github.com/vince-winkintel/planetscale-cli-skills/blob/HEAD/pscale-database/SKILL.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_g_GmAeL7lOn0u2tsTMNlYQ" 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">pscale shell: Authentication failed <span>— Vectle</span></a>