Skip to content

gemini使用sandbox模式下不支持oauth登录? #14

@haozhou-wong

Description

@haozhou-wong

在claude中调用gemini skills,大模型默认使用sandbox模式导致调用失败,报错如下:”gemini sandbox模式下的报错可以发给我看看嘛

● Gemini --sandbox 模式的报错核心信息:

FatalAuthenticationError: Manual authorization is required but the current session
is non-interactive. Please run the Gemini CLI in an interactive terminal to log in,
provide a GEMINI_API_KEY, or ensure Application Default Credentials are configured.

详细错误链:

  1. libsecret-1.so.0: cannot open shared object file — Docker 容器内缺少系统密钥库
  2. Using FileKeychain fallback — 回退到文件密钥存储,但也没有已存的凭据
  3. FatalAuthenticationError — 非交互模式无法弹出 OAuth 登录,容器内也没有
    GEMINI_API_KEY 环境变量
  4. ConnectTimeoutError: host.docker.internal:44809, timeout: 10000ms — IDE
    连接也超时(容器网络隔离)

根本原因: --sandbox 让 Gemini 在 Docker
容器内运行,但容器没有继承宿主机的认证信息(OAuth token 或 API key)。你在 CLAUDE.md
里加的"不使用 SANDBOX 模式"是正确的处理方式。如果以后确实需要 sandbox,可以通过
GEMINI_API_KEY 环境变量传入容器。“,似乎是sandbox模式下不支持oauth登录导致的?有大佬知道如何解决吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions