danigm / gitlab-telegram-bot

Simple gitlab telegram bot that listen webhooks
82 stars 59 forks source link

Error 500 when sending event to the server #8

Closed osca closed 7 years ago

osca commented 7 years ago

I tried out your telegram bot with the latest gitlab version (10.1.0-ce.0) and it does not work. I get a Http 500 error in the logs:

23/10/2017 16:33:43 * Running on http://0.0.0.0:10111/ (Press CTRL+C to quit) 23/10/2017 16:56:44[2017-10-23 14:56:44,937] ERROR in app: Exception on / [POST] 23/10/2017 16:56:44Traceback (most recent call last): 23/10/2017 16:56:44 File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app 23/10/2017 16:56:44 response = self.full_dispatch_request() 23/10/2017 16:56:44 File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request 23/10/2017 16:56:44 rv = self.handle_user_exception(e) 23/10/2017 16:56:44 File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception 23/10/2017 16:56:44 reraise(exc_type, exc_value, tb) 23/10/2017 16:56:44 File "/usr/local/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise 23/10/2017 16:56:44 raise value 23/10/2017 16:56:44 File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request 23/10/2017 16:56:44 rv = self.dispatch_request() 23/10/2017 16:56:44 File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request 23/10/2017 16:56:44 return self.view_functionsrule.endpoint 23/10/2017 16:56:44 File "./app.py", line 60, in webhook 23/10/2017 16:56:44 kind = data['obj_kind'] 23/10/2017 16:56:44KeyError: 'obj_kind' 23/10/2017 16:56:44172.20.2.4 - - [23/Oct/2017 14:56:44] "POST / HTTP/1.1" 500 -

danigm commented 7 years ago

I've fixed this problem in the last commit: https://github.com/danigm/gitlab-telegram-bot/commit/2f2d51e92223f4c3e38ab52eab599db18608ce75