You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2011/06/15 17:57:21 UTC

[Bug 6618] New: spamd gives no error when rules directories are missing, poor error on empty rules dir

https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

             Bug #: 6618
           Summary: spamd gives no error when rules directories are
                    missing, poor error on empty rules dir
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: spamc/spamd
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: Darxus@ChaosReigns.com
    Classification: Unclassified


This problem was just reported on IRC by jocom, and google searching indicates
others have hit it.  jocom's running archlinux, others on freebsd.

On my (Ubuntu) system, running trunk, removed /usr/share/spamassassin/ and
/var/lib/spamassassin/, then created /var/lib/spamassassin/3.004000 (empty),
then:

# /etc/init.d/spamassassin start
Starting SpamAssassin Mail Filter Daemon: child process [10691] exited or timed
out without signaling production of a PID file: exit 255 at /usr/sbin/spamd
line 2643.

This error should instead state that the rules are missing and you need to run
sa-update, much like these do:

# spamassassin -t < /dev/null
config: no rules were found!  Do you need to run 'sa-update'? at
/usr/bin/spamassassin line 403.

# spamassassin --lint
config: no rules were found!  Do you need to run 'sa-update'?


If all rules directories are completely missing, the behavior is even worse, no
error at all.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kmcgrail@pccc.com

--- Comment #3 from Kevin A. McGrail <km...@pccc.com> 2011-06-15 21:05:46 UTC ---
(In reply to comment #2)
> "I finally got it working. The actual error was that I had not installed
> gnupg2" - jocom
> 
> So it sounds like sa-update depends on gpg and also doesn't give a useful error
> without it.
> 
> He previously mentioned he was following this tutorial: 
> https://wiki.archlinux.org/index.php/Postfix_Tutorial

OK, I've got a test system with spamd showing that it has the same error as
spamassassin:

 spamd 
Jun 15 16:51:09.003 [7354] error: config: no rules were found! Do you need to
run 'sa-update'?
config: no rules were found!  Do you need to run 'sa-update'?

Now trying to recreate the gpg scenario...

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

--- Comment #6 from Kevin A. McGrail <km...@pccc.com> 2011-06-15 23:31:09 UTC ---
> > Figured out the difference, try it with -d and you'll get the same lack of
> > useful error.

I'm 99.9% sure this is an Invalid bug report.  With -d, the information is
logged to syslog which would be appropriate for a daemon.  Without -d, is there
a specific case that you can point out that should be resolved?

However, it seems we could use some additions to Dependency.pm to test for
required/optional binaries such as gpg.

I'll attach a patch with my first pass at doing so.

The test_version subroutine might be reinventing the wheel or doing things very
much the hard way so if anyone has any input, I'm all ears. 

Darxus and others, can you remove gpg from your path (or change your path) and
test this patch? Would be good if you can play with the required/recommended
versions and test as well with gpg in the path.

All you have to do for a test is 
perl Makefile.PL CONTACT_ADDRESS=Darxus@ChaosReigns.com

The goal of this patch is to prompt that the optional gpg is not installed and
this is required for sa-update to function.  It also gives a framework built
off the existing MODULES and OPTIONAL_MODULES functionality for binaries.

Regards,
KAM

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

--- Comment #7 from Kevin A. McGrail <km...@pccc.com> 2011-06-15 23:32:04 UTC ---
Created attachment 4918
  --> https://issues.apache.org/SpamAssassin/attachment.cgi?id=4918
Patch to allow DependencyInfo.pm to test for required and optional binaries
with a check for gpg

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

--- Comment #2 from Darxus <Da...@ChaosReigns.com> 2011-06-15 16:25:51 UTC ---
"I finally got it working. The actual error was that I had not installed
gnupg2" - jocom

So it sounds like sa-update depends on gpg and also doesn't give a useful error
without it.

He previously mentioned he was following this tutorial: 
https://wiki.archlinux.org/index.php/Postfix_Tutorial

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

--- Comment #9 from Kevin A. McGrail <km...@pccc.com> 2011-06-16 14:32:39 UTC ---
(In reply to comment #8)
> (In reply to comment #6)
> > The goal of this patch is to prompt that the optional gpg is not installed and
> > this is required for sa-update to function.
> 
> Since when is it required?  sa-update should be usable with the --nogpg option,
> even if it is not recommended.

The code in the patch for checking the gpg binary is clear that it's an
optional binary but the verbiage of sa-update says:

error: gpg required but not found!

But I agree it's technically not required and this is all just communication
problems with the end-user.

I'll update the error message as well to be a bit more clear and use the same
verbiage in the optional check.

Attaching a new version of my patch in a second.

Regards,
KAM

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4918|0                           |1
        is obsolete|                            |

--- Comment #10 from Kevin A. McGrail <km...@pccc.com> 2011-06-16 14:33:42 UTC ---
Created attachment 4919
  --> https://issues.apache.org/SpamAssassin/attachment.cgi?id=4919
Improved Patch to allow DependencyInfo.pm to test for required and optional
binaries with a check for gpg & clean up gpg error message in sa-update

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #12 from Kevin A. McGrail <km...@pccc.com> 2011-06-16 14:49:57 UTC ---
Closing as resolved -> Invalid.  Error messages with -d are sent to syslog.

Will create a new bug for the DependencyInfo.pm/sa-update error messages rather
than continue with a hijacked bug.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

Kevin A. McGrail <km...@pccc.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #4919|0                           |1
        is obsolete|                            |

--- Comment #11 from Kevin A. McGrail <km...@pccc.com> 2011-06-16 14:43:28 UTC ---
Created attachment 4920
  --> https://issues.apache.org/SpamAssassin/attachment.cgi?id=4920
Same as v2 with disabled module tests re-enabled.  I had disabled them to speed
up debugging.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

--- Comment #8 from Daryl C. W. O'Shea <sp...@dostech.ca> 2011-06-16 03:09:22 UTC ---
(In reply to comment #6)
> The goal of this patch is to prompt that the optional gpg is not installed and
> this is required for sa-update to function.

Since when is it required?  sa-update should be usable with the --nogpg option,
even if it is not recommended.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

--- Comment #5 from Kevin A. McGrail <km...@pccc.com> 2011-06-15 21:19:51 UTC ---
(In reply to comment #4)
> (In reply to comment #3)
> > OK, I've got a test system with spamd showing that it has the same error as
> > spamassassin:
> 
> Figured out the difference, try it with -d and you'll get the same lack of
> useful error.
> 
> # spamd -d # As used by /etc/init.d scripts
> child process [8930] exited or timed out without signaling production of a PID
> file: exit 255 at /usr/sbin/spamd line 2588.
> 
> # spamd
> Jun 15 17:15:48.485 [8932] error: config: no rules were found! Do you need to
> run 'sa-update'?

I concur.  Found that but also researching the GPG issue.

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

--- Comment #4 from Darxus <Da...@ChaosReigns.com> 2011-06-15 21:17:38 UTC ---
(In reply to comment #3)
> OK, I've got a test system with spamd showing that it has the same error as
> spamassassin:

Figured out the difference, try it with -d and you'll get the same lack of
useful error.

# spamd -d # As used by /etc/init.d scripts
child process [8930] exited or timed out without signaling production of a PID
file: exit 255 at /usr/sbin/spamd line 2588.

# spamd
Jun 15 17:15:48.485 [8932] error: config: no rules were found! Do you need to
run 'sa-update'?

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

[Bug 6618] spamd gives no error when rules directories are missing, poor error on empty rules dir

Posted by bu...@bugzilla.spamassassin.org.
https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6618

Darxus <Da...@ChaosReigns.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Darxus@ChaosReigns.com

--- Comment #1 from Darxus <Da...@ChaosReigns.com> 2011-06-15 15:59:23 UTC ---
With no rules directories at all, starts up with no complaints and keeps
running.  Should probably die with an error.

# spamassassin --lint
Jun 15 11:57:58.453 [10715] warn: config: could not find sys rules directory
# /etc/init.d/spamassassin start
Starting SpamAssassin Mail Filter Daemon: spamd.
# ps auxww | grep -i spamd
root     10719  5.6  2.8  26124 21428 ?        Ss   11:58   0:00
/usr/sbin/spamd --create-prefs --max-children 5 --helper-home-dir -d
--pidfile=/var/run/spamd.pid

-- 
Configure bugmail: https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.