Authentification failed on termux

Open 💬 0 comments Opened Jul 31, 2026 by Felix-feles

What version of Codex CLI is running?

codex-cli 0.145.0

What subscription do you have?

Pro

Which model were you using?

/

What platform is your computer?

Termux (linux/android)

What terminal emulator and version are you using (if applicable)?

Termux

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1785501835s since unix epoch",
  "overallStatus": "fail",
  "codexVersion": "0.145.0",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {                                            "control socket": "/data/data/com.termux/files/home/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/data/data/com.termux/files/home/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/data/data/com.termux/files/home/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/data/data/com.termux/files/home/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/data/data/com.termux/files/home/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "fail",
      "summary": "no Codex credentials were found",
      "details": {
        "auth file": "/data/data/com.termux/files/home/.codex/auth.json",
        "auth storage mode": "File"
      },
      "remediation": "Run codex login or provide an API key through a supported auth env var.",
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/data/data/com.termux/files/home/.codex",
        "config.toml": [
          "/data/data/com.termux/files/home/.codex/config.toml",
          "missing"
        ],
        "cwd": "/data/data/com.termux/files/home",
        "enabled feature flags": "shell_tool, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, skill_mcp_dependency_install, skill_search, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "36",
        "log dir": "/data/data/com.termux/files/home/.codex/log",
        "mcp servers": "0",
        "model": "<default>",
        "model provider": "openai",
        "sqlite home": "/data/data/com.termux/files/home/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git executable not found",
      "details": {
        "PATH git entries": "0",
        "repo detected": "false",
        "selected git": "not found"
      },
      "remediation": null,
      "durationMs": 0
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "current executable": "/data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/bin/codex",
        "install context": "standalone (unix, package /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl, bin /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/bin, resources /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/codex-resources, path /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/codex-path)",
        "managed by bun": "false",
        "managed by npm": "false",
        "managed by pnpm": "false",
        "managed package root": "not set"
      },
      "remediation": null,
      "durationMs": 0
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "no MCP servers configured",
      "details": {},
      "remediation": null,
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "fail",
      "summary": "one or more required provider endpoints are unreachable over HTTP",
      "details": {
        "ChatGPT base URL": "https://chatgpt.com/backend-api/ request timed out (required)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": "Check proxy, VPN, firewall, DNS, and custom CA configuration.",
      "durationMs": 3031
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "warning",
      "summary": "Responses WebSocket failed; HTTPS fallback may still work",
      "details": {
        "DNS": "lookup failed (failed to lookup address information: Try again)",
        "auth mode": "none",
        "connect timeout": "15000 ms",
        "endpoint": "wss://api.openai.com/v1/<redacted>",
        "handshake transport error": "network error: failed to lookup address information: Try again",
        "model provider": "openai",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": "Check proxy, VPN, firewall, DNS, custom CA, and WebSocket policy support.",
      "durationMs": 10054
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running standalone on linux-aarch64",
      "details": {
        "commit": "unknown",
        "current executable": "/data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/bin/codex",
        "install method": "standalone (unix, package /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl, bin /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/bin, resources /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/codex-resources, path /data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/codex-path)",
        "platform": "linux-aarch64",
        "version": "0.145.0"
      },
      "remediation": null,
      "durationMs": 4
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/data/data/com.termux/files/home/.codex/packages/standalone/releases/0.145.0-aarch64-unknown-linux-musl/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "/data/data/com.termux/files/home/.codex/tmp/arg0/codex-arg0wf7U3w/codex-linux-sandbox",
        "execve wrapper helper": "/data/data/com.termux/files/home/.codex/tmp/arg0/codex-arg0wf7U3w/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/data/data/com.termux/files/home/.codex (dir)",
        "active rollout files": "0 files, 0 total bytes, 0 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/data/data/com.termux/files/home/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/data/data/com.termux/files/home/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/data/data/com.termux/files/home/.codex/log (missing)",
        "memories DB": "/data/data/com.termux/files/home/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "/data/data/com.termux/files/home/.codex (dir)",
        "standalone release cache": "1 entries in /data/data/com.termux/files/home/.codex/packages/standalone/releases",
        "state DB": "/data/data/com.termux/files/home/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok",
        "thread history DB": "/data/data/com.termux/files/home/.codex/thread_history_1.sqlite (missing)",
        "thread history DB integrity": "skipped (missing)"
      },
      "remediation": null,
      "durationMs": 78
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "ok",
      "summary": "rollout files and state DB thread inventory agree",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "0",
        "rollout DB active rows": "0",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "0",
        "rollout DB archived rows": "0",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "0",
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "none",
        "rollout DB rows": "0",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "none",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 42
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language en-US",
      "details": {
        "EDITOR": "not set",
        "LANG": "en_US.UTF-8",
        "VISUAL": "not set",
        "os": "Linux [unknown bitness]",
        "os language": "en-US",
        "os type": "Linux",
        "os version": "Unknown"
      },
      "remediation": null,
      "durationMs": 9
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "warning",
      "summary": "width 54 cols - output may wrap (recommended >=80)",
      "details": {
        "COLORTERM": "truecolor",
        "TERM": "xterm-256color",
        "color output": "enabled",
        "effective locale": "en_US.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "54x28"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "width 54 cols - output may wrap (recommended >=80)",
          "measured": "54 x 28",
          "expected": ">= 80 columns",
          "remedy": "resize the window to at least 80 columns",
          "fields": [
            "terminal size"
          ]
        }
      ],
      "remediation": null,
      "durationMs": 4
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "cwd",
        "terminal title project value": "home",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "check for update on startup": "true",
        "latest version": "0.146.0",
        "latest version status": "newer version is available",
        "update action": "standalone installer",
        "version cache": [
          "/data/data/com.termux/files/home/.codex/version.json",
          "missing"
        ]
      },
      "remediation": null,
      "durationMs": 1421
    }
  }
}

What issue are you seeing?

Codex login

Sign-in could not be completed

Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)

Error code
token_exchange_failed

Details
Token exchange failed: error sending request for url (https://auth.openai.com/oauth/token)

Return to Codex to retry, switch accounts, or contact your workspace admin if access is restricted.

What steps can reproduce the bug?

  1. Install latest stable termux app on android
  2. curl -fsSL https://chatgpt.com/codex/install.sh | sh
  3. codex / codex login
  4. Copy the url and open this in thé browser
  5. 5. Connect to your chatgpt account
  6. See the error

What is the expected behavior?

The connection succeed

Additional information

_No response_

View original on GitHub ↗