#229 500 error when adding hook URL that is currently offline
Closed: Fixed None Opened 4 years ago by codeblock.

If I add a POST hook URL that isn't listening yet, I get a 500 error and this trace is logged:

[Thu Jun 11 23:17:46.700066 2015] [:error] [pid 26238] ERROR:pagure:Exception on /pagure-hook-receiver/settings [POST]
[Thu Jun 11 23:17:46.700072 2015] [:error] [pid 26238] Traceback (most recent call last):
[Thu Jun 11 23:17:46.700074 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
[Thu Jun 11 23:17:46.700077 2015] [:error] [pid 26238]     response = self.full_dispatch_request()
[Thu Jun 11 23:17:46.700079 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
[Thu Jun 11 23:17:46.700080 2015] [:error] [pid 26238]     rv = self.handle_user_exception(e)
[Thu Jun 11 23:17:46.700082 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
[Thu Jun 11 23:17:46.700084 2015] [:error] [pid 26238]     reraise(exc_type, exc_value, tb)
[Thu Jun 11 23:17:46.700086 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
[Thu Jun 11 23:17:46.700088 2015] [:error] [pid 26238]     rv = self.dispatch_request()
[Thu Jun 11 23:17:46.700090 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
[Thu Jun 11 23:17:46.700092 2015] [:error] [pid 26238]     return self.view_functions[rule.endpoint](**req.view_args)
[Thu Jun 11 23:17:46.700094 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/pagure/__init__.py", line 231, in decorated_function
[Thu Jun 11 23:17:46.700096 2015] [:error] [pid 26238]     return function(*args, **kwargs)
[Thu Jun 11 23:17:46.700097 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/pagure/ui/repo.py", line 735, in view_settings
[Thu Jun 11 23:17:46.700099 2015] [:error] [pid 26238]     user=flask.g.fas_user.username,
[Thu Jun 11 23:17:46.700101 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/pagure/lib/__init__.py", line 985, in update_project_settings
[Thu Jun 11 23:17:46.700103 2015] [:error] [pid 26238]     agent=user_obj.username,
[Thu Jun 11 23:17:46.700105 2015] [:error] [pid 26238]   File "/usr/lib/python2.7/site-packages/pagure/lib/notify.py", line 93, in log
[Thu Jun 11 23:17:46.700127 2015] [:error] [pid 26238]     url, err))
[Thu Jun 11 23:17:46.700133 2015] [:error] [pid 26238] PagureException: An error occured while querying: http://pagurehook.elrod.me/pagure-hook-receiver - Error: [Errno 111] Connection refused

I don't know why a POST to the new URL is being done when the URL is changed, but regardless, if it fails, it probably shouldn't show the user a 500.


I don't know why a POST to the new URL is being done when the URL is changed

It is announcing the change in the settings

but regardless, if it fails, it probably shouldn't show the user a 500.

Agreed, I've added the catch for this exception

Login to comment on this ticket.

Metadata