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

Release Task Periodic Error : branch: main #2038

Closed
sgoggins opened this issue Nov 24, 2022 · 3 comments
Closed

Release Task Periodic Error : branch: main #2038

sgoggins opened this issue Nov 24, 2022 · 3 comments
Assignees
Labels
bug Documents unexpected/wrong/buggy behavior workers Related to data workers

Comments

@sgoggins
Copy link
Member

Description:
When release metadata is not fully populated on a repo (a rare occurrence), the following error is generated:

Traceback (most recent call last):
  File "/home/sean/github/virtualenv/ag3/lib/python3.8/site-packages/celery/app/trace.py", line 451, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/home/sean/github/virtualenv/ag3/lib/python3.8/site-packages/celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "/home/sean/github/ag3/augur/tasks/github/releases/tasks.py", line 15, in collect_releases
    releases_model(session, repo.repo_git, repo.repo_id)
  File "/home/sean/github/ag3/augur/tasks/github/releases/core.py", line 186, in releases_model
    insert_release(session, repo_id, data['owner'], release)
  File "/home/sean/github/ag3/augur/tasks/github/releases/core.py", line 79, in insert_release
    release_inf = get_release_inf(session, repo_id, release, tag_only)
  File "/home/sean/github/ag3/augur/tasks/github/releases/core.py", line 19, in get_release_inf
    name = "" if release['author']['name'] is None else release['author']['name']
TypeError: 'NoneType' object is not subscriptable

How to reproduce:
The ag3 instance on our test server has this error right now.

Expected behavior:
No error

Software versions:

  • augur-new-dev
  • OS: Ubuntu 20.5
@sgoggins sgoggins added bug Documents unexpected/wrong/buggy behavior workers Related to data workers labels Nov 24, 2022
@sgoggins sgoggins changed the title Release Task Periodic Error : branch: augur-new-dev Release Task Periodic Error : branch: main Nov 30, 2022
@sgoggins
Copy link
Member Author

@sgoggins
Copy link
Member Author

The error appears to occur when there is no author defined for a release. Example: https://github.com/ContainerSSH/dockerrun/releases .. None of the releases here have an author.

When we hit this code:

def get_release_inf(session, repo_id, release, tag_only):
    if not tag_only:
        name = "" if release['author']['name'] is None else release['author']['name']

We literally are trying to subscript a NoneType, which is not allowed. The issue is there is no author object at all. So, I think we need to test for that first. @ABrain7710 / @IsaacMilarky

@sgoggins
Copy link
Member Author

sgoggins commented Jan 1, 2023

This issue closed by PR #2099

@sgoggins sgoggins closed this as completed Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Documents unexpected/wrong/buggy behavior workers Related to data workers
Projects
None yet
Development

No branches or pull requests

2 participants