镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Error generating images #3

Closed
Closed

Description

@jswny

I've forked the repo into my own repo here and I've done all the setup steps. The Generate images actions step fails. The log contains hundreds of lines that say A path returned 202. Retrying..., and the following error:

Traceback (most recent call last):
  File "generate_images.py", line 105, in <module>
    asyncio.run(main())
  File "/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/asyncio/runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "/opt/hostedtoolcache/Python/3.8.5/x64/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "generate_images.py", line 101, in main
    await asyncio.gather(generate_languages(s), generate_overview(s))
  File "generate_images.py", line 41, in generate_overview
    changed = (await s.lines_changed)[0] + (await s.lines_changed)[1]
  File "/home/runner/work/github-stats/github-stats/github_stats.py", line 437, in lines_changed
    author = author_obj.get("author", {}).get("login", "")
AttributeError: 'str' object has no attribute 'get'

Activity

  1. added a commit that references this issue on Oct 5, 2020
    f44d675
  2. jstrieb commented on Oct 5, 2020

    @jstrieb
    Owner

    Didn't mean to close this. Apparently putting "Fix #3" in the commit message auto-closes an issue.

    I just pushed something I hope will fix the issue, but I am not totally sure. To be precise: I changed the infinite loop that generates all of the 202s into a loop with a max number of tries that returns incomplete data as a fallback. Please merge the change into your fork and see if it works better.

    Also, for more info, see #3.

  3. reopened this on Oct 5, 2020
  4. jswny commented on Oct 5, 2020

    @jswny
    Author

    @jstrieb Thanks for looking at this! Unfortunately, I get the same result with the hundreds of 202 messages, and the same error from above. I also get this every so often There were too many 202s. Data for this repository will be incomplete.

    Since the process still exits with error code 1 in the actions job, the commit to repo is not executed. Is it possible you need to make the process exit cleanly if there are too many 202s so it still commits something?

  5. added a commit that references this issue on Oct 5, 2020
  6. jstrieb commented on Oct 5, 2020

    @jstrieb
    Owner

    Thanks for the quick response on this. I'm assuming that there is a JSON error message response that the program is trying to iterate over as if it was well-formed author data. I've added what I hope is a fix, but it's hard to know for sure whether it will work for your situation without being able to replicate the error locally.

  7. jswny commented on Oct 5, 2020

    @jswny
    Author

    Thanks! It seems to work now!

  8. jstrieb commented on Oct 5, 2020

    @jstrieb
    Owner

    Glad you were able to get it working! These fixes will definitely help this code work better for others in the future, so I appreciate you working with me to iron out the bugs. Hopefully GitHub adds contributor/viewer statistics to the v4 GraphQL API so that it's a little less glitchy.

    Thanks for using the project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions