Rspamd: redis_cache_cb received error: Verbindungsaufbau abgelehnt (connection refused)

Discussion in 'Installation/Configuration' started by newan, Oct 18, 2019.

  1. newan

    newan New Member

  2. Steini86

    Steini86 Active Member

    Anything in /var/log/redis/redis-server.log?

    Verify, that redis is listening on the port which rspamd connects to
     
  3. newan

    newan New Member

    Code:
    3665:C 18 Oct 18:53:33.051 * DB saved on disk
    3665:C 18 Oct 18:53:33.051 * RDB: 0 MB of memory used by copy-on-write
    23724:M 18 Oct 18:53:33.133 * Background saving terminated with success
    23724:M 18 Oct 19:14:20.521 * 1 changes in 900 seconds. Saving...
    23724:M 18 Oct 19:14:20.540 * Background saving started by pid 16346
    16346:C 18 Oct 19:14:20.612 * DB saved on disk
    16346:C 18 Oct 19:14:20.612 * RDB: 0 MB of memory used by copy-on-write
    23724:M 18 Oct 19:14:20.641 * Background saving terminated with success
    23724:M 18 Oct 19:29:21.074 * 1 changes in 900 seconds. Saving...
    23724:M 18 Oct 19:29:21.076 * Background saving started by pid 25317
    25317:C 18 Oct 19:29:21.093 * DB saved on disk
    25317:C 18 Oct 19:29:21.094 * RDB: 0 MB of memory used by copy-on-write
    23724:M 18 Oct 19:29:21.176 * Background saving terminated with success
    23724:M 18 Oct 19:52:07.346 * 1 changes in 900 seconds. Saving...
    23724:M 18 Oct 19:52:07.347 * Background saving started by pid 6369
    6369:C 18 Oct 19:52:07.381 * DB saved on disk
    6369:C 18 Oct 19:52:07.382 * RDB: 0 MB of memory used by copy-on-write
    23724:M 18 Oct 19:52:07.448 * Background saving terminated with success
    23724:M 18 Oct 20:07:08.087 * 1 changes in 900 seconds. Saving...
    23724:M 18 Oct 20:07:08.204 * Background saving started by pid 15560
    15560:C 18 Oct 20:07:08.292 * DB saved on disk
    15560:C 18 Oct 20:07:08.293 * RDB: 0 MB of memory used by copy-on-write
    23724:M 18 Oct 20:07:08.304 * Background saving terminated with success
    23724:M 18 Oct 21:26:07.009 * 1 changes in 900 seconds. Saving...
    23724:M 18 Oct 21:26:07.132 * Background saving started by pid 30115
    30115:C 18 Oct 21:26:07.211 * DB saved on disk
    30115:C 18 Oct 21:26:07.212 * RDB: 0 MB of memory used by copy-on-write
    23724:M 18 Oct 21:26:07.233 * Background saving terminated with success
    23724:M 18 Oct 21:41:08.024 * 1 changes in 900 seconds. Saving...
    23724:M 18 Oct 21:41:08.025 * Background saving started by pid 6619
    6619:C 18 Oct 21:41:08.072 * DB saved on disk
    6619:C 18 Oct 21:41:08.073 * RDB: 0 MB of memory used by copy-on-write
    23724:M 18 Oct 21:41:08.126 * Background saving terminated with success
    
    Logg seems ok, no error
    Code:
    tcp        0      0 127.0.0.1:9121          0.0.0.0:*               LISTEN      997        20323332    20155/redis_exporte
    tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      122        23263633    23724/redis-server
    i dont know the rspamd -> redis port sorry?
    i only configurate:
    cat /etc/rspamd/local.d/redis.conf:
    servers = "127.0.0.1"
     
  4. Steini86

    Steini86 Active Member

    Should be ok, by default, Rspamd uses port 6379 for Redis.
    Log looks ok (except, there is nothing going on). Is it working? Have you restarted the server? Could it be, that your rspamd was running, before redis was ready?
    Would be interesting to have the log at the same time where the error occurs ;)
    Restart rspamd and look at the logs. If there is no hint, increase the loglevel: https://rspamd.com/doc/configuration/logging.html
     
  5. newan

    newan New Member

    Code:
    1403:M 18 Oct 23:10:16.643 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.
    1403:M 18 Oct 23:10:16.820 # Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
    1403:M 18 Oct 23:10:16.820 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
                    _._
               _.-``__ ''-._
          _.-``    `.  `_.  ''-._           Redis 3.0.6 (00000000/0) 64 bit
      .-`` .-```.  ```\/    _.,_ ''-._
     (    '      ,       .-`  | `,    )     Running in standalone mode
     |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
     |    `-._   `._    /     _.-'    |     PID: 1403
      `-._    `-._  `-./  _.-'    _.-'
     |`-._`-._    `-.__.-'    _.-'_.-'|
     |    `-._`-._        _.-'_.-'    |           http://redis.io
      `-._    `-._`-.__.-'_.-'    _.-'
     |`-._`-._    `-.__.-'    _.-'_.-'|
     |    `-._`-._        _.-'_.-'    |
      `-._    `-._`-.__.-'_.-'    _.-'
          `-._    `-.__.-'    _.-'
              `-._        _.-'
                  `-.__.-'
    
    1403:M 18 Oct 23:10:17.003 # Server started, Redis version 3.0.6
    1403:M 18 Oct 23:10:17.003 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
    1403:M 18 Oct 23:10:17.003 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
    1403:M 18 Oct 23:10:17.108 * DB loaded from disk: 0.105 seconds
    1403:M 18 Oct 23:10:17.108 * The server is now ready to accept connections on port 6379
    
    Same wanings on reboot in the redis log.

    Log error on same time:

    Code:
    2019-10-18 23:16:01 #1961(normal) <314287>; lua; arc.lua:611: cannot read key from /var/lib/rspamd/arc/newan.de.arc.key: Datei oder Verzeichnis nicht gefunden
    2019-10-18 23:16:02 #1961(normal) <314287>; lua; mx_check.lua:83: redis_cache_cb received error: Verbindungsaufbau abgelehnt
    2019-10-18 23:16:02 #1961(normal) <314287>; lua; mx_check.lua:83: redis_cache_cb received error: Verbindungsaufbau abgelehnt
    2019-10-18 23:16:02 #1961(normal) <314287>; lua; mx_check.lua:83: redis_cache_cb received error: Verbindungsaufbau abgelehnt
    2019-10-18 23:16:02 #1961(normal) <314287>; lua; mx_check.lua:83: redis_cache_cb received error: Verbindungsaufbau abgelehnt
    2019-10-18 23:16:02 #1961(normal) <314287>; lua; mx_check.lua:83: redis_cache_cb received error: Verbindungsaufbau abgelehnt
    2019-10-18 23:16:02 #1961(normal) logger; file_log_function: Last message repeated 8 times
    2019-10-18 23:16:02 #1961(normal) <314287>; task; rspamd_redis_finalize_process: cannot retreive stat tokens from Redis: skip obtaining bayes tokens for BAYES_SPAM: not enough learns 0; 200 required
    2019-10-18 23:16:02 #1961(normal) <314287>; task; rspamd_redis_finalize_process: cannot retreive stat tokens from Redis: skip obtaining bayes tokens for BAYES_HAM: not enough learns 0; 200 required
    2019-10-18 23:16:02 #1961(normal) <314287>; lua; greylist.lua:298: Score too low - skip greylisting
    2019-10-18 23:16:02 #1961(normal) <314287>; task; rspamd_stat_check_autolearn: <[email protected]>: autolearn ham for classifier 'bayes' as message's score is negative: -3.55
    
    On redis no error on 23:16:02:

    Code:
    1403:M 18 Oct 23:15:17.071 * 10 changes in 300 seconds. Saving...
    1403:M 18 Oct 23:15:17.072 * Background saving started by pid 6355
    6355:C 18 Oct 23:15:17.810 * DB saved on disk
    6355:C 18 Oct 23:15:17.810 * RDB: 0 MB of memory used by copy-on-write
    1403:M 18 Oct 23:15:17.874 * Background saving terminated with success
    1403:M 18 Oct 23:20:18.093 * 10 changes in 300 seconds. Saving...
    1403:M 18 Oct 23:20:18.094 * Background saving started by pid 9375
    9375:C 18 Oct 23:20:18.229 * DB saved on disk
    9375:C 18 Oct 23:20:18.230 * RDB: 0 MB of memory used by copy-on-write
    1403:M 18 Oct 23:20:18.295 * Background saving terminated with success
    

    Edit: maxclient fix with: https://easyengine.io/tutorials/redis/#maxclients
     
    Last edited: Oct 18, 2019
  6. Steini86

    Steini86 Active Member

  7. newan

    newan New Member

    I dont know. Like the Tutorial.
    It works most time, i think the connection errors are on the same time on redis is backup itself.
     
  8. Steini86

    Steini86 Active Member

    I do not understand what you are saying: So "it" works most of the time. And the sporadically(?) something(?) does "not work"?
    Please specify your problem: What is not working? What would you expect?
     
  9. FredZ

    FredZ Member

    I had the same issue.

    This was resolved by simply changing /etc/rspamd/local.d/redis.conf to read
    Code:
    servers = "127.0.0.1:6379";
    I hope this helps

    Regards

    Fred
     
    stef157 likes this.

Share This Page