1 (edited by clarknova 2024-08-03 02:12:45)

Topic: netdata connection refused after upgrade to iredmail 1.6.3

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.1
- Deployed with iRedMail Easy or the downloadable installer? not sure, just ran upgrade
- Linux/BSD distribution name and version: Debian 12.6 bookworm
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mariadb
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I followed the tutorial to upgrade from 1.6.1 to 1.6.3. The only error I saw during the upgrade related to iRedAdmin, however iRedAdmin is working. I upgraded to the latest available versions of netdata and Roundcube because the versions listed in the tutorial were not available.

Now when I attempt to load https://mail.my.domain I get an error 502 Bad Gateway. The nginx error.log shows this:

2024/08/02 11:56:15 [error] 701#701: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: mail.my.domain, request: "GET /status?full&json HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "127.0.0.1"

2024/08/02 11:57:00 [error] 701#701: *4 connect() failed (111: Connection refused) while connecting to upstream, client: 104.37.148.71, server: mail.my.domain, request: "GET /mail/?_task=mail&_mbox=INBOX HTTP/2.0", upstream: "fastcgi://127.0.0.1:9999", host: "mail.my.domain", referrer: "[url]https://mail.my.domain/mail/?_task=mail&_mbox=INBOX[/url]"

2024/08/02 11:59:03 [error] 701#701: *11 connect() failed (111: Connection refused) while connecting to upstream, client: 104.37.148.71, server: mail.my.domain, request: "GET /mail/ HTTP/2.0", upstream: "fastcgi://127.0.0.1:9999", host: "mail.my.domain"

It looks to me like netdata is refusing connections on port 9999, however netstat shows otherwise:

# netstat -lntp|grep 9999
tcp        0      0 127.0.0.1:19999         0.0.0.0:*               LISTEN      580/netdata 

/opt/netdata/etc/netdata.conf looks like this:

# Get config from [url]http://127.0.0.1[/url]:<netdata_port>/netdata.conf
[registry]
    # Disable public central registry and become registry locally
    enabled = yes

    # Register to internal server instead
    registry to announce = [url]http://127.0.0.1:19999[/url]

[global]
    # The number of entries the netdata daemon will by default keep in memory
    # for each chart dimension. This setting can also be configured per chart.
    history = 172800

    # memory mode
    # - `save` is the default mode, data are maintained in memory and saved to
    #          disk when netdata exits.
    # - `ram` data are exclusively on memory and never saved on disk.
    # - `map` like swap, files are mapped to memory on demand.
    #
    #         WARNING: We suggest not to use this mode on nodes that run other
    #                  applications.
    #
    # - `none` no local database (used when data are streamed to a remote netdata).
    # - `dbengine`: data are in database files.
    #               The Database Engine works like a traditional database.
    memory mode = dbengine

    #
    # dbengine.
    #
    # determines the amount of RAM in MiB that is dedicated to caching netdata
    # metric values themselves.
    page cache size = 32

    # determines the amount of disk space in MiB that is dedicated to storing
    # netdata metric values and all related metadata describing them.
    dbengine disk space = 256

    # Bind to 127.0.0.1 by default.
    bind to = 127.0.0.1
    # Bind to all available network interfaces, but allow access from specified
    # IP addresses or networks.
    #bind to = *
    #allow connections from =

    run as user = netdata
    default port = 19999

    # The frequency in seconds, for data collection.
    update every = 3

    # Log files
    # Nginx logs access log, netdata no need to log it again.
    access log = none
    #error log = syslog
    #debug log = syslog

[plugin:proc]
    # Disable IPVS check since iRedMail doesn't use ipvs by default
    /proc/net/ip_vs/stats = no

    # inbound packets dropped
    /proc/net/dev = no

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: netdata connection refused after upgrade to iredmail 1.6.3

Port 9999 is php-fpm. Try to restart it first.
If failed, check /etc/php/<VERSION>/fpm/pool.d/www.conf, is it configured to listen on port 9999?

listen = 127.0.0.1:9999

FYI https://github.com/iredmail/iRedMail/bl … d/www.conf

3

Re: netdata connection refused after upgrade to iredmail 1.6.3

Restarting php-fpm didn't help. I don't see that line:

# grep listen /etc/php/8.2/fpm/pool.d/www.conf 
; - 'listen' (unixsocket)
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;   'port'                 - to listen on a TCP socket to all addresses
;   '/path/to/unix/socket' - to listen on a unix socket.
listen = /run/php/php8.2-fpm.sock
; Set listen(2) backlog.
;listen.backlog = 511
listen.owner = www-data
listen.group = www-data
;listen.mode = 0660
; When set, listen.owner and listen.group are ignored
;listen.acl_users =
;listen.acl_groups =
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
;listen.allowed_clients = 127.0.0.1
;listen.setfib = 1
;   listen queue         - the number of request in the queue of pending
;                          connections (see backlog in listen(2));
;   max listen queue     - the maximum number of requests in the queue
;   listen queue len     - the size of the socket queue of pending connections;
;   listen queue:         0
;   max listen queue:     1
;   listen queue len:     42
;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific IPv4 address on
;   '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
;   'port'                 - to listen on a TCP socket to all addresses
;   '/path/to/unix/socket' - to listen on a unix socket.
; Default Value: value of the listen option
;pm.status_listen = 127.0.0.1:9001

4

Re: netdata connection refused after upgrade to iredmail 1.6.3

I was able to copy a working www.conf from /etc/php//7.4/fpm/pool.d/ and web mail is working now. I must have installed the default file during the upgrade.