Skip to content

TypeError: 'NoneType' object is not subscriptable #322

Closed
@gilberthl-mh

Description

@gilberthl-mh

Describe the bug

We have been running the issue-metrics action for a while now and it has been running without any issues, but just recently we've been receiving the error: TypeError: 'NoneType' object is not subscriptable

The full stack trace can be found below:

MH3-12587 add endpoint to delete single account
Traceback (most recent call last):
  File "/action/workspace/issue_metrics.py", line 433, in <module>
    main()
  File "/action/workspace/issue_metrics.py", line 367, in main
    issues_with_metrics, num_issues_open, num_issues_closed = get_per_issue_metrics(
                                                              ^^^^^^^^^^^^^^^^^^^^^^
  File "/action/workspace/issue_metrics.py", line 219, in get_per_issue_metrics
    ready_for_review_at = get_time_to_ready_for_review(issue, pull_request)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/action/workspace/time_to_ready_for_review.py", line 40, in get_time_to_ready_for_review
    for event in events:
  File "/usr/local/lib/python3.12/site-packages/github3/structs.py", line 131, in __iter__
    yield cls(i)
          ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/github3/models.py", line 52, in __init__
    self._update_attributes(json)
  File "/usr/local/lib/python3.12/site-packages/github3/issues/event.py", line 63, in _update_attributes
    self.actor = users.ShortUser(event["actor"], self)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/github3/models.py", line 52, in __init__
    self._update_attributes(json)
  File "/usr/local/lib/python3.12/site-packages/github3/users.py", line 309, in _update_attributes
    self.avatar_url = user["avatar_url"]
                      ~~~~^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable

To Reproduce

I am unsure how best to reproduce this, I would need to find the PR that is causing this issue but I think the print issues is done fully before it gets to this code in the stack trace.

Expected behavior

Action to run to completion

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions