Bug 6746 - sa-update exiting with code 4 with pt_BR.UTF-8 locale
Summary: sa-update exiting with code 4 with pt_BR.UTF-8 locale
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: sa-update (show other bugs)
Version: 3.3.1
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-02 20:07 UTC by Nelson A. de Oliveira
Modified: 2012-01-03 14:38 UTC (History)
3 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Full output with "spamassassin --lint -D" with locale as pt_BR.UTF-8 text/plain None Nelson A. de Oliveira [NoCLA]
Add #ifplugins text/plain None John Hardin [HasCLA]
Debug output of sa-update text/plain None Nelson A. de Oliveira [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Nelson A. de Oliveira 2012-01-02 20:07:35 UTC
Created attachment 5030 [details]
Full output with "spamassassin --lint -D" with locale as pt_BR.UTF-8

I don't know if it's related with bug 3062 but trying to run "sa-update" on a machine with locales set to pt_BR.UTF-8 I am seeing this:

=====
config: warning: description exists for non-existent rule AWL
channel: lint check of update failed, channel failed
=====

After exporting LC_ALL=C sa-update runs fine without any message.

It's fully reproducible by setting another updatedir ("sa-update --updatedir /tmp/updates" for example).

After trying to track the origin of this issue it was possible to see that with locale as pt_BR.UTF-8 we can see with "spamassassin --lint":

=====
Jan  2 17:56:52.748 [15061] warn: config: warning: description exists for non-existent rule AWL
Jan  2 17:56:53.507 [15061] warn: lint: 1 issues detected, please rerun with debug enabled for more information
=====

while "LC_ALL=C spamassassin --lint" gives no messages.

Attached is the full output when running "spamassassin --lint -D" with locale as pt_BR.UTF-8

Interesting to note that it gives "warn: lint: 1 issues detected, please rerun with debug enabled for more information" when running with -D, but it doesn't tell us where lint has failed (maybe it's necessary to have a more verbose debug level somewhere?)

spamassasin is Debian's 3.3.1-1

I can provide more info if needed.
Comment 1 Darxus 2012-01-02 20:15:52 UTC
This looks like 3 bugs to me:

1) sa-update with local of pt_BR.UTF-8 fails (while locale of C doesn't).
2) sa-update -D says lint fails, but doesn't tell exactly what the problem is.
3) spamassassin --lint -D also doesn't say what the problem is, and says "please rerun with debug enabled for more information"
Comment 2 John Hardin 2012-01-03 01:58:05 UTC
30_text_pt_br.cf seems to be missing a LOT of #ifplugin statements, and has had many descriptions simply commented out to avoid lint errors of this nature.

Fixing...
Comment 3 John Hardin 2012-01-03 02:18:16 UTC
Created attachment 5031 [details]
Add #ifplugins
Comment 4 John Hardin 2012-01-03 02:19:41 UTC
Nelson, could you test the attached version of 30_text_pt_br.cf to verify it works before I commit? Thanks!
Comment 5 Nelson A. de Oliveira 2012-01-03 02:30:50 UTC
Very good. Working nicely both lint and sa-update.
Comment 6 Darxus 2012-01-03 02:44:20 UTC
This would be a good thing to have automated testing for.  
(I wondered what triggered the "lang pt_BR" type stuff.)
Comment 7 Nelson A. de Oliveira 2012-01-03 03:25:54 UTC
I filled bug 6747 for the more verbose debug output part (to separate the issues).
Comment 8 Nelson A. de Oliveira 2012-01-03 11:46:01 UTC
Created attachment 5032 [details]
Debug output of sa-update

Hi again.
It seems that the problem is half solved.
Yesterday sa-update did run without any errors because there was no update available; now it's failing again with

"config: warning: description exists for non-existent rule AWL
channel: lint check of update failed, channel failed"

"spamassassin --lint" isn't giving any message (is exiting with code 0) however.

Attached is the output of "sa-update -D".
Comment 9 John Hardin 2012-01-03 14:38:33 UTC
Not surprising, as sa-update likely overwrote the changes with the buggy version that's still checked in. Committed fixes:

jhardin@dendarii ~/develop/spamassassin/svn/trunk/rules $ svn commit -m "fix bug#6746" 30_text_pt_br.cf
Sending        30_text_pt_br.cf
Transmitting file data .
Committed revision 1226783.

See if it occurs the next time an update goes out.