# HG changeset patch # User Marcin Kuzminski # Date 2018-09-26 10:11:09 # Node ID e2f600bd0aced4d707fd9b2c874d4f43117b22e7 # Parent dae26a6bcc1bc7f20204a1aa4462d5ffc0663150 scm_app: add more debug info when unhandled errors happen on vcsserver. diff --git a/rhodecode/lib/hooks_daemon.py b/rhodecode/lib/hooks_daemon.py --- a/rhodecode/lib/hooks_daemon.py +++ b/rhodecode/lib/hooks_daemon.py @@ -245,7 +245,6 @@ def prepare_callback_daemon(extras, prot # register txn_id extras['txn_id'] = txn_id - log.debug('Prepared a callback daemon: %s at url `%s`', callback_daemon.__class__.__name__, callback_daemon.hooks_uri) return callback_daemon, extras @@ -292,6 +291,9 @@ class Hooks(object): try: result = hook(extras) + if result is None: + raise Exception( + 'Failed to obtain hook result from func: {}'.format(hook)) except HTTPBranchProtected as handled_error: # Those special cases doesn't need error reporting. It's a case of # locked repo or protected branch diff --git a/rhodecode/lib/middleware/utils/scm_app_http.py b/rhodecode/lib/middleware/utils/scm_app_http.py --- a/rhodecode/lib/middleware/utils/scm_app_http.py +++ b/rhodecode/lib/middleware/utils/scm_app_http.py @@ -114,13 +114,17 @@ class VcsHttpProxy(object): stream=True) log.debug('http-app: got vcsserver response: %s', response) + if response.status_code >= 500: + log.error('Exception returned by vcsserver at: %s %s, %s', + url, response.status_code, response.content) + # Preserve the headers of the response, except hop_by_hop ones response_headers = [ (h, v) for h, v in response.headers.items() if not wsgiref.util.is_hop_by_hop(h) ] - # Build status argument for start_reponse callable. + # Build status argument for start_response callable. status = '{status_code} {reason_phrase}'.format( status_code=response.status_code, reason_phrase=response.reason)