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
- fix: github action of wakatime stas not working Solution: - https://github.com/anmol098/waka-readme-stats/issues/463#issuecomment-1803349446 — committed to beatrizsmerino/beatrizsmerino by beatrizsmerino 7 months ago
- fix: github action of wakatime stas not working Error: - RuntimeWarning: coroutine 'AsyncClient.get' was never awaited Solution: - Uses `cdfmlr/waka-readme-stats@master` instead of `anmol098/waka-re... — committed to beatrizsmerino/beatrizsmerino by beatrizsmerino 7 months ago
- fix: wakatime stats does not update with github action References: - https://github.com/anmol098/waka-readme-stats/pull/485 - https://github.com/anmol098/waka-readme-stats/issues/463 — committed to beatrizsmerino/beatrizsmerino by beatrizsmerino 7 months ago
- fix: wakatime stats does not update with github action References: - https://github.com/anmol098/waka-readme-stats/issues/463#issuecomment-1820511141 — committed to beatrizsmerino/beatrizsmerino by beatrizsmerino 7 months ago
- fix: wakatime stats does not update with github action References: - https://github.com/anmol098/waka-readme-stats/issues/463#issuecomment-1820830868 — committed to beatrizsmerino/beatrizsmerino by beatrizsmerino 7 months ago
- refactor: switching back to `anmol098/waka-readme-stats@master` References: - https://github.com/anmol098/waka-readme-stats/issues/463#issuecomment-1824010711 — committed to beatrizsmerino/beatrizsmerino by beatrizsmerino 7 months ago
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:
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 sometime.sleep
be useful? (I feel it’s likely to be vain 😦