Uploaded image for project: 'Nuxeo ECM Build/Test Environment'
  1. Nuxeo ECM Build/Test Environment
  2. NXBT-2590

Fix hooks error 500 on some comments

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Captain Hook

      Description

      On the PR https://github.com/nuxeo/nuxeo/pull/2518, the issue comment for code review could not be properly delivered, failing with server error 500.

      hooks@qa-ovh-master:~$ docker-compose -f /opt/hooks/docker-compose.yml logs -f
      node_1   | 2018-11-09 09:53:05,647 INFO [nxtools.hooks.services.config] Loading config file: /opt/conf/nuxeo-tools-hooks.ini
      node_1   | 2018-11-09 09:53:05,649 INFO [nxtools.hooks.services.database] Connecting to database backend: mongodb://mongo:27017/nxtools-hooks
      node_1   | 2018-11-09 09:53:05,680 INFO [nxtools.hooks.endpoints.webhook.github_hook] Got a payload https://github.com/nuxeo/nuxeo - issue_comment
      node_1   | 2018-11-09 09:53:05,681 INFO [nxtools.hooks.endpoints.webhook.github_handlers.pull_request] GithubReviewCommentHandler.handle
      node_1   | 2018-11-09 09:53:07,601 INFO [nxtools.hooks.endpoints.webhook.github_handlers.pull_request] Got review for nuxeo/nuxeo/pull/2518/commits/c4bc5c5c4c06343397d6678eec24e9935701e231
      node_1   | 2018-11-09 09:53:10,330 INFO [nxtools.hooks.services.github_service] Setting status of nuxeo/nuxeo/commits/c4bc5c5c4c06343397d6678eec24e9935701e231 to: 2 (of 2) reviews
      node_1   | 2018-11-09 09:53:10,878 INFO [nxtools.hooks.services.github_service] Sending slack notification for nuxeo/nuxeo/pull/2518 in C0YR9E4JC
      proxy_1  | 172.28.0.1 - - [09/Nov/2018:09:53:11 +0000] "POST /hook/ HTTP/1.1" 200 2 "-" "GitHub-Hookshot/c43e4aa" "192.30.252.36"
      
      hooks_node_1:/opt/logs/captain-hooks.log
      2018-11-09 08:59:07,806 INFO [nxtools.hooks.endpoints.webhook.github_hook] Got a payload https://github.com/nuxeo/nuxeo - issue_comment
      2018-11-09 08:59:07,806 INFO [nxtools.hooks.endpoints.webhook.github_handlers.pull_request] GithubReviewCommentHandler.handle
      2018-11-09 08:59:09,750 INFO [nxtools.hooks.endpoints.webhook.github_handlers.pull_request] Got review for nuxeo/nuxeo/pull/2518/commits/c7040cba8b405fc8fc06584ffc97c556abc54c51
      2018-11-09 08:59:12,546 WARNING [nxtools.hooks.endpoints.webhook.github_handlers] Unhandled exception: 'NoneType' object has no attribute 'update'
      Traceback (most recent call last):
        File "/usr/local/lib/python2.7/site-packages/nxtools/hooks/endpoints/webhook/github_handlers/__init__.py", line 38, in handle
          return self._do_handle(payload_body)
        File "/usr/local/lib/python2.7/site-packages/nxtools/hooks/endpoints/webhook/github_handlers/pull_request.py", line 133, in _do_handle
          pr.review.update(add_to_set__owners=reviewers)
      AttributeError: 'NoneType' object has no attribute 'update'
      2018-11-09 08:59:12,547 ERROR [__main__] Exception on /hook/ [POST]
      Traceback (most recent call last):
        File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1988, in wsgi_app
          response = self.full_dispatch_request()
        File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1641, in full_dispatch_request
          rv = self.handle_user_exception(e)
        File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1544, in handle_user_exception
          reraise(exc_type, exc_value, tb)
        File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1639, in full_dispatch_request
          rv = self.dispatch_request()
        File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1625, in dispatch_request
          return self.view_functions[rule.endpoint](**req.view_args)
        File "/usr/local/lib/python2.7/site-packages/nxtools/hooks/endpoints/webhook/__init__.py", line 66, in route
          return services.get(WebHookEndpoint).do_route()
        File "/usr/local/lib/python2.7/site-packages/nxtools/hooks/endpoints/webhook/__init__.py", line 84, in do_route
          return handler.handle(request.headers, request.data)
        File "/usr/local/lib/python2.7/site-packages/nxtools/hooks/endpoints/webhook/github_hook.py", line 121, in handle
          s, r = handler.handle(body)
      TypeError: 'NoneType' object is not iterable
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jcarsique Julien Carsique
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: