ogr icon indicating copy to clipboard operation
ogr copied to clipboard

AttributeError: 'NoneType' object has no attribute 'project'

Open sentry[bot] opened this issue 10 months ago • 5 comments

Sentry Issue: PCKT-002-PACKIT-SERVICE-8VR

GitlabHttpError: 404: 404 Award Emoji Name has already been taken Not Found
  File "gitlab/exceptions.py", line 344, in wrapped_f
    return f(*args, **kwargs)
  File "gitlab/mixins.py", line 301, in create
    server_data = self.gitlab.http_post(path, post_data=data, files=files, **kwargs)
  File "gitlab/client.py", line 1014, in http_post
    result = self.http_request(
  File "gitlab/client.py", line 793, in http_request
    raise gitlab.exceptions.GitlabHttpError(

GitlabCreateError: 404: 404 Award Emoji Name has already been taken Not Found
  File "ogr/services/gitlab/comments.py", line 73, in add_reaction
    reaction_obj = self._raw_comment.awardemojis.create({"name": reaction})
  File "gitlab/exceptions.py", line 346, in wrapped_f
    raise error(e.error_message, e.response_code, e.response_body) from e

AttributeError: 'NoneType' object has no attribute 'project'
(7 additional frame(s) were not displayed)
...
  File "packit_service/worker/jobs.py", line 510, in process_jobs
    handler_classes = self.get_handlers_for_event()
  File "packit_service/worker/jobs.py", line 850, in get_handlers_for_event
    handlers_triggered_by_job = self.get_handlers_for_comment_and_rerun_event()
  File "packit_service/worker/jobs.py", line 824, in get_handlers_for_comment_and_rerun_event
    self.event.comment_object.add_reaction(COMMENT_REACTION)
  File "ogr/abstract.py", line 106, in wrapper
    return function(*args, **kwargs)
  File "ogr/services/gitlab/comments.py", line 80, in add_reaction
    getattr(self._parent, "_target_project", None) or self._parent.project

sentry[bot] avatar Feb 10 '25 07:02 sentry[bot]

Please @lbarcziova can i work on this issue

julietowah avatar Mar 25 '25 11:03 julietowah

hi @julietowah , sure you can try, but I haven't spent too much time digging into this, so it might not be trivial to fix.

lbarcziova avatar Mar 25 '25 13:03 lbarcziova

Ok thank you

julietowah avatar Mar 25 '25 13:03 julietowah

Hello @lbarcziova, I just ran a test on this and it all passed. please is there something am missing ?

julietowah avatar Apr 12 '25 22:04 julietowah

hi @julietowah , I can see the last occurrence 5 days ago in our Sentry tracker, but I guess this will be rather a race condition, so might be hard to reproduce.

lbarcziova avatar Apr 14 '25 13:04 lbarcziova