Invalid argumenty warning when trying to use Bayes with Redis

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Invalid argumenty warning when trying to use Bayes with Redis

Palvelin Postmaster
Can anyone offer suggestions as to why I get these invalid argument warnings when I run spamassassin —lint —debug:

warn: plugin: eval failed: bayes: Redis failed: Error: Invalid argument at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 264. at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 271.

$ spamassassin --version
SpamAssassin version 3.4.1
  running on Perl version 5.26.2

Lines 264-271 in Redis.pm indicate that the warning might be related to a connectivity problem with Redis. I have Redis 4.0.9 installed via Macports on macOS High Sierra. Redis is configured according to these instructions: https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/. A simple test suggests a connection to Redis can be established and database 0 exists.

$ redis-cli -h 127.0.0.1
127.0.0.1:6379> SELECT 0
OK

My bayes config is:

# Enable the Bayes system
use_bayes               1
use_bayes_rules 1
use_learner 1
bayes_use_hapaxes       1
bayes_learn_to_journal 0
bayes_token_ttl 30d
bayes_seen_ttl 14d

# Use Redis for Bayes backend
bayes_store_module Mail::SpamAssassin::BayesStore::Redis
bayes_sql_dsn server=127.0.0.1:6379,database=0




Axb
Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

Axb
On 05/27/2018 09:50 AM, Palvelin Postmaster wrote:

> Can anyone offer suggestions as to why I get these invalid argument warnings when I run spamassassin —lint —debug:
>
> warn: plugin: eval failed: bayes: Redis failed: Error: Invalid argument at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 264. at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 271.
>
> $ spamassassin --version
> SpamAssassin version 3.4.1
>    running on Perl version 5.26.2
>
> Lines 264-271 in Redis.pm indicate that the warning might be related to a connectivity problem with Redis. I have Redis 4.0.9 installed via Macports on macOS High Sierra. Redis is configured according to these instructions: https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/. A simple test suggests a connection to Redis can be established and database 0 exists.
>
> $ redis-cli -h 127.0.0.1
> 127.0.0.1:6379> SELECT 0
> OK
>
> My bayes config is:
>
> # Enable the Bayes system
> use_bayes               1
> use_bayes_rules 1
> use_learner 1
> bayes_use_hapaxes       1
> bayes_learn_to_journal 0
> bayes_token_ttl 30d
> bayes_seen_ttl 14d
>
> # Use Redis for Bayes backend
> bayes_store_module Mail::SpamAssassin::BayesStore::Redis
> bayes_sql_dsn server=127.0.0.1:6379,database=0
>
what happens if you comment out

#bayes_use_hapaxes       1

Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

Palvelin Postmaster


> On 27 May 2018, at 11:01, Axb <[hidden email]> wrote:
>
> On 05/27/2018 09:50 AM, Palvelin Postmaster wrote:
>> Can anyone offer suggestions as to why I get these invalid argument warnings when I run spamassassin —lint —debug:
>> warn: plugin: eval failed: bayes: Redis failed: Error: Invalid argument at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 264. at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 271.
>> $ spamassassin --version
>> SpamAssassin version 3.4.1
>>   running on Perl version 5.26.2
>> Lines 264-271 in Redis.pm indicate that the warning might be related to a connectivity problem with Redis. I have Redis 4.0.9 installed via Macports on macOS High Sierra. Redis is configured according to these instructions: https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/. A simple test suggests a connection to Redis can be established and database 0 exists.
>> $ redis-cli -h 127.0.0.1
>> 127.0.0.1:6379> SELECT 0
>> OK
>> My bayes config is:
>> # Enable the Bayes system
>> use_bayes               1
>> use_bayes_rules 1
>> use_learner 1
>> bayes_use_hapaxes       1
>> bayes_learn_to_journal 0
>> bayes_token_ttl 30d
>> bayes_seen_ttl 14d
>> # Use Redis for Bayes backend
>> bayes_store_module Mail::SpamAssassin::BayesStore::Redis
>> bayes_sql_dsn server=127.0.0.1:6379,database=0
> what happens if you comment out
>
> #bayes_use_hapaxes       1

Doesn’t appear to have any effect.
Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

John Hardin
In reply to this post by Palvelin Postmaster
On Sun, 27 May 2018, Palvelin Postmaster wrote:

> Can anyone offer suggestions as to why I get these invalid argument warnings when I run spamassassin —lint —debug:
>
> warn: plugin: eval failed: bayes: Redis failed: Error: Invalid argument at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 264. at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 271.
>
> $ spamassassin --version
> SpamAssassin version 3.4.1
>  running on Perl version 5.26.2
>
> Lines 264-271 in Redis.pm indicate that the warning might be related to a connectivity problem with Redis. I have Redis 4.0.9 installed via Macports on macOS High Sierra. Redis is configured according to these instructions: https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/. A simple test suggests a connection to Redis can be established and database 0 exists.
>
> $ redis-cli -h 127.0.0.1
> 127.0.0.1:6379> SELECT 0
> OK
>
> My bayes config is:
>
> # Enable the Bayes system
> use_bayes               1
> use_bayes_rules 1
> use_learner 1
> bayes_use_hapaxes       1
> bayes_learn_to_journal 0
> bayes_token_ttl 30d
> bayes_seen_ttl 14d
>
> # Use Redis for Bayes backend
> bayes_store_module Mail::SpamAssassin::BayesStore::Redis
> bayes_sql_dsn server=127.0.0.1:6379,database=0
    foreach (split(';', $bconf->{bayes_sql_dsn})) {

It appears the DSN syntax for SA follows the common format and uses
semicolon as a delimiter. Try:

   server=127.0.0.1:6379;database=0



--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Maxim XXXVII: There is no 'overkill.' There is only 'open fire' and
                 'time to reload.'
-----------------------------------------------------------------------
  Tomorrow: Memorial Day - honor those who sacrificed for our liberty
Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

Reio Remma
On 27.05.2018 21:43, John Hardin wrote:

> On Sun, 27 May 2018, Palvelin Postmaster wrote:
>
>> Can anyone offer suggestions as to why I get these invalid argument
>> warnings when I run spamassassin —lint —debug:
>>
>> warn: plugin: eval failed: bayes: Redis failed: Error: Invalid
>> argument at
>> /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm
>> line 264. at
>> /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm
>> line 271.
>>
>> $ spamassassin --version
>> SpamAssassin version 3.4.1
>>  running on Perl version 5.26.2
>>
>> Lines 264-271 in Redis.pm indicate that the warning might be related
>> to a connectivity problem with Redis. I have Redis 4.0.9 installed
>> via Macports on macOS High Sierra. Redis is configured according to
>> these instructions:
>> https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/.
>> A simple test suggests a connection to Redis can be established and
>> database 0 exists.
>>
>> $ redis-cli -h 127.0.0.1
>> 127.0.0.1:6379> SELECT 0
>> OK
>>
>> My bayes config is:
>>
>> # Enable the Bayes system
>> use_bayes               1
>> use_bayes_rules            1
>> use_learner                1
>> bayes_use_hapaxes       1
>> bayes_learn_to_journal    0
>> bayes_token_ttl            30d
>> bayes_seen_ttl            14d
>>
>> # Use Redis for Bayes backend
>> bayes_store_module        Mail::SpamAssassin::BayesStore::Redis
>> bayes_sql_dsn            server=127.0.0.1:6379,database=0
>
>    foreach (split(';', $bconf->{bayes_sql_dsn})) {
>
> It appears the DSN syntax for SA follows the common format and uses
> semicolon as a delimiter. Try:
>
>   server=127.0.0.1:6379;database=0

And if someone could then fix up:

https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/SA-rule/bayes_redis.cf

:)

Reio
Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

John Hardin
On Sun, 27 May 2018, Reio Remma wrote:

> On 27.05.2018 21:43, John Hardin wrote:
>> On Sun, 27 May 2018, Palvelin Postmaster wrote:
>>
>>> Can anyone offer suggestions as to why I get these invalid argument
>>> warnings when I run spamassassin —lint —debug:
>>>
>>> warn: plugin: eval failed: bayes: Redis failed: Error: Invalid argument at
>>> /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm
>>> line 264. at
>>> /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm
>>> line 271.
>>>
>>> # Use Redis for Bayes backend
>>> bayes_store_module        Mail::SpamAssassin::BayesStore::Redis
>>> bayes_sql_dsn            server=127.0.0.1:6379,database=0
>>
>>    foreach (split(';', $bconf->{bayes_sql_dsn})) {
>>
>> It appears the DSN syntax for SA follows the common format and uses
>> semicolon as a delimiter. Try:
>>
>>   server=127.0.0.1:6379;database=0
>
> And if someone could then fix up:
>
> https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/SA-rule/bayes_redis.cf
Yeah, I intend to if the change is confirmed to work. I don't have an
environment to quickly test it.


--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Vista "security improvements" consist of attempting to shift blame
   onto the user when things go wrong.
-----------------------------------------------------------------------
  Tomorrow: Memorial Day - honor those who sacrificed for our liberty
Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

Palvelin Postmaster
In reply to this post by John Hardin


> On 27 May 2018, at 21:43, John Hardin <[hidden email]> wrote:
>
> On Sun, 27 May 2018, Palvelin Postmaster wrote:
>
>> Can anyone offer suggestions as to why I get these invalid argument warnings when I run spamassassin —lint —debug:
>>
>> warn: plugin: eval failed: bayes: Redis failed: Error: Invalid argument at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 264. at /opt/local/lib/perl5/vendor_perl/5.26/Mail/SpamAssassin/BayesStore/Redis.pm line 271.
>>
>> $ spamassassin --version
>> SpamAssassin version 3.4.1
>> running on Perl version 5.26.2
>>
>> Lines 264-271 in Redis.pm indicate that the warning might be related to a connectivity problem with Redis. I have Redis 4.0.9 installed via Macports on macOS High Sierra. Redis is configured according to these instructions: https://svn.apache.org/repos/asf/spamassassin/trunk/contrib/HOWTO.Bayes-Redis/. A simple test suggests a connection to Redis can be established and database 0 exists.
>>
>> $ redis-cli -h 127.0.0.1
>> 127.0.0.1:6379> SELECT 0
>> OK
>>
>> My bayes config is:
>>
>> # Enable the Bayes system
>> use_bayes               1
>> use_bayes_rules 1
>> use_learner 1
>> bayes_use_hapaxes       1
>> bayes_learn_to_journal 0
>> bayes_token_ttl 30d
>> bayes_seen_ttl 14d
>>
>> # Use Redis for Bayes backend
>> bayes_store_module Mail::SpamAssassin::BayesStore::Redis
>> bayes_sql_dsn server=127.0.0.1:6379,database=0
>
>   foreach (split(';', $bconf->{bayes_sql_dsn})) {
>
> It appears the DSN syntax for SA follows the common format and uses semicolon as a delimiter. Try:
>
>  server=127.0.0.1:6379;database=0

Works! Thanks a lot! :)




Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

John Hardin
On Sun, 27 May 2018, Palvelin Postmaster wrote:

>> On 27 May 2018, at 21:43, John Hardin <[hidden email]> wrote:
>>>
>>> # Use Redis for Bayes backend
>>> bayes_store_module Mail::SpamAssassin::BayesStore::Redis
>>> bayes_sql_dsn server=127.0.0.1:6379,database=0
>>
>>   foreach (split(';', $bconf->{bayes_sql_dsn})) {
>>
>> It appears the DSN syntax for SA follows the common format and uses semicolon as a delimiter. Try:
>>
>>  server=127.0.0.1:6379;database=0
>
> Works! Thanks a lot! :)

Yay! Thanks for confirming. Example .cf file fixed.

...just for completeness, would you try "localhost" in the DSN to see
whether name resolution does work there? I just assumed it does...

--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   Where We Want You To Go Today 09/13/07: Microsoft patents in-OS
   adware architecture that incorporates monitoring and analysis of
   user actions and interrupting the user to display apparently
   relevant advertisements (U.S. Patent #20070214042)
-----------------------------------------------------------------------
  Tomorrow: Memorial Day - honor those who sacrificed for our liberty
Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

Palvelin Postmaster


> On 27 May 2018, at 23:59, John Hardin <[hidden email]> wrote:
>
> On Sun, 27 May 2018, Palvelin Postmaster wrote:
>
>>> On 27 May 2018, at 21:43, John Hardin <[hidden email]> wrote:
>>>>
>>>> # Use Redis for Bayes backend
>>>> bayes_store_module Mail::SpamAssassin::BayesStore::Redis
>>>> bayes_sql_dsn server=127.0.0.1:6379,database=0
>>>
>>>  foreach (split(';', $bconf->{bayes_sql_dsn})) {
>>>
>>> It appears the DSN syntax for SA follows the common format and uses semicolon as a delimiter. Try:
>>>
>>> server=127.0.0.1:6379;database=0
>>
>> Works! Thanks a lot! :)
>
> Yay! Thanks for confirming. Example .cf file fixed.
>
> ...just for completeness, would you try "localhost" in the DSN to see whether name resolution does work there? I just assumed it does...

Using localhost does NOT work for me. Linting produces the same error as before.



--
Palvelin.fi Hostmaster
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Invalid argumenty warning when trying to use Bayes with Redis

John Hardin
On Mon, 28 May 2018, Palvelin Postmaster wrote:

>
>
>> On 27 May 2018, at 23:59, John Hardin <[hidden email]> wrote:
>>
>> On Sun, 27 May 2018, Palvelin Postmaster wrote:
>>
>>>> On 27 May 2018, at 21:43, John Hardin <[hidden email]> wrote:
>>>>>
>>>>> # Use Redis for Bayes backend
>>>>> bayes_store_module Mail::SpamAssassin::BayesStore::Redis
>>>>> bayes_sql_dsn server=127.0.0.1:6379,database=0
>>>>
>>>>  foreach (split(';', $bconf->{bayes_sql_dsn})) {
>>>>
>>>> It appears the DSN syntax for SA follows the common format and uses semicolon as a delimiter. Try:
>>>>
>>>> server=127.0.0.1:6379;database=0
>>>
>>> Works! Thanks a lot! :)
>>
>> Yay! Thanks for confirming. Example .cf file fixed.
>>
>> ...just for completeness, would you try "localhost" in the DSN to see whether name resolution does work there? I just assumed it does...
>
> Using localhost does NOT work for me. Linting produces the same error as before.

Rats. OK, fixing that assumption in the change I made to the example.

Thanks for testing it!

--
  John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
  [hidden email]    FALaholic #11174     pgpk -a [hidden email]
  key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
   The real opiate of the masses isn't religion; it's the belief that
   somewhere there is a benefit that can be delivered without a
   corresponding cost.                       -- Tom of "Radio Free NJ"
-----------------------------------------------------------------------
  Today: Memorial Day - honor those who sacrificed for our liberty