Skip to content

Copilot /login fails with "fetch failed" behind corporate proxy while gh auth succeeds, logs show "Github CLI authenticated with valid token" but no error details #175

@vkoppara

Description

@vkoppara

Describe the bug

I can authenticate Github CLI (gh) using a new fine-grained PAT over https.
Copilot /login still fails with "Error during sign-in: fetch failed".
Logs only show "Github CLI authenticated with valid token" and no further details
Environment is behind a corporate proxy with Kerberos negotiation; I'm using a local px-proxy (python) bridge to make gh work.

Affected version

0.0328 Commit: 3755a93

Steps to reproduce the behavior

Setup http(s) proxy through corporate proxy (kerberos)
Use px-proxy locally; run gh auth login with fine-grained PAT -> succeeds.
Run copilot /login -> shows "Error during sign-in: fetch failed".

OS: macOS
Node Version: v22.19.0 & also tried with v24.9.0 (with NODE_USE_ENV_PROXY=1)

Expected behavior

copilot /login succeeds using the same networking/proxy setup.
Or logs provide actionable diagnostics (proxy/TLS/Auth) to troubleshoot.

Additional context

What I tried:
Confirmed gh auth works via px-proxy
Verified PAT scopes (repo, read:org, workflow)
Confirmed HTTPS protocol and base host github.com

** gh auth login **
@ log % gh auth login
? Where do you use GitHub? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Paste an authentication token
Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
The minimum required scopes are 'repo', 'read:org', 'workflow'
? Paste your authentication token: ***********************************************
-gh config set -h github.com git_protocol https
Configured git protocol
Logged in as

** Copilot Logs **
@ %cat log/.log
2025-10-02T03:27:36.494Z [START-GROUP] gh auth token --hostname github.com
2025-10-02T03:27:36.496Z [START-GROUP] gh auth token --hostname github.com
2025-10-02T03:27:36.658Z [DEBUG] ******

2025-10-02T03:27:36.658Z [END-GROUP]
2025-10-02T03:27:36.659Z [DEBUG] GitHub CLI authenticated with valid token
2025-10-02T03:27:36.664Z [DEBUG] ******

2025-10-02T03:27:36.664Z [END-GROUP]
2025-10-02T03:27:36.664Z [DEBUG] GitHub CLI authenticated with valid token

I also tried with the following steps:

  1. gh auth logout
  2. export GH_TOKEN=
  3. copilot --log-level debug --log-dir ./log (& /login)
  4. still same issue (with "GitHub CLI authenticated with valid token" in the copilot log)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions