This is a somewhat unclassified issue at the moment.
The commandline to find these logs is:
COMMAND='grep -E "(pre|post)-(installation|removal) script( subprocess)? returned error"'
Affected packages in jessie2Xstretch: 4