gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

stuck at Waiting for auth... - SOMEBODY help - Authentication timed out. Please try again. - Gemini API/Login with google

Open varshithkarkera opened this issue 1 year ago • 20 comments

⠸ Waiting for auth... (Press ESC to cancel)

  • I used the Gemini API Key (free)

  • Also I tried with Login with Google but nothing pops up?

  • I have added my Gemini API Key to the env config it loads up!

and after a while it says Authentication timed out. Please try again.

varshithkarkera avatar Jun 25 '25 18:06 varshithkarkera

same issue here.

ManojINaik avatar Jun 25 '25 19:06 ManojINaik

use powershell if you'r using cmd, it worked for me.

ManojINaik avatar Jun 25 '25 19:06 ManojINaik

I use Mac Terminal and meet the same issue

Solus-sano avatar Jun 25 '25 19:06 Solus-sano

I use Ubuntu headless VM and have the same issue.

lostmsu avatar Jun 25 '25 19:06 lostmsu

At least in mac / linux, in the same shell window/tab where you run the tool, did you ensure the export the env var GEMINI_API_KEY so that is available to the tool?

export GEMINI_API_KEY="YOUR_API_KEY"

gplasky avatar Jun 25 '25 19:06 gplasky

@gplasky I am trying to use Login with Google

lostmsu avatar Jun 25 '25 19:06 lostmsu

It appears that Login with Google doesn't work for headless sessions

nick-youngblut avatar Jun 26 '25 00:06 nick-youngblut

Same here. As a workaround, you can login on a headful system and copy .gemini to the target system.

Keno avatar Jun 26 '25 01:06 Keno

Same here. As a workaround, you can login on a headful system and copy .gemini to the target system.

@Keno is just the oauth_cred.json file needed from the headful system? I already have a ${HOME}/.gemini/ directory on the headless system from the original install.

nick-youngblut avatar Jun 26 '25 02:06 nick-youngblut

My situation is my google login page was successfully popup, but after I hit the "login" button, the blue ribbon was moving around and around endlessly, and after a while the CLI side popped the following message:

Failed to login. Ensure the Google account you are using is not a Workspace account and that you are not 
  a licensed Code Assist user (see https://goo.gle/gemini-cli-auth-docs#workspace-gca).                   
 Message: request to https://oauth2.googleapis.com/token failed, reason:

te77yhou avatar Jun 26 '25 02:06 te77yhou

It appears that Login with Google doesn't work for headless sessions

If this is the core issue - you want #1437. We're tracking this issue over there.

markmcd avatar Jun 26 '25 06:06 markmcd

Same issue remote into headless ubuntu tmux session.

SteveCrowBro avatar Jun 26 '25 07:06 SteveCrowBro

Dose not work in Linux and working in Windows powershell

r0br00ks avatar Jun 26 '25 16:06 r0br00ks

windows 11/ ubuntu in HOME, LEASING host. has same issue.

dave2nian avatar Jun 27 '25 04:06 dave2nian

I use Mac Terminal and meet the same issue

philokey avatar Jun 27 '25 07:06 philokey

I have the same issue after ssh -X to the remote EC2 server. Please keep me posted.

fortune9 avatar Jun 27 '25 17:06 fortune9

╭──────────────────────────────────────────────────────────────────────╮ │ │ │ Select Auth Method │ │ ● Login with Google │ │ ○ Gemini API Key (AI Studio) │ │ ○ Vertex AI │ │ │ │ Failed to login. Message: request to │ │ https://oauth2.googleapis.com/token failed, reason: connect │ │ ETIMEDOUT 108.177.98.95:443 │ │ │ │ (Use Enter to select) │ │ │ │ Terms of Services and Privacy Notice for Gemini CLI │ │ │ │ https://github.com/google-gemini/gemini-cli/blob/main/docs/tos-priva │ │ cy.md │ │ │ ╰─────────────────

gebilaoman avatar Jun 28 '25 02:06 gebilaoman

│ Failed to login. Message: request to │ │ https://oauth2.googleapis.com/token failed, reason: connect │

This is the problem of the proxy. @gebilaoman You need to configure a right proxy environment for the terminal.

like

export http_proxy="socks5://127.0.0.1:10808"
export https_proxy="socks5://127.0.0.1:10808"

IcedLemonOolong avatar Jun 28 '25 02:06 IcedLemonOolong

I use the powershell and meet the same issue.

Dose not work in Linux and working in Windows powershell

Rickxiaoxin avatar Jun 28 '25 06:06 Rickxiaoxin

We aren't monitoring closed issues, so to make sure your feedback is heard, I'm going to lock this. Head over to #1437 to discuss.

markmcd avatar Jun 28 '25 08:06 markmcd