Skip to content
New issue

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

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

Already on GitHub? # to your account

REPO_INFO: JSON Decoder Error on NULL Return from GH API #2893

Open
sgoggins opened this issue Aug 14, 2024 · 1 comment
Open

REPO_INFO: JSON Decoder Error on NULL Return from GH API #2893

sgoggins opened this issue Aug 14, 2024 · 1 comment
Assignees
Labels
bug Documents unexpected/wrong/buggy behavior

Comments

@sgoggins
Copy link
Member

sgoggins commented Aug 14, 2024

When the GH API Doesn't return data, we are not checking the code, or not handling NULL values:

Traceback (most recent call last):
  File "/home/ubuntu/github/virtualenvs/hosted/lib/python3.11/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github/virtualenvs/hosted/lib/python3.11/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github/augur/augur/tasks/github/repo_info/tasks.py", line 22, in collect_repo_info
    repo_info_model(key_auth, repo, logger)
  File "/home/ubuntu/github/augur/augur/tasks/github/repo_info/core.py", line 172, in repo_info_model
    committers_count = query_committers_count(key_auth, logger, owner, repo)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github/augur/augur/tasks/github/repo_info/core.py", line 22, in query_committers_count
    return github_data_access.get_resource_count(url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github/augur/augur/tasks/github/util/github_data_access.py", line 38, in get_resource_count
    data = self.get_resource(url)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ubuntu/github/augur/augur/tasks/github/util/github_data_access.py", line 89, in get_resource
    return response.json()
         ^^^^^^^^^^^^^^^
  File "/home/ubuntu/github/virtualenvs/hosted/lib/python3.11/site-packages/httpx/_models.py", line 743, in json
    return jsonlib.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@sgoggins sgoggins converted this from a draft issue Aug 14, 2024
@sgoggins sgoggins added the bug Documents unexpected/wrong/buggy behavior label Aug 14, 2024
@sgoggins
Copy link
Member Author

@IsaacMilarky : This is in the dev branch.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Documents unexpected/wrong/buggy behavior
Projects
Status: Backlog
Development

No branches or pull requests

2 participants