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

gemini exits during Web auth (firewall)

Open SHIKI-0122 opened this issue 1 year ago • 16 comments

OS: Windows11 After I clicked "Sign In," the CLI exited after a while, before the web page could respond.

Image

Image

Notice that this is not related to the click action. I typed gemini and then jumped to my browser, and simply waiting. The CLI still exited.

SHIKI-0122 avatar Jun 25 '25 16:06 SHIKI-0122

same

Ccheers avatar Jun 25 '25 16:06 Ccheers

I'm in the same boat. Can't log in at all.

yuaotian avatar Jun 25 '25 16:06 yuaotian

same, I've tried many times in Chrome or Safari. Can't log in. OS: Mac OS

Can't see any logs.

WalterErek avatar Jun 25 '25 16:06 WalterErek

Do you see any gemini logs in your temp dir? It should have a name that starts with "gemini-client-error".

scidomino avatar Jun 25 '25 16:06 scidomino

@scidomino I suspect that the issue is related to the IP and proxy environment. The people experiencing the problem are mostly from mainland China, haha.

kylesean avatar Jun 25 '25 16:06 kylesean

Not being able to log in with web auth when operating remotely is a known limitation documented here: https://github.com/google-gemini/gemini-cli/issues/1439. This bug should only be for people who are seeing the program crash and exit while the web login step is happening.

scidomino avatar Jun 25 '25 16:06 scidomino

same issue start command HTTPS_PROXY=http://127.0.0.1:7897 gemini --debug

Clearcut POST request error:  AggregateError [ETIMEDOUT]:
    at internalConnectMultiple (node:net:1139:18)
    at afterConnectMultiple (node:net:1712:7) {
  code: 'ETIMEDOUT',
  [errors]: [
    Error: connect ETIMEDOUT 2001:4860:4802:38::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:38::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.38.223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.38.223',
      port: 443
    },
    Error: connect ETIMEDOUT 2001:4860:4802:34::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:34::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.36.223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.36.223',
      port: 443
    },
    Error: connect ETIMEDOUT 2001:4860:4802:32::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:32::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.32.223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.32.223',
      port: 443
    },
    Error: connect ETIMEDOUT 2001:4860:4802:36::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:36::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.34.223:443
        at createConnectionError (node:net:1675:14)
        at afterConnectMultiple (node:net:1705:16) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.34.223',
      port: 443
    }
  ]
}
=========================================
CRITICAL: Unhandled Promise Rejection!
=========================================
Reason: AggregateError [ETIMEDOUT]:
    at internalConnectMultiple (node:net:1139:18)
    at afterConnectMultiple (node:net:1712:7) {
  code: 'ETIMEDOUT',
  [errors]: [
    Error: connect ETIMEDOUT 2001:4860:4802:38::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:38::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.38.223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.38.223',
      port: 443
    },
    Error: connect ETIMEDOUT 2001:4860:4802:34::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:34::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.36.223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.36.223',
      port: 443
    },
    Error: connect ETIMEDOUT 2001:4860:4802:32::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:32::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.32.223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.32.223',
      port: 443
    },
    Error: connect ETIMEDOUT 2001:4860:4802:36::223:443
        at createConnectionError (node:net:1675:14)
        at Timeout.internalConnectMultipleTimeout (node:net:1734:38)
        at listOnTimeout (node:internal/timers:596:11)
        at process.processTimers (node:internal/timers:529:7) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '2001:4860:4802:36::223',
      port: 443
    },
    Error: connect ETIMEDOUT 216.239.34.223:443
        at createConnectionError (node:net:1675:14)
        at afterConnectMultiple (node:net:1705:16) {
      errno: -60,
      code: 'ETIMEDOUT',
      syscall: 'connect',
      address: '216.239.34.223',
      port: 443
    }
  ]
}
Stack trace may follow:

Diagnostic Information

  • CLI Version: 0.1.1
  • Git Commit: 852210e1 (local modifications)
  • Operating System: darwin v22.13.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-pro
  • Memory Usage: 184.2 MB

FYI, hope can help you

NeverTeaser avatar Jun 25 '25 16:06 NeverTeaser

Great firewall or not, no one should be seeing "CRITICAL: Unhandled Promise Rejection!" errors. I'll look into that.

scidomino avatar Jun 25 '25 16:06 scidomino

Encountering the same problem

RuixiangMa avatar Jun 25 '25 17:06 RuixiangMa

Using and configuring your proxy tool to TUN mode can temporarily solve this problem

kylesean avatar Jun 25 '25 17:06 kylesean

Marking this as a duplicate of 1425 even though the presentation is slightly different. The root cause seems to be firewalls interfering with communicating with the inference server.

scidomino avatar Jun 25 '25 18:06 scidomino

On second though. Reopening this since the root cause in the other one might be different.

scidomino avatar Jun 25 '25 18:06 scidomino

To be clear: Gemini is not available to users in China. This bug is to have a friendlier error message when we can't log in.

scidomino avatar Jun 25 '25 18:06 scidomino

记得在终端使用代理。

Remember to use the proxy in the terminal, change it to your proxy port 👇

export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890

1daohang avatar Jun 28 '25 06:06 1daohang

We overhauled error reporting recently and that improved how these errors are displayed.

scidomino avatar Jul 07 '25 23:07 scidomino

Found possible duplicate issues:\n\n- #4487: (0.9076157212257385)\n- #1733: (0.9061883687973022)\n\n

gsquared94 avatar Jul 30 '25 22:07 gsquared94