#11776 github2fedmsg 500 error
Closed: Fixed 2 months ago by kevin. Opened 2 months ago by ralph.

I tried to enable a repo in github2fedmsg, but I was met with a 500 error.

The repo is https://github.com/konflux-ci/project-controller

I found that I can toggle other repos under my personal namespace, but not this one.

Describe what you would like us to do:

Can you find the traceback in the logs and share it here?

When do you need this to be done by? (YYYY/MM/DD)

No rush. :)


Metadata Update from @zlopez:
- Issue priority set to: Waiting on Assignee (was: Needs Review)
- Issue tagged with: Needs investigation

2 months ago

I found this in the logs:

[Wed Feb 14 06:19:22.038476 2024] [:error] [pid 9210] [remote 10.3.163.74:100] mod_wsgi (pid=9210): Exception occurred processing WSGI script '/usr/share/github2fedmsg/github2fedmsg.wsgi'.
[Wed Feb 14 06:19:22.038574 2024] [:error] [pid 9210] [remote 10.3.163.74:100] Traceback (most recent call last):
[Wed Feb 14 06:19:22.038614 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/tw2/core/middleware.py", line 204, in __call__
[Wed Feb 14 06:19:22.038832 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     resp = req.get_response(self.app, catch_exc_info=True)
[Wed Feb 14 06:19:22.038851 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/WebOb-1.4.1-py2.7.egg/webob/request.py", line 1313, in send
[Wed Feb 14 06:19:22.038872 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     application, catch_exc_info=True)
[Wed Feb 14 06:19:22.038879 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/WebOb-1.4.1-py2.7.egg/webob/request.py", line 1281, in call_application
[Wed Feb 14 06:19:22.038892 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     app_iter = application(self.environ, start_response)
[Wed Feb 14 06:19:22.038900 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/paste/deploy/config.py", line 291, in __call__
[Wed Feb 14 06:19:22.038914 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     return self.app(environ, start_response)
[Wed Feb 14 06:19:22.038923 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/router.py", line 242, in __call__
[Wed Feb 14 06:19:22.038937 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     response = self.invoke_subrequest(request, use_tweens=True)
[Wed Feb 14 06:19:22.038944 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/router.py", line 217, in invoke_subrequest
[Wed Feb 14 06:19:22.038967 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     response = handle_request(request)
[Wed Feb 14 06:19:22.038976 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/tweens.py", line 21, in excview_tween
[Wed Feb 14 06:19:22.038989 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     response = handler(request)
[Wed Feb 14 06:19:22.038996 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 99, in tm_tween
[Wed Feb 14 06:19:22.039010 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     reraise(*exc_info)
[Wed Feb 14 06:19:22.039016 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid_tm/__init__.py", line 80, in tm_tween
[Wed Feb 14 06:19:22.039028 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     response = handler(request)
[Wed Feb 14 06:19:22.039038 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/router.py", line 163, in handle_request
[Wed Feb 14 06:19:22.039050 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     response = view_callable(context, request)
[Wed Feb 14 06:19:22.039058 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/config/views.py", line 329, in attr_view
[Wed Feb 14 06:19:22.039087 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     return view(context, request)
[Wed Feb 14 06:19:22.039101 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/config/views.py", line 305, in predicate_wrapper
[Wed Feb 14 06:19:22.039115 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     return view(context, request)
[Wed Feb 14 06:19:22.039121 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/config/views.py", line 355, in rendered_view
[Wed Feb 14 06:19:22.039132 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     result = view(context, request)
[Wed Feb 14 06:19:22.039139 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/pyramid/config/views.py", line 501, in _requestonly_view
[Wed Feb 14 06:19:22.039150 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     response = view(request)
[Wed Feb 14 06:19:22.039157 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/github2fedmsg/views/webhooks.py", line 132, in webhook
[Wed Feb 14 06:19:22.039172 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     fas_usernames = build_fas_lookup(payload)
[Wed Feb 14 06:19:22.039179 2024] [:error] [pid 9210] [remote 10.3.163.74:100]   File "/usr/lib/python2.7/site-packages/github2fedmsg/views/webhooks.py", line 172, in build_fas_lookup
[Wed Feb 14 06:19:22.039191 2024] [:error] [pid 9210] [remote 10.3.163.74:100]     usernames.add(commit['committer']['username'])
[Wed Feb 14 06:19:22.039219 2024] [:error] [pid 9210] [remote 10.3.163.74:100] KeyError: 'username'

Looking at the corresponding code, it's really strange because it's checking if the code is actually there before accessing it.
Hm, it seems that the version is actually different in github from the one that is deployed on production.

Metadata Update from @zlopez:
- Issue untagged with: Needs investigation
- Issue assigned to zlopez
- Issue tagged with: low-gain, medium-trouble, ops

2 months ago

I patched the error I found in this PR. @ralph Did it solved the error for you?

Metadata Update from @zlopez:
- Issue priority set to: Waiting on Reporter (was: Waiting on Assignee)

2 months ago

I just tried adding the repo again - still seen an error

@bkorren Looking at the logs and I can see multiple IOError: {u'documentation_url': u'https://docs.github.com/rest', u'message': u'Bad credentials', 'status_code': 401}.
I tried it myself and it seems that our github token probably expired. I will look into that.

If the token is expired, does this mean the issue is no longer low-gain because it affects everybody using the service?

@bkorren You are right, but I'm trying to confirm that this is really the case as I don't have access to github token itself and I don't want to generate new one if it's not needed.

No, it seems like I can still enable/disable other repos in my personal namespace.

Metadata Update from @zlopez:
- Issue priority set to: Waiting on Assignee (was: Waiting on Reporter)

2 months ago

I will look into this deeper tomorrow as I can now reproduce the issue.

I was able to solve this on my own account by reauthorizing GitHub. Just click on Forget GitHub Authz on https://apps.fedoraproject.org/github2fedmsg after you log in and authorize it again.

@ralph Let me know if this works for you as well.

Metadata Update from @zlopez:
- Issue priority set to: Waiting on Reporter (was: Waiting on Assignee)

2 months ago

Yeah, this seems to have finally worked for me now.

Great - I think this can be closed. Thanks for the help @zlopez!

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

2 months ago

Login to comment on this ticket.

Metadata
Boards 1
ops Status: Backlog