Skip to content

Spurious missing read:project scope warnings #12904

@simonwhitaker

Description

@simonwhitaker

Describe the bug

When I try to view a PR, I get an error about missing project scope warnings.

$ gh pr view 1
error: your authentication token is missing required scopes [read:project]
To request it, run:  gh auth refresh -s read:project

Affected version

Please run gh version and paste the output below.

$ gh version
gh version 2.88.0 (2026-03-10)
https://github.com/cli/cli/releases/tag/v2.88.0

Steps to reproduce the behavior

  1. Type this gh pr view 1
  2. See error

Expected vs actual behavior

I expect to see the contents of the PR

Logs

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

$ GH_DEBUG=api gh pr view 1 2>&1 | pbcopy
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2026-03-11 14:55:11.04269 +0000 GMT m=+0.151200334
* Request to https://api.github.com/graphql
> POST /graphql HTTP/1.1
> Host: api.github.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: token [redacted]
> Content-Length: 1767
> Content-Type: application/json; charset=utf-8
> Graphql-Features: merge_queue
> Time-Zone: Europe/London
> User-Agent: GitHub CLI 2.88.0
> X-Github-Api-Version: 2022-11-28

GraphQL query:
query PullRequestByNumber($owner: String!, $repo: String!, $pr_number: Int!) {
    repository(owner: $owner, name: $repo) {
      pullRequest(number: $pr_number) {url,number,title,state,body,author{login,...on User{id,name}},autoMergeRequest {authorEmail,commitBody,commitHeadline,mergeMethod,enabledAt,enabledBy{login,...on User{id,name}}},isDraft,maintainerCanModify,mergeable,additions,deletions,commits{totalCount},baseRefName,headRefName,headRepositoryOwner{id,login,...on User{name}},headRepository{id,name},isCrossRepository,reviewRequests(first: 100) {nodes {requestedReviewer {__typename,...on User{login,name},...on Bot{login},...on Team{organization{login}name,slug}}}},reviews(first: 100) {nodes {id,author{login},authorAssociation,submittedAt,body,state,commit{oid},reactionGroups{content,users{totalCount}}}pageInfo{hasNextPage,endCursor}totalCount},assignees(first:100){nodes{id,login,name,databaseId},totalCount},labels(first:100){nodes{id,name,description,color},totalCount},milestone{number,title,description,dueOn},comments(first: 100) {nodes {id,author{login,...on User{id,name}},authorAssociation,body,createdAt,includesCreatedEdit,isMinimized,minimizedReason,reactionGroups{content,users{totalCount}},url,viewerDidAuthor},pageInfo{hasNextPage,endCursor},totalCount},reactionGroups{content,users{totalCount}},createdAt,statusCheckRollup: commits(last: 1) {nodes {commit {statusCheckRollup {contexts(first:100) {nodes {__typename...on StatusContext {context,state,targetUrl,createdAt,description},...on CheckRun {name,checkSuite{workflowRun{workflow{name}}},status,conclusion,startedAt,completedAt,detailsUrl}},pageInfo{hasNextPage,endCursor}}}}}},id}
    }
  }
GraphQL variables: {"owner":"simonwhitaker","pr_number":1,"repo":"gibo"}

< HTTP/2.0 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json; charset=utf-8
< Date: Wed, 11 Mar 2026 14:55:11 GMT
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: github.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Accepted-Oauth-Scopes: repo
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Media-Type: github.v4; param=merge-info-preview.nebula-preview; format=json
< X-Github-Request-Id: D3C5:1BC16D:9714B:A9BCB:69B1824F
< X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
< X-Oauth-Scopes: gist, read:org, repo
< X-Ratelimit-Limit: 5000
< X-Ratelimit-Remaining: 4810
< X-Ratelimit-Reset: 1773242325
< X-Ratelimit-Resource: graphql
< X-Ratelimit-Used: 190
< X-Xss-Protection: 0

{
  "data": {
    "repository": {
      "pullRequest": {
        "url": "https://github.com/simonwhitaker/gibo/pull/1",
        "number": 1,
        "title": "Fix main entry condition test",
        "state": "MERGED",
        "body": "``` bash\nif [ $# == 0 ] ; then\n  # ...\nfi\n```\n\nThe above works in BASH (or probably similar shells). But it fails on DASH (default `sh` in debian).\nThis pull request fixes this.\n",
        "author": {
          "login": "ixti",
          "id": "MDQ6VXNlcjk0Nzgy",
          "name": "Alexey Zapparov"
        },
        "autoMergeRequest": null,
        "isDraft": false,
        "maintainerCanModify": false,
        "mergeable": "CONFLICTING",
        "additions": 1,
        "deletions": 1,
        "commits": {
          "totalCount": 1
        },
        "baseRefName": "master",
        "headRefName": "master",
        "headRepositoryOwner": {
          "id": "MDQ6VXNlcjk0Nzgy",
          "login": "ixti",
          "name": "Alexey Zapparov"
        },
        "headRepository": null,
        "isCrossRepository": true,
        "reviewRequests": {
          "nodes": []
        },
        "reviews": {
          "nodes": [],
          "pageInfo": {
            "hasNextPage": false,
            "endCursor": null
          },
          "totalCount": 0
        },
        "assignees": {
          "nodes": [],
          "totalCount": 0
        },
        "labels": {
          "nodes": [],
          "totalCount": 0
        },
        "milestone": null,
        "comments": {
          "nodes": [
            {
              "id": "MDEyOklzc3VlQ29tbWVudDU0NDMxMTA=",
              "author": {
                "login": "simonwhitaker",
                "id": "MDQ6VXNlcjExNjQzMg==",
                "name": "Simon Whitaker"
              },
              "authorAssociation": "OWNER",
              "body": "Nice catch, thanks. There are a few more == in the latest commit, I'll tweak those too.\n",
              "createdAt": "2012-05-01T17:14:56Z",
              "includesCreatedEdit": false,
              "isMinimized": false,
              "minimizedReason": null,
              "reactionGroups": [
                {
                  "content": "THUMBS_UP",
                  "users": {
                    "totalCount": 0
                  }
                },
                {
                  "content": "THUMBS_DOWN",
                  "users": {
                    "totalCount": 0
                  }
                },
                {
                  "content": "LAUGH",
                  "users": {
                    "totalCount": 0
                  }
                },
                {
                  "content": "HOORAY",
                  "users": {
                    "totalCount": 0
                  }
                },
                {
                  "content": "CONFUSED",
                  "users": {
                    "totalCount": 0
                  }
                },
                {
                  "content": "HEART",
                  "users": {
                    "totalCount": 0
                  }
                },
                {
                  "content": "ROCKET",
                  "users": {
                    "totalCount": 0
                  }
                },
                {
                  "content": "EYES",
                  "users": {
                    "totalCount": 0
                  }
                }
              ],
              "url": "https://github.com/simonwhitaker/gibo/pull/1#issuecomment-5443110",
              "viewerDidAuthor": true
            }
          ],
          "pageInfo": {
            "hasNextPage": false,
            "endCursor": "Y3Vyc29yOnYyOpHOAFMOJg=="
          },
          "totalCount": 1
        },
        "reactionGroups": [
          {
            "content": "THUMBS_UP",
            "users": {
              "totalCount": 0
            }
          },
          {
            "content": "THUMBS_DOWN",
            "users": {
              "totalCount": 0
            }
          },
          {
            "content": "LAUGH",
            "users": {
              "totalCount": 0
            }
          },
          {
            "content": "HOORAY",
            "users": {
              "totalCount": 0
            }
          },
          {
            "content": "CONFUSED",
            "users": {
              "totalCount": 0
            }
          },
          {
            "content": "HEART",
            "users": {
              "totalCount": 0
            }
          },
          {
            "content": "ROCKET",
            "users": {
              "totalCount": 0
            }
          },
          {
            "content": "EYES",
            "users": {
              "totalCount": 0
            }
          }
        ],
        "createdAt": "2012-05-01T16:11:32Z",
        "statusCheckRollup": {
          "nodes": [
            {
              "commit": {
                "statusCheckRollup": null
              }
            }
          ]
        },
        "id": "MDExOlB1bGxSZXF1ZXN0MTI2NTIwOA=="
      }
    }
  }
}

* Request took 565.115417ms
* Request at 2026-03-11 14:55:11.647653 +0000 GMT m=+0.756159918
* Request to https://api.github.com/graphql
> POST /graphql HTTP/1.1
> Host: api.github.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: token [redacted]
> Content-Length: 468
> Content-Type: application/json
> Graphql-Features: merge_queue
> Time-Zone: Europe/London
> User-Agent: GitHub CLI 2.88.0
> X-Github-Api-Version: 2022-11-28

GraphQL query:
query PullRequestProjectItems($endCursor:String$name:String!$number:Int!$owner:String!){repository(owner: $owner, name: $name){pullRequest(number: $number){projectItems(first: 100, after: $endCursor){totalCount,nodes{id,project{id,title},status:fieldValueByName(name: "Status"){... on ProjectV2ItemFieldSingleSelectValue{optionId,name}}},pageInfo{hasNextPage,endCursor}}}}}
GraphQL variables: {"endCursor":null,"name":"gibo","number":1,"owner":"simonwhitaker"}

< HTTP/2.0 200 OK
< Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
< Content-Security-Policy: default-src 'none'
< Content-Type: application/json; charset=utf-8
< Date: Wed, 11 Mar 2026 14:55:11 GMT
< Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
< Server: github.com
< Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
< Vary: Accept-Encoding, Accept, X-Requested-With
< X-Accepted-Oauth-Scopes: repo
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-Github-Media-Type: github.v4; param=merge-info-preview.nebula-preview; format=json
< X-Github-Request-Id: D3C5:1BC16D:971D9:A9C6F:69B1824F
< X-Oauth-Client-Id: 178c6fc778ccc68e1d6a
< X-Oauth-Scopes: gist, read:org, repo
< X-Ratelimit-Limit: 5000
< X-Ratelimit-Remaining: 4809
< X-Ratelimit-Reset: 1773242325
< X-Ratelimit-Resource: graphql
< X-Ratelimit-Used: 191
< X-Xss-Protection: 0

{
  "errors": [
    {
      "type": "INSUFFICIENT_SCOPES",
      "locations": [
        {
          "line": 1,
          "column": 218
        }
      ],
      "message": "Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:project'], but your token has only been granted the: ['gist', 'read:org', 'repo'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens."
    },
    {
      "type": "INSUFFICIENT_SCOPES",
      "locations": [
        {
          "line": 1,
          "column": 229
        }
      ],
      "message": "Your token has not been granted the required scopes to execute this query. The 'id' field requires one of the following scopes: ['read:project'], but your token has only been granted the: ['gist', 'read:org', 'repo'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens."
    },
    {
      "type": "INSUFFICIENT_SCOPES",
      "locations": [
        {
          "line": 1,
          "column": 232
        }
      ],
      "message": "Your token has not been granted the required scopes to execute this query. The 'title' field requires one of the following scopes: ['read:project'], but your token has only been granted the: ['gist', 'read:org', 'repo'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens."
    },
    {
      "type": "INSUFFICIENT_SCOPES",
      "locations": [
        {
          "line": 1,
          "column": 322
        }
      ],
      "message": "Your token has not been granted the required scopes to execute this query. The 'optionId' field requires one of the following scopes: ['read:project'], but your token has only been granted the: ['gist', 'read:org', 'repo'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens."
    },
    {
      "type": "INSUFFICIENT_SCOPES",
      "locations": [
        {
          "line": 1,
          "column": 331
        }
      ],
      "message": "Your token has not been granted the required scopes to execute this query. The 'name' field requires one of the following scopes: ['read:project'], but your token has only been granted the: ['gist', 'read:org', 'repo'] scopes. Please modify your token's scopes at: https://github.com/settings/tokens."
    }
  ]
}

* Request took 206.028708ms
error: your authentication token is missing required scopes [read:project]
To request it, run:  gh auth refresh -s read:project

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggh-prrelating to the gh pr commandpriority-1Affects a large population and inhibits work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions