waka-readme-stats: TypeError: 'NoneType' object is not subscriptable sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited

My waka-readme job failed today due to a TypeError. After re-running it worked fine, but maybe there is an underlying issue here so I’ll post the issue anyways 😃

Action run: https://github.com/Snailedlt/Snailedlt/actions/runs/5422855494/jobs/9860032571

Error log:

Traceback (most recent call last):
  File "/waka-readme-stats/main.py", line 221, in <module>
    run(main())
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 208, in main
    stats = await get_stats()
            ^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/main.py", line 156, in get_stats
    yearly_data, commit_data = await calculate_commit_data(repositories)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/yearly_commit_calculator.py", line [38](https://github.com/Snailedlt/Snailedlt/actions/runs/5422855494/jobs/9860032571#step:3:39), in calculate_commit_data
    await update_data_with_commit_stats(repo, yearly_data, date_data)
  File "/waka-readme-stats/yearly_commit_calculator.py", line 65, in update_data_with_commit_stats
    for commit in commit_data["data"]["repository"]["ref"]["target"]["history"]["nodes"]:
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 1
  • Comments: 38

Commits related to this issue

Most upvoted comments

The issue is still occurring (for weeks). I’ve created a fork to fix it. Until the merging of #464 and #478, you can apply the following quick fix:

    steps:
      - uses: cdfmlr/waka-readme-stats@master  # instead of anmol098/waka-readme-stats@master
2023-07-14T09:06:02.0932664Z �[34m	5/127 Retrieving repo: [private]�[0m
2023-07-14T09:06:04.2414062Z Traceback (most recent call last):
2023-07-14T09:06:04.2425078Z   File "/waka-readme-stats/main.py", line 221, in <module>
2023-07-14T09:06:04.2447027Z     run(main())
2023-07-14T09:06:04.2449177Z   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
2023-07-14T09:06:04.2452872Z     return runner.run(main)
2023-07-14T09:06:04.2453592Z            ^^^^^^^^^^^^^^^^
2023-07-14T09:06:04.2454321Z   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
2023-07-14T09:06:04.2455069Z     return self._loop.run_until_complete(task)
2023-07-14T09:06:04.2455751Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-07-14T09:06:04.2457003Z   File "/usr/local/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
2023-07-14T09:06:04.2480855Z     return future.result()
2023-07-14T09:06:04.2481465Z            ^^^^^^^^^^^^^^^
2023-07-14T09:06:04.2482129Z   File "/waka-readme-stats/main.py", line 208, in main
2023-07-14T09:06:04.2482573Z     stats = await get_stats()
2023-07-14T09:06:04.2482931Z             ^^^^^^^^^^^^^^^^^
2023-07-14T09:06:04.2483440Z   File "/waka-readme-stats/main.py", line 156, in get_stats
2023-07-14T09:06:04.2484072Z     yearly_data, commit_data = await calculate_commit_data(repositories)

As the @AyushAgnihotri2025 logs says, it’s trying to get commit data from one of your 127 repos, and it didn’t threat the exception on not receiving it.

Same issue as #425.

Related code:

https://github.com/anmol098/waka-readme-stats/blob/f8cec5f73e6f2a551a25da883d849b06f471a918/sources/manager_download.py#L213-L231

There are already retries on 502. May adding some time.sleep be useful? (I feel it’s likely to be vain 😦