Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error generating images #3

Closed
jswny opened this issue Oct 3, 2020 · 6 comments
Closed

Error generating images #3

jswny opened this issue Oct 3, 2020 · 6 comments

Comments

@jswny
Copy link

jswny commented Oct 3, 2020

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'
@jstrieb jstrieb closed this as completed in 8bb4626 Oct 5, 2020
jstrieb added a commit that referenced this issue Oct 5, 2020
@jstrieb
Copy link
Owner

jstrieb commented Oct 5, 2020

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.

@jstrieb jstrieb reopened this Oct 5, 2020
@jswny
Copy link
Author

jswny commented Oct 5, 2020

@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?

jstrieb added a commit that referenced this issue Oct 5, 2020
Attempt to handle issue #3, but we'll see...
@jstrieb
Copy link
Owner

jstrieb commented Oct 5, 2020

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.

@jswny
Copy link
Author

jswny commented Oct 5, 2020

Thanks! It seems to work now!

@jswny jswny closed this as completed Oct 5, 2020
@jstrieb
Copy link
Owner

jstrieb commented Oct 5, 2020

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!

@CrossScarDev
Copy link

Got this on first run but after changing the readme and commiting it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants