Can't get some tracebacks in the logs
This is the Heptapod version of hgext-loggingmod#2 and hgext-loggingmod#3:
For example, in case there's a Mercurial error.Abort
, we normally should be able to get a traceback somewhere by adding this to some HGRC file:
[ui]
traceback=on
(just do hg help config.ui
for more details about this setting)
Whether we'd want this setting systematically is another question: sometimes an Abort
is just expected behaviour. For example our permission checks do raise Abort
.
Because traceback output is unaffected by the loggingmod
extension, what happens is that the traceback gets to whatever stderr
means in the calling context:
- within HTTP interactions, it'll end up in the Gunicorn logs
- within SSH interactions, it'll go all the way to the end user
- within a call from the web application, e.g., if someone clicks a "Merge button", it's either discarded or presented in a transient popup to the user
In all cases this is wrong and hinders proper investigation of errors.
Expected solution:
-
fix hgext-loggingmod#2 -
fix hgext-loggingmod#3 -
release hgext-loggingmod -
bump version of hgext-loggingmod used by Heptapod -
maybe change the default configuration -
have write operations from the webapp force traceback production for catched exceptions by passing --config ui.traceback=on
.