anmol098 / waka-readme-stats

This GitHub action helps to add cool dev metrics to your github profile Readme
MIT License
3.39k stars 555 forks source link

TypeError: 'NoneType' object is not subscriptable sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited #463

Open Snailedlt opened 1 year ago

Snailedlt commented 1 year ago

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
AyushAgnihotri2025 commented 1 year ago

@Snailedlt How did you fix that, as I am also getting the same error again and again?

Snailedlt commented 1 year ago

@Snailedlt How did you fix that, as I am also getting the same error again and again?

I just re-ran the job and it worked fine

AyushAgnihotri2025 commented 1 year ago

@Snailedlt How did you fix that, as I am also getting the same error repeatedly?

I just re-ran the job and it worked fine

But in mine, it fails every time with the same error.

Snailedlt commented 1 year ago

@AyushAgnihotri2025 Try re-running it with debug enabled and post the complete log here

willnaoosmith commented 1 year ago

This same issue was mentioned and being discussed on this issue.

What happens: looks like the GitHub API takes too long to answer when fetching the commit history of one of your repositories (Or a repository you contribute to).

I posted my debug log there, could be the same issue for you. I need some time to check the code and try to fix it. A try/except should help.

AyushAgnihotri2025 commented 1 year ago

@AyushAgnihotri2025 Try re-running it with debug enabled and post the complete log here

2023-07-14T09:05:30.9150807Z Requested labels: ubuntu-latest
2023-07-14T09:05:30.9151061Z Job defined at: AyushAgnihotri2025/Wakatime-Test/.github/workflows/wakatime.yml@refs/heads/master
2023-07-14T09:05:30.9151226Z Waiting for a runner to pick up this job...
2023-07-14T09:05:31.5074251Z Job is waiting for a hosted runner to come online.
2023-07-14T09:05:34.6354413Z Job is about to start running on the hosted runner: GitHub Actions 2 (hosted)
2023-07-14T09:05:37.2267505Z ##[debug]Starting: Update Readme with Metrics
2023-07-14T09:05:37.2299240Z ##[debug]Cleaning runner temp folder: /home/runner/work/_temp
2023-07-14T09:05:37.2640460Z ##[debug]Starting: Set up job
2023-07-14T09:05:37.2641037Z Current runner version: '2.306.0'
2023-07-14T09:05:37.2669490Z ##[group]Operating System
2023-07-14T09:05:37.2670224Z Ubuntu
2023-07-14T09:05:37.2670644Z 22.04.2
2023-07-14T09:05:37.2670959Z LTS
2023-07-14T09:05:37.2671347Z ##[endgroup]
2023-07-14T09:05:37.2671809Z ##[group]Runner Image
2023-07-14T09:05:37.2672293Z Image: ubuntu-22.04
2023-07-14T09:05:37.2672731Z Version: 20230710.1.0
2023-07-14T09:05:37.2673390Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230710.1/images/linux/Ubuntu2204-Readme.md
2023-07-14T09:05:37.2674283Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230710.1
2023-07-14T09:05:37.2674937Z ##[endgroup]
2023-07-14T09:05:37.2675417Z ##[group]Runner Image Provisioner
2023-07-14T09:05:37.2675869Z 2.0.238.1
2023-07-14T09:05:37.2676514Z ##[endgroup]
2023-07-14T09:05:37.2677449Z ##[group]GITHUB_TOKEN Permissions
2023-07-14T09:05:37.2678282Z Contents: read
2023-07-14T09:05:37.2678779Z Metadata: read
2023-07-14T09:05:37.2679204Z Packages: read
2023-07-14T09:05:37.2679566Z ##[endgroup]
2023-07-14T09:05:37.2683869Z Secret source: Actions
2023-07-14T09:05:37.2684737Z ##[debug]Primary repository: AyushAgnihotri2025/Wakatime-Test
2023-07-14T09:05:37.2685368Z Prepare workflow directory
2023-07-14T09:05:37.2780673Z ##[debug]Creating pipeline directory: '/home/runner/work/Wakatime-Test'
2023-07-14T09:05:37.2783978Z ##[debug]Creating workspace directory: '/home/runner/work/Wakatime-Test/Wakatime-Test'
2023-07-14T09:05:37.2785282Z ##[debug]Update context data
2023-07-14T09:05:37.2789386Z ##[debug]Evaluating job-level environment variables
2023-07-14T09:05:37.3470874Z ##[debug]Evaluating job container
2023-07-14T09:05:37.3475287Z ##[debug]Evaluating job service containers
2023-07-14T09:05:37.3478394Z ##[debug]Evaluating job defaults
2023-07-14T09:05:37.3573646Z Prepare all required actions
2023-07-14T09:05:37.3803061Z Getting action download info
2023-07-14T09:05:37.6487706Z Download action repository 'anmol098/waka-readme-stats@master' (SHA:f8cec5f73e6f2a551a25da883d849b06f471a918)
2023-07-14T09:05:38.0526272Z ##[debug]Download 'https://api.github.com/repos/anmol098/waka-readme-stats/tarball/f8cec5f73e6f2a551a25da883d849b06f471a918' to '/home/runner/work/_actions/_temp_38b4ef6a-6b92-4a7a-8bff-6bfa14c2bab0/8f7ed822-cb1d-4fc3-9057-0b3456b94735.tar.gz'
2023-07-14T09:05:38.1486971Z ##[debug]Unwrap 'anmol098-waka-readme-stats-f8cec5f' to '/home/runner/work/_actions/anmol098/waka-readme-stats/master'
2023-07-14T09:05:38.1555177Z ##[debug]Archive '/home/runner/work/_actions/_temp_38b4ef6a-6b92-4a7a-8bff-6bfa14c2bab0/8f7ed822-cb1d-4fc3-9057-0b3456b94735.tar.gz' has been unzipped into '/home/runner/work/_actions/anmol098/waka-readme-stats/master'.
2023-07-14T09:05:38.1750516Z ##[debug]action.yml for action: '/home/runner/work/_actions/anmol098/waka-readme-stats/master/action.yml'.
2023-07-14T09:05:38.2791282Z ##[debug]Container image for action: 'wakareadmestats/waka-readme-stats:master'.
2023-07-14T09:05:38.3154807Z ##[debug]Set step '__anmol098_waka-readme-stats' display name to: 'Run anmol098/waka-readme-stats@master'
2023-07-14T09:05:38.3155846Z Complete job name: Update Readme with Metrics
2023-07-14T09:05:38.3168430Z ##[debug]Collect running processes for tracking orphan processes.
2023-07-14T09:05:38.3412958Z ##[debug]Finishing: Set up job
2023-07-14T09:05:38.3675092Z ##[debug]Evaluating condition for step: 'Pull wakareadmestats/waka-readme-stats:master'
2023-07-14T09:05:38.3742428Z ##[debug]Evaluating: success()
2023-07-14T09:05:38.3749204Z ##[debug]Evaluating success:
2023-07-14T09:05:38.3779828Z ##[debug]=> true
2023-07-14T09:05:38.3787929Z ##[debug]Result: true
2023-07-14T09:05:38.3835567Z ##[debug]Starting: Pull wakareadmestats/waka-readme-stats:master
2023-07-14T09:05:38.3921056Z ##[group]Pull down action image 'wakareadmestats/waka-readme-stats:master'
2023-07-14T09:05:38.4006891Z ##[command]/usr/bin/docker pull wakareadmestats/waka-readme-stats:master
2023-07-14T09:05:39.2811316Z master: Pulling from wakareadmestats/waka-readme-stats
2023-07-14T09:05:39.4347832Z f56be85fc22e: Already exists
2023-07-14T09:05:39.4387419Z ea5757f4b3f8: Pulling fs layer
2023-07-14T09:05:39.4387818Z 757892be48e6: Pulling fs layer
2023-07-14T09:05:39.4388131Z 9c44c1393ea4: Pulling fs layer
2023-07-14T09:05:39.4388463Z a24e881083d5: Pulling fs layer
2023-07-14T09:05:39.4388876Z 40cb73425338: Pulling fs layer
2023-07-14T09:05:39.4389186Z da4720dae504: Pulling fs layer
2023-07-14T09:05:39.4389477Z 77dae5b04a31: Pulling fs layer
2023-07-14T09:05:39.4389779Z 28a343801171: Pulling fs layer
2023-07-14T09:05:39.4390077Z ec9f69273e5e: Pulling fs layer
2023-07-14T09:05:39.4390406Z 7aa1067d69c8: Pulling fs layer
2023-07-14T09:05:39.4391079Z a24e881083d5: Waiting
2023-07-14T09:05:39.4391337Z 40cb73425338: Waiting
2023-07-14T09:05:39.4391601Z da4720dae504: Waiting
2023-07-14T09:05:39.4391924Z 77dae5b04a31: Waiting
2023-07-14T09:05:39.4392425Z 28a343801171: Waiting
2023-07-14T09:05:39.4392830Z ec9f69273e5e: Waiting
2023-07-14T09:05:39.4393097Z 7aa1067d69c8: Waiting
2023-07-14T09:05:39.6632295Z 9c44c1393ea4: Verifying Checksum
2023-07-14T09:05:39.6636820Z 9c44c1393ea4: Download complete
2023-07-14T09:05:39.6878767Z ea5757f4b3f8: Verifying Checksum
2023-07-14T09:05:39.8413192Z 757892be48e6: Verifying Checksum
2023-07-14T09:05:39.8464874Z 757892be48e6: Download complete
2023-07-14T09:05:39.8866281Z 40cb73425338: Verifying Checksum
2023-07-14T09:05:39.8870740Z 40cb73425338: Download complete
2023-07-14T09:05:39.9543809Z a24e881083d5: Verifying Checksum
2023-07-14T09:05:39.9548861Z a24e881083d5: Download complete
2023-07-14T09:05:40.0237849Z da4720dae504: Verifying Checksum
2023-07-14T09:05:40.0241783Z da4720dae504: Download complete
2023-07-14T09:05:40.1325810Z 28a343801171: Verifying Checksum
2023-07-14T09:05:40.1328904Z 28a343801171: Download complete
2023-07-14T09:05:40.1416080Z ea5757f4b3f8: Pull complete
2023-07-14T09:05:40.2384149Z ec9f69273e5e: Verifying Checksum
2023-07-14T09:05:40.2387769Z ec9f69273e5e: Download complete
2023-07-14T09:05:40.3201625Z 7aa1067d69c8: Verifying Checksum
2023-07-14T09:05:40.3205607Z 7aa1067d69c8: Download complete
2023-07-14T09:05:41.5108822Z 757892be48e6: Pull complete
2023-07-14T09:05:41.7064460Z 9c44c1393ea4: Pull complete
2023-07-14T09:05:42.2085884Z a24e881083d5: Pull complete
2023-07-14T09:05:42.3052632Z 40cb73425338: Pull complete
2023-07-14T09:05:42.4043184Z da4720dae504: Pull complete
2023-07-14T09:05:42.7883819Z 77dae5b04a31: Verifying Checksum
2023-07-14T09:05:42.7886741Z 77dae5b04a31: Download complete
2023-07-14T09:05:51.7579973Z 77dae5b04a31: Pull complete
2023-07-14T09:05:51.8141643Z 28a343801171: Pull complete
2023-07-14T09:05:51.8705842Z ec9f69273e5e: Pull complete
2023-07-14T09:05:51.9265172Z 7aa1067d69c8: Pull complete
2023-07-14T09:05:51.9318635Z Digest: sha256:90585c6ead061b2a2de1f1e047fa436f51c083e74edbe91e4408989c75d7134d
2023-07-14T09:05:51.9360786Z Status: Downloaded newer image for wakareadmestats/waka-readme-stats:master
2023-07-14T09:05:51.9364801Z docker.io/wakareadmestats/waka-readme-stats:master
2023-07-14T09:05:51.9389155Z ##[endgroup]
2023-07-14T09:05:51.9400933Z ##[debug]Finishing: Pull wakareadmestats/waka-readme-stats:master
2023-07-14T09:05:51.9418740Z ##[debug]Evaluating condition for step: 'Run anmol098/waka-readme-stats@master'
2023-07-14T09:05:51.9425223Z ##[debug]Evaluating: success()
2023-07-14T09:05:51.9425679Z ##[debug]Evaluating success:
2023-07-14T09:05:51.9426298Z ##[debug]=> true
2023-07-14T09:05:51.9426814Z ##[debug]Result: true
2023-07-14T09:05:51.9428607Z ##[debug]Starting: Run anmol098/waka-readme-stats@master
2023-07-14T09:05:51.9700955Z ##[debug]Loading inputs
2023-07-14T09:05:51.9739636Z ##[debug]Evaluating: secrets.WAKATIME_API_KEY
2023-07-14T09:05:51.9740715Z ##[debug]Evaluating Index:
2023-07-14T09:05:51.9743197Z ##[debug]..Evaluating secrets:
2023-07-14T09:05:51.9744689Z ##[debug]..=> Object
2023-07-14T09:05:51.9761698Z ##[debug]..Evaluating String:
2023-07-14T09:05:51.9762533Z ##[debug]..=> 'WAKATIME_API_KEY'
2023-07-14T09:05:51.9767696Z ##[debug]=> '***'
2023-07-14T09:05:51.9769906Z ##[debug]Result: '***'
2023-07-14T09:05:51.9771205Z ##[debug]Evaluating: secrets.GH_TOKEN
2023-07-14T09:05:51.9771612Z ##[debug]Evaluating Index:
2023-07-14T09:05:51.9771935Z ##[debug]..Evaluating secrets:
2023-07-14T09:05:51.9772480Z ##[debug]..=> Object
2023-07-14T09:05:51.9772785Z ##[debug]..Evaluating String:
2023-07-14T09:05:51.9773094Z ##[debug]..=> 'GH_TOKEN'
2023-07-14T09:05:51.9773828Z ##[debug]=> '***'
2023-07-14T09:05:51.9774288Z ##[debug]Result: '***'
2023-07-14T09:05:51.9794680Z ##[debug]Evaluating: runner.debug
2023-07-14T09:05:51.9795006Z ##[debug]Evaluating Index:
2023-07-14T09:05:51.9795324Z ##[debug]..Evaluating runner:
2023-07-14T09:05:51.9795636Z ##[debug]..=> Object
2023-07-14T09:05:51.9795935Z ##[debug]..Evaluating String:
2023-07-14T09:05:51.9796227Z ##[debug]..=> 'debug'
2023-07-14T09:05:51.9796651Z ##[debug]=> '1'
2023-07-14T09:05:51.9796940Z ##[debug]Result: '1'
2023-07-14T09:05:51.9797730Z ##[debug]Loading env
2023-07-14T09:05:51.9903410Z ##[group]Run anmol098/waka-readme-stats@master
2023-07-14T09:05:51.9903751Z with:
2023-07-14T09:05:51.9904215Z   WAKATIME_API_KEY: ***
2023-07-14T09:05:51.9904684Z   GH_TOKEN: ***
2023-07-14T09:05:51.9904971Z   COMMIT_MESSAGE: Initial Commit
2023-07-14T09:05:51.9905294Z   COMMIT_EMAIL: contact@mrayush.me
2023-07-14T09:05:51.9905629Z   COMMIT_USERNAME: AyushAgnihotri2025
2023-07-14T09:05:51.9905970Z   SECTION_NAME: AyushAgnihotri2025
2023-07-14T09:05:51.9906277Z   SHOW_UPDATED_DATE: True
2023-07-14T09:05:51.9906555Z   SHOW_LINES_OF_CODE: True
2023-07-14T09:05:51.9906841Z   SHOW_PROJECTS: False
2023-07-14T09:05:51.9907124Z   SHOW_SHORT_INFO: False
2023-07-14T09:05:51.9907402Z   SHOW_LANGUAGE: True
2023-07-14T09:05:51.9907664Z   SHOW_OS: True
2023-07-14T09:05:51.9907937Z   SHOW_LANGUAGE_PER_REPO: False
2023-07-14T09:05:51.9908228Z   SHOW_TIMEZONE: False
2023-07-14T09:05:51.9908515Z   SHOW_LOC_CHART: False
2023-07-14T09:05:51.9908790Z   SHOW_EDITORS: True
2023-07-14T09:05:51.9909059Z   SHOW_COMMIT: True
2023-07-14T09:05:51.9909319Z   SHOW_DAYS_OF_WEEK: True
2023-07-14T09:05:51.9909607Z   SHOW_PROFILE_VIEWS: True
2023-07-14T09:05:51.9909904Z   SHOW_TOTAL_CODE_TIME: True
2023-07-14T09:05:51.9910197Z   COMMIT_BY_ME: False
2023-07-14T09:05:51.9910482Z   COMMIT_SINGLE: False
2023-07-14T09:05:51.9910734Z   LOCALE: en
2023-07-14T09:05:51.9911015Z   UPDATED_DATE_FORMAT: %d/%m/%Y %H:%M:%S
2023-07-14T09:05:51.9911336Z   SYMBOL_VERSION: 1
2023-07-14T09:05:51.9911604Z   DEBUG_LOGGING: 1
2023-07-14T09:05:51.9911864Z ##[endgroup]
2023-07-14T09:05:52.0258965Z ##[command]/usr/bin/docker run --name wakareadmestatswakareadmestatsmaster_6d89e9 --label c9a4a5 --workdir /github/workspace --rm -e "INPUT_WAKATIME_API_KEY" -e "INPUT_GH_TOKEN" -e "INPUT_COMMIT_MESSAGE" -e "INPUT_COMMIT_EMAIL" -e "INPUT_COMMIT_USERNAME" -e "INPUT_SECTION_NAME" -e "INPUT_SHOW_UPDATED_DATE" -e "INPUT_SHOW_LINES_OF_CODE" -e "INPUT_SHOW_PROJECTS" -e "INPUT_SHOW_SHORT_INFO" -e "INPUT_SHOW_LANGUAGE" -e "INPUT_SHOW_OS" -e "INPUT_SHOW_LANGUAGE_PER_REPO" -e "INPUT_SHOW_TIMEZONE" -e "INPUT_SHOW_LOC_CHART" -e "INPUT_PULL_BRANCH_NAME" -e "INPUT_PUSH_BRANCH_NAME" -e "INPUT_SHOW_EDITORS" -e "INPUT_SHOW_COMMIT" -e "INPUT_SHOW_DAYS_OF_WEEK" -e "INPUT_SHOW_PROFILE_VIEWS" -e "INPUT_SHOW_TOTAL_CODE_TIME" -e "INPUT_COMMIT_BY_ME" -e "INPUT_COMMIT_SINGLE" -e "INPUT_LOCALE" -e "INPUT_UPDATED_DATE_FORMAT" -e "INPUT_IGNORED_REPOS" -e "INPUT_SYMBOL_VERSION" -e "INPUT_DEBUG_LOGGING" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_DEBUG" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_ENVIRONMENT" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/Wakatime-Test/Wakatime-Test":"/github/workspace" wakareadmestats/waka-readme-stats:master
2023-07-14T09:05:54.2231354Z Program execution started at 14-07-2023 09:05:54:217486.
2023-07-14T09:05:55.0176981Z Current user: AyushAgnihotri2025.
2023-07-14T09:05:55.0191777Z Managers initialized.
2023-07-14T09:05:55.0192206Z Collecting stats for README...
2023-07-14T09:05:55.0192637Z Getting user repositories list...
2023-07-14T09:05:56.4523238Z   User repository list collected!
2023-07-14T09:05:58.4979680Z   User contributed to repository list collected!
2023-07-14T09:05:58.4980279Z Calculating commit data...
2023-07-14T09:05:58.4980771Z   1/127 Retrieving repo: [private]
2023-07-14T09:05:59.2129680Z   2/127 Retrieving repo: [private]
2023-07-14T09:05:59.9403516Z   3/127 Retrieving repo: [private]
2023-07-14T09:06:00.6941716Z   4/127 Retrieving repo: [private]
2023-07-14T09:06:02.0932664Z   5/127 Retrieving repo: [private]
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)
2023-07-14T09:06:04.2484548Z                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2023-07-14T09:06:04.2485553Z   File "/waka-readme-stats/yearly_commit_calculator.py", line 38, in calculate_commit_data
2023-07-14T09:06:04.2486169Z     await update_data_with_commit_stats(repo, yearly_data, date_data)
2023-07-14T09:06:04.2486904Z   File "/waka-readme-stats/yearly_commit_calculator.py", line 66, in update_data_with_commit_stats
2023-07-14T09:06:04.2487608Z     date = search(r"\d+-\d+-\d+", commit["committedDate"]).group()
2023-07-14T09:06:04.2488067Z                                   ~~~~~~^^^^^^^^^^^^^^^^^
2023-07-14T09:06:04.2488965Z TypeError: 'NoneType' object is not subscriptable
2023-07-14T09:06:04.3055390Z sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited
2023-07-14T09:06:04.5267666Z ##[debug]Docker Action run completed with exit code 1
2023-07-14T09:06:04.5458367Z ##[debug]Finishing: Run anmol098/waka-readme-stats@master
2023-07-14T09:06:04.5603303Z ##[debug]Starting: Complete job
2023-07-14T09:06:04.5605228Z Uploading runner diagnostic logs
2023-07-14T09:06:04.5668895Z ##[debug]Starting diagnostic file upload.
2023-07-14T09:06:04.5669294Z ##[debug]Setting up diagnostic log folders.
2023-07-14T09:06:04.5671588Z ##[debug]Creating diagnostic log files folder.
2023-07-14T09:06:04.5694777Z ##[debug]Copying 1 worker diagnostic logs.
2023-07-14T09:06:04.5716661Z ##[debug]Copying 1 runner diagnostic logs.
2023-07-14T09:06:04.5717984Z ##[debug]Zipping diagnostic files.
2023-07-14T09:06:04.5776415Z ##[debug]Uploading diagnostic metadata file.
2023-07-14T09:06:04.5811432Z ##[debug]Diagnostic file upload complete.
2023-07-14T09:06:04.5812351Z Completed runner diagnostic log upload
2023-07-14T09:06:04.5812694Z Cleaning up orphan processes
2023-07-14T09:06:04.6203817Z ##[debug]Finishing: Complete job
2023-07-14T09:06:04.6360714Z ##[debug]Finishing: Update Readme with Metrics
willnaoosmith commented 1 year ago
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.

BANanaD3V commented 1 year ago

Still happens for me even when using version from this PR

willnaoosmith commented 1 year ago

@BANanaD3V Any logs? And how did you test the PR? Gonna try to fix it later if I can compile a test version.

BANanaD3V commented 1 year ago

@BANanaD3V Any logs?

Yeah, i forked it and added some prints etc etc and it failed on nixpkgs repo, when i added try except (bad thing ik) and after that it says You have exceeded a secondary rate limit. Please wait a few minutes before you try again.. tried running it again like half an hour later, same thing.

BANanaD3V commented 1 year ago

any updates?

willnaoosmith commented 1 year ago

any updates?

None.

I'm using this one for now, you can see it on my profile.

One thing we could do is see why the this one works and this one does not, but it might need some long debugging and code changes so it does not exceed those limits.

I think it might have something related to the commit count of a repo, based on the previous log files and the fact that the athul's repo doesn't load commit data, only wakatime data (I think so? Might be wrong).

Would love to to these tasks but I really can't right now.

devnyxie commented 1 year ago

Hey :) Got the same issue even tho I don't have old/many repos, restarting doesn't help. Will follow the thread and switch temporary to "waka-readme" as @willnaoosmith did.

cdfmlr commented 1 year 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:

    steps:
      - uses: cdfmlr/waka-readme-stats@master  # instead of anmol098/waka-readme-stats@master
willnaoosmith commented 1 year ago

@cdfmlr tried the repo, and sadly it didn't work for me:

[...]

78/92 Retrieving repo: [private]
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, in calculate_commit_data
    await update_data_with_commit_stats(repo, yearly_data, date_data)
  File "/waka-readme-stats/yearly_commit_calculator.py", line 64, in update_data_with_commit_stats
    commit_data = await DM.get_remote_graphql("repo_commit_list", owner=owner, name=repo_details["name"], branch=branch["name"], id=GHM.USER.node_id)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/manager_download.py", line 293, in get_remote_graphql
    res = await DownloadManager._fetch_graphql_paginated(query, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/manager_download.py", line 267, in _fetch_graphql_paginated
    initial_query_response = await DownloadManager._fetch_graphql_query(query, **kwargs, pagination="first: 100")
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/manager_download.py", line 229, in _fetch_graphql_query
    return await DownloadManager._fetch_graphql_query(query, retries_count - 1, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/manager_download.py", line 229, in _fetch_graphql_query
    return await DownloadManager._fetch_graphql_query(query, retries_count - 1, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/waka-readme-stats/manager_download.py", line 229, in _fetch_graphql_query
    return await DownloadManager._fetch_graphql_query(query, retries_count - 1, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  [Previous line repeated 7 more times]
  File "/waka-readme-stats/manager_download.py", line 231, in _fetch_graphql_query
    raise Exception(f"Query '{query}' failed to run by returning code of {res.status_code}: {res.json()}")
Exception: Query 'repo_commit_list' failed to run by returning code of 502: {'data': None, 'errors': [{'message': 'Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include XXX when reporting this issue.'}]}
sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited

[...]

Same error message as always. Can someone try it as well to see if this happens only with me or if the fixes didn't work?

cdfmlr commented 1 year ago
Exception: Query 'repo_commit_list' failed to run by returning code of 502: {'data': None, 'errors': [{'message': 'Something went wrong while executing your query. This may be the result of a timeout, or it could be a GitHub bug. Please include XXX when reporting this issue.'}]}
sys:1: RuntimeWarning: coroutine 'AsyncClient.get' was never awaited

@willnaoosmith It's likely to be another issue. Seem to be a network problem (502 Bad Gateway)..

willnaoosmith commented 1 year ago

@willnaoosmith it's the same for everyone (Maybe, I hope so). See @AyushAgnihotri2025 logs in this issue, and it's the same.

The code tries to fetch commit data from a big repository, and it hits an API rate on GitHub, as it looks like.

[EDIT] Never mind, that didn't have a 502 error. Maybe the logs changed? I hope so.

Will wait for someone to post some logs.

cdfmlr commented 1 year ago

https://docs.github.com/en/graphql/overview/rate-limits-and-node-limits-for-the-graphql-api#exceeding-the-rate-limit

The doc say exceeding the rate limit response 200 or 403.

willnaoosmith commented 1 year ago

@cdfmlr well pointed. I have no idea what it can be then.

Forked the repository, will try to debug it later.

cdfmlr commented 1 year ago

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 :(

beatrizsmerino commented 1 year ago

Hello!! I'm having the same problem, my wakatime username is @beatrizsmerino

https://github.com/beatrizsmerino/beatrizsmerino/actions/runs/6918946818/job/18821734503

Captura de pantalla 2023-11-19 a las 7 56 19

Captura de pantalla 2023-11-19 a las 7 58 56

cdfmlr commented 1 year ago

Hello!! I'm having the same problem, my wakatime username is @beatrizsmerino

https://github.com/beatrizsmerino/beatrizsmerino/actions/runs/6918946818/job/18821734503

Captura de pantalla 2023-11-19 a las 7 56 19

Captura de pantalla 2023-11-19 a las 7 58 56

@beatrizsmerino, the issue arises because the Wakatime API responded with a status code of 202 instead of the expected 200.

Source code here:

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

However, I noticed that there is "data" in the JSON response. The 202 status just indicates that the data may not be up to date, but it's acceptable for use.

So A quick fix could be allowing the use of 202 on line 187. Does that sound correct?

beatrizsmerino commented 1 year ago

Maybe, but how can I do it?

cdfmlr commented 1 year ago

@beatrizsmerino

Maybe, but how can I do it?

You can fork my branch: https://github.com/cdfmlr/waka-readme-stats/tree/master (I have made some changes in action.yml to make code modifications take effect immediately without compiling and pushing images, much more easier for debug) and modify the code, after which then you can update your GitHub Action yaml, replace the user identifier to yours, for example:

    steps:
      - uses: cdfmlr/waka-readme-stats@master  # instead of anmol098/waka-readme-stats@master

If it works, you can make a PR to current repo (anmol098/waka-readme-stats).

P.s. the last commit in this repo (anmol098/waka-readme-stats) was 8 months ago. I'd be glad to maintain my fork (cdfmlr/waka-readme-stats) temporarily until the maintainers return. Feel free to submit a pull request to my repo as well.

beatrizsmerino commented 1 year ago

Ok thank you very much for the help, I will try it right now.

beatrizsmerino commented 1 year ago

@cdfmlr I opened a PR with the fixes https://github.com/anmol098/waka-readme-stats/pull/485 You can see it

Captura de pantalla 2023-11-21 a las 9 13 19

Captura de pantalla 2023-11-21 a las 9 28 57

cdfmlr commented 1 year ago

@beatrizsmerino Unfortunately, I can do nothing to your PR. I have no access to maintain this repository.

beatrizsmerino commented 1 year ago

I did something wrong because it didn't work

https://github.com/beatrizsmerino/beatrizsmerino/actions/runs/6941214625/job/18881598413 Captura de pantalla 2023-11-21 a las 9 45 07

beatrizsmerino commented 1 year ago

I have not worked with python before is the condition correct?

@beatrizsmerino Unfortunately, I can do nothing to your PR. I have no access to maintain this repository.

I have not worked with python before is the condition correct?

beatrizsmerino commented 1 year ago

Sorry, I had made the fork of the other repository.

https://github.com/cdfmlr/waka-readme-stats/pull/1

cdfmlr commented 1 year ago

The point is that the change of code won't make different until the author rebuild and push new the docker image.

To make the code modifications take effect immediately without compiling and pushing images in the GitHub Action, you can fork my branch, as I mentioned:

You can fork my branch: https://github.com/cdfmlr/waka-readme-stats/tree/master (I have made some changes in action.yml to make code modifications take effect immediately without compiling and pushing images, much more easier for debug)

Or, you may want to do this: https://github.com/anmol098/waka-readme-stats/commit/d6f3a510b23bab31f01aad4214abd04ee17b7d83

beatrizsmerino commented 1 year ago

Ok so I just need to do the fork of https://github.com/cdfmlr/waka-readme-stats/tree/master and change the link in my github action to

uses: beatrizsmerino/waka-readme-stats@master

I don't need to make any changes to the repository?

cdfmlr commented 1 year ago

@beatrizsmerino merged into https://github.com/cdfmlr/waka-readme-stats.

Please try it by:

    steps:
      - uses: cdfmlr/waka-readme-stats@master

Note: Your issue is duplicated with https://github.com/anmol098/waka-readme-stats/issues/482. And your fix is equal to https://github.com/anmol098/waka-readme-stats/pull/483.

beatrizsmerino commented 1 year ago

ok I will try again

beatrizsmerino commented 1 year ago

https://github.com/beatrizsmerino/beatrizsmerino/actions/runs/6944807442/job/18892764806

It still giving me problems Captura de pantalla 2023-11-21 a las 15 28 52

beatrizsmerino commented 1 year ago

Thank you very much!!! now it works for me

Captura de pantalla 2023-11-21 a las 22 09 15

Using your repository works. In case you ever want to delete your fork, what should I do?

Captura de pantalla 2023-11-21 a las 22 10 26

cdfmlr commented 1 year ago

@beatrizsmerino

Using your repository works. In case you ever want to delete your fork, what should I do?

Excuse my delayed response. #483 is merged. Please try to switch back to anmol098/waka-readme-stats@master.

beatrizsmerino commented 1 year ago

Thank you very much for your help!!!!! Now it works :heart_eyes: