Bug 7817 - Pyzor.pm - Show traceback in log?
Summary: Pyzor.pm - Show traceback in log?
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC Linux
: P2 minor
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-18 08:39 UTC by Matthijs Kooijman
Modified: 2020-07-13 07:25 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Matthijs Kooijman 2020-05-18 08:39:18 UTC
Currently, when pyzor produces a python exception, this is detected by Pyzor.pm and the log shows "pyzor: internal error, python traceback seen in response", but without logging the actual traceback or response. This makes it hard to debug such a backtrace. It seems you can enable debug output to get the full response, but that would (I think) log *all* pyzor responses and a lot of other SA debug output too (unless it is possible to enable debug only for Pyzor, have not checked).

Please consider improving this. Possible solutions I can imagine, in decreasing order of (my) preference:
 1. When a stacktrace is detected, print the entire response, including the stacktrace.
 2. If 1. is considered too verbose, maybe add a specif option to enable printing full responses on backtraces, and refer to that option in the default concise error message.
 3. As a better-than-nothing option, point out that enabling debug output will print the stacktrace itself, ideally referring to some documentation about this.

I've observed this behavior with 3.4.2 from Debian stable, but it looks like it is unchanged in SVN trunk: https://github.com/apache/spamassassin/blob/bd603c8dcf9dc3b9f945ea2aef2d894401aff864/lib/Mail/SpamAssassin/Plugin/Pyzor.pm#L535-L539
Comment 1 Henrik Krohns 2020-07-12 10:19:00 UTC
I think it's fine to print traceback in log message, added.

Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/Pyzor.pm
Sending        trunk/lib/Mail/SpamAssassin/Plugin/Pyzor.pm
Transmitting file data ..done
Committing transaction...
Committed revision 1879806.
Comment 2 Matthijs Kooijman 2020-07-13 07:25:37 UTC
Commit looks good, thanks!