Skip to content

401 Error at every turn #10032

@ZackPlauche

Description

@ZackPlauche

Describe the bug

gh version 2.59.0 (2024-10-16)
https://github.com/cli/cli/releases/tag/v2.59.0

Often when trying to do something with gh related to a repo I continue to get the following error:

> gh browse
unable to determine base repository: HTTP 401: Bad credentials (https://api.github.com/graphql)
Try authenticating with:  gh auth login

I'm on Windows 11 commandline and keep having to do:

  1. set GITHUB_TOKEN= to clear it
  2. Login with gh auth login (annoyingly)
  3. Go through the whole process
  4. It's fixed for a little while
  5. Not much long after it's an issue again.

I've done this multiple times for different projects, and just now again today within less than an hour.

Steps to reproduce the behavior

It happens after opening another project, or a new terminal not that long after I JUST authenticated.

Expected vs actual behavior

I would expect me to just login once and NOT have to keep logging in every single day or multiple times a day.

Logs

Paste the activity from your command line. Redact if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiscussFeature changes that require discussion primarily among the GitHub CLI teamgh-authrelating to the gh auth commandmore-info-neededMore info needed from user/contributorneeds-triageneeds to be reviewed

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions