Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

auth status misreports an inaccessible keyring as an invalid token

Aperta
#14,171 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Inizia dal percorso di autenticazione gh auth status e riproduci il problema da un contesto senza accesso alla sessione grafica, ad esempio un demone di sistema launchd. Traccia come un errore di autorizzazione del keyring diventa il messaggio di token non valido; il lavoro è completo quando lo storage inaccessibile viene segnalato correttamente e l’output indica GH_TOKEN o gh auth login --insecure-storage.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug gh-auth priority-3
Describe the bug

When gh runs in an environment without access to the user's graphical session (for example, a system daemon on macOS), reading the auth token from the keyring fails with a permission error. gh auth status then reports "The token in default is invalid" and suggests re-authenticating — but re-authenticating can never succeed, because the token also cannot be stored in the keyring from that environment.

Affected version

gh version 2.97.0 (2026-07-31)

Steps to reproduce the behavior
  1. Log in to gh normally so the token is stored in the macOS keyring.
  2. Run gh auth status from a context without access to the user's graphical session (e.g. a launchd system daemon, where launchctl managername reports System).
  3. Observe the misleading error.
Expected vs actual behavior

Expected: gh auth status should report that the keyring is inaccessible and suggest a workaround that works in that environment (e.g. set GH_TOKEN or use gh auth login --insecure-storage).

Actual: it reports "The token in default is invalid" and suggests re-authenticating, which cannot succeed.

Logs
github.com
  X Failed to log in to github.com account aimkiray (default)
  - Active account: true
  - The token in default is invalid.
  - To re-authenticate, run: gh auth login -h github.com
  - To forget about this account, run: gh auth logout -h github.com -u aimkiray
Lingua principale
Go
Stelle
46.3k
Fork
9.1k
Merge medio
1g 7h
PR unite (30g)
76

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cli/cli

Tutte le issue di cli/cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.