Every call fails with an auth error for 30 minutes each time the OAuth access token expires

Aperta
#1,217 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
50/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

The bug is in access_token_has_expired() in kagglesdk/kaggle_creds.py, which lives in the kagglesdk package rather than this CLI repo, so the edit belongs in the SDK project. Start with the comparison against now - 30 minutes, then read the repro in Kaggle/kaggle-sdk-python#74. Done means the token is treated as expired before it lapses, so the CLI refreshes it instead of sending a dead token for 30 minutes.

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

Descrizione

bug

With kaggle CLI 2.2.4, once the OAuth access token expires (12 hours after kaggle auth login or the last refresh), every call fails with an authentication error for about 30 minutes, then works again by itself. A long-running process that calls the CLI every few minutes hit this twice on 2026-10-14, 12 hours apart.

The cause is in the SDK: KaggleCredentials.access_token_has_expired() (kagglesdk/kaggle_creds.py) compares the expiration with now - 30 minutes, so a token counts as expired only 30 minutes after it has expired, and the CLI keeps sending it until then. The current main of kagglesdk still has this line.

Details, a repro without network or credentials, and a one-line fix (now + 30 minutes, so the token is refreshed before it expires) are in Kaggle/kaggle-sdk-python#74. Filing here too because this is where CLI users will look for the symptom.

Version: kaggle CLI 2.2.4, kagglesdk 0.1.37.

Lingua principale
Python
Stelle
7.7k
Fork
1.5k
Merge medio
1g 6h
PR unite (30g)
17

Preparare l'ambiente

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 Kaggle/kaggle-cli

Tutte le issue di Kaggle/kaggle-cli

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.