github-readme-stats icon indicating copy to clipboard operation
github-readme-stats copied to clipboard

Cannot read property 'data' of undefined

Open JLLeitschuh opened this issue 4 years ago • 12 comments

Describe the bug

Loading for my profile seems to be broken. In the defense of this project though, I have a bit of an unusual profile. 😆

The error I see is:

Cannot read property 'data' of undefined

Expected behavior A clear and concise description of what you expected to happen.

Screenshots / Live demo link (paste the github-readme-stats link as markdown image) If applicable, add screenshots to help explain your problem.

Screen Shot 2021-11-16 at 5 12 00 PM

Additional context

I have ~1.2k repositories against my account. I'm in 56 GitHub organizations. Across a span of two days last year I generated 1,596 PRs from my account, and across another two days I generated a further 3,500 something PRs from my account. I'm also a GitHub Star.

JLLeitschuh avatar Nov 16 '21 22:11 JLLeitschuh

Hi @JLLeitschuh thanks for reporting the issue.

Yes there are few people who are facing similar issues, seems like there is something wrong with GitHub's API.

@rickstaa and I even contacted github support for one of the similar issues with github's api's getting timed out. We'll look into whats happening with this.

anuraghazra avatar Nov 17 '21 12:11 anuraghazra

Here, see how the graphql API is timing out.

image

anuraghazra avatar Nov 17 '21 13:11 anuraghazra

I have lots of contacts inside of GitHub, could you include in a response the full GraphQl query used here? I can get in contact with some of the GH folks to see if I can get this resolved sooner.

JLLeitschuh avatar Nov 17 '21 13:11 JLLeitschuh

@JLLeitschuh As pointed out by @anuraghazra the Github Support is looking into this problem. I however have not received an update yet. I will update https://github.com/anuraghazra/github-readme-stats/issues/1406 when I hear from them. The GitHub support ticket number is 1369436.

rickstaa avatar Nov 17 '21 14:11 rickstaa

Here's the GraphQL query

Here's the previous issue where we were discussing the same problem but we found a workaround: https://github.com/anuraghazra/github-readme-stats/issues/1406

Here's the hotfix which I did: https://github.com/anuraghazra/github-readme-stats/pull/1409

        user(login: "JLLeitschuh") {
          name
          login
          contributionsCollection {
            totalCommitContributions
            restrictedContributionsCount
          }
          repositoriesContributedTo(first: 1, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {
            totalCount
          }
          pullRequests(first: 1) {
            totalCount
          }
          openIssues: issues(states: OPEN) {
            totalCount
          }
          closedIssues: issues(states: CLOSED) {
            totalCount
          }
          followers {
            totalCount
          }
          repositories(first: 100, ownerAffiliations: OWNER, orderBy: {direction: DESC, field: STARGAZERS}) {
            totalCount
            nodes {
              stargazers {
                totalCount
              }
            }
          }
        }

@rickstaa can you share the previous ticket number of the report which we sent to github with @JLLeitschuh?

anuraghazra avatar Nov 17 '21 14:11 anuraghazra

I do have the same error with https://github-readme-stats.vercel.app/api?username=VincentLanglet

VincentLanglet avatar Feb 15 '22 21:02 VincentLanglet

@VincentLanglet thanks a lot for your comment. Do you also get a timeout error when you fetch the data in the https://docs.github.com/en/graphql/overview/explorer.

rickstaa avatar Feb 18 '22 09:02 rickstaa

@VincentLanglet thanks a lot for your comment. Do you also get a timeout error when you fetch the data in the https://docs.github.com/en/graphql/overview/explorer.

No, but seems like https://github-readme-stats.vercel.app/api?username=VincentLanglet is working today. There are day with, and day without

VincentLanglet avatar Feb 18 '22 09:02 VincentLanglet

@VincentLanglet ah that looks like a timeout problem and might be related to https://github.com/anuraghazra/github-readme-stats/issues/1406. Unfortunately, we have no updates from the Github team on whether they are planning to fix this. 😕

rickstaa avatar Feb 18 '22 09:02 rickstaa

Can I get a link to the support ticket? I can pass this along to the GitHub team, I have some direct connections I can leverage.

JLLeitschuh avatar Feb 23 '22 16:02 JLLeitschuh

@JLLeitschuh Thanks a lot for offering to bring this issue to the attention of the GH team. The ticket is already closed and is under a private link. The ticket number, however, is 1369436.

rickstaa avatar Feb 23 '22 16:02 rickstaa

For other people that end up on this issue, I solved this by choosing classic tokens instead of fine-grained ones.

image

So one of the reasons for this error, assuming there are multiple, might be the token type (or the fine grained config I did wrong).

marcospb19 avatar Jan 25 '23 05:01 marcospb19

Duplicate of #https://github.com/anuraghazra/github-readme-stats/issues/1406.

rickstaa avatar May 06 '23 09:05 rickstaa