ljharb / repo-report

CLI to list all repos a user has access to, and report on their configuration in aggregate.
MIT License
24 stars 11 forks source link

unknown query error: `./bin/run --pick Access --actual` #53

Open ljharb opened 2 years ago

ljharb commented 2 years ago

I ran ./bin/run --pick Access --actual to try to find a repo where i have Maintain privileges. I got this error:

ℹ Config file found at $HOME/.repo-report.json
$PWD/node_modules/@octokit/request/dist-node/index.js:86
      const error = new requestError.RequestError(toErrorMessage(data), status, {
                    ^

RequestError [HttpError]: Unknown error: {"data":null,"errors":[{"message":"Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include `CDCB:7ADC:553568:5C3CFE:61685D53` when reporting this issue."}]}
    at $PWD/node_modules/@octokit/request/dist-node/index.js:86:21
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getRepositories ($PWD/src/utils.js:126:20)
    at async detail ($PWD/src/commands/detail.js:144:35) {
  status: 502,
  response: {
    url: 'https://api.github.com/graphql',
    status: 502,
    headers: {
      'access-control-allow-origin': '*',
      'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
      connection: 'close',
      'content-type': 'application/json',
      date: 'Thu, 14 Oct 2021 16:39:57 GMT',
      server: 'GitHub.com',
      'transfer-encoding': 'chunked',
      vary: 'Accept-Encoding, Accept, X-Requested-With',
      'x-github-request-id': 'CDCB:7ADC:553568:5C3CFE:61685D53'
    },
    data: {
      data: null,
      errors: [
        {
          message: 'Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include `CDCB:7ADC:553568:5C3CFE:61685D53` when reporting this issue.'
        }
      ]
    }
  },
  request: {
    method: 'POST',
    url: 'https://api.github.com/graphql',
    headers: {
      accept: 'application/vnd.github.v3+json',
      'user-agent': 'octokit-graphql.js/4.8.0 Node.js/16.9.0 (darwin; x64)',
      authorization: 'token [REDACTED]',
      'content-type': 'application/json; charset=utf-8'
    },
    body: '{"query":"query {\\n  viewer {\\n\\trepositories(\\n\\t  first: 100\\n\\t  affiliations: [OWNER, ORGANIZATION_MEMBER, COLLABORATOR]\\n\\t  after: \\"Y3Vyc29yOnYyOpHOAnugBw==\\"\\n\\t  isFork: false\\n\\t  privacy: PUBLIC\\n\\t) {\\n\\t  totalCount\\n\\t  pageInfo {\\n\\t\\tendCursor\\n\\t\\thasNextPage\\n\\t}\\n\\tnodes {\\n\\t\\tname\\n\\t\\tnameWithOwner\\n\\t\\tdefaultBranchRef {\\n\\t\\t\\tname\\n\\t\\t\\tbranchProtectionRule {\\n\\t\\t\\t\\tallowsForcePushes\\n\\t\\t\\t\\tallowsDeletions\\n\\t\\t\\t\\tdismissesStaleReviews\\n\\t\\t\\t\\trequiredApprovingReviewCount\\n\\t\\t\\t\\trequiresApprovingReviews\\n\\t\\t\\t\\trequiresCodeOwnerReviews\\n\\t\\t\\t\\trequiresConversationResolution\\n\\t\\t\\t\\trestrictsPushes\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\tdeleteBranchOnMerge\\n\\t\\thasIssuesEnabled\\n\\t\\thasProjectsEnabled\\n\\t\\thasWikiEnabled\\n\\t\\tisArchived\\n\\t\\tisBlankIssuesEnabled\\n\\t\\tisFork\\n\\t\\tisPrivate\\n\\t\\tisSecurityPolicyEnabled\\n\\t\\tisTemplate\\n\\t\\tlicenseInfo {\\n\\t\\t\\tname\\n\\t\\t}\\n\\t\\tmergeCommitAllowed\\n\\t\\towner {\\n\\t\\t\\tlogin\\n\\t\\t}\\n\\t\\trebaseMergeAllowed\\n\\t\\tsquashMergeAllowed\\n\\t\\tcreatedAt\\n\\t\\tupdatedAt\\n\\t\\tpushedAt\\n\\t\\tviewerHasStarred\\n\\t\\tviewerPermission\\n\\t\\tviewerSubscription\\n\\t  }\\n\\t}\\n  }\\n  rateLimit {\\n\\tcost\\n\\tremaining\\n  }\\n}\\n"}'
  }
}

When I modified my config file so Access only contained "Maintain", and ran ./bin/run, i got the same error

ljharb commented 2 years ago

Turns out this was a temporary brownout of my old github token format; it works now. We should still handle this error better.