centos 7 kopano-dagent wont run after upgrade

Hi

kopano dagent wont run anymore with centos 7 on latest version. if i downgrade it is working again.

Name : kopano-dagent
Arch : x86_64
Version : 8.6.80.722
Release : 83.1
Size : 372 k
Repo : installed
From repo : kopano
Summary : E-Mail Delivery Agent for the Kopano platform
URL : https://kopano.io/
License : AGPL-3.0-only
Description : Delivers incoming e-mail from your SMTP server to stores in the
: Kopano server.

Hi @ckruijntjens ,

I just updated to the latest master (which is 8.6.80.743-84.1 at the time of writing) and cannot reproduce the described issue. For me the dagent is starting fine and I can deliver mails via lmtp.

@fbartels

Just did upgrade to the latest version but dagent wont start.

This is on the latest centos version

It says Address allredeay in use?

5] void* HandlerLMTP(void*): HrGetSession failed: network error (80040115) Fri May 4 10:32:38 2018: [=======] [ 600] LMTP service will now exit Xßc^?[=======] [ 5488] Starting kopano-dgent version 8.6.80.713 (pid 5488) (LMTP mode) Xßc^?[=======] [ 5488] LMTP service wil now exit [crit ] Unable to create socket(10,1,6) port 2003: Address already in use [crit ] Unable to create socket(10,1,6) port 2003: Address already in use [crit ] Unable to create socket(10,1,6) port 2003: Address already in use <converted] 60L, 6331C 60,1 Bot

Ah, that’s an error someone can work with.

There must be another process already listening on port 2003 (which can simply be an old binary). I’d suggest to kill the old process manually and then start the dagent via systemd.

Hi Just did that however No change.

If I change the port to 2004 it works?

@ckruijntjens said in centos 7 kopano-dagent wont run after upgrade:

If I change the port to 2004 it works?

is that a question are a statement?

@fbartels

Sorry this is No question. It works if I change it to port 2004. If I then look What is using port 2003 it is kopano-dagent ipv6?

If I change the port to 2003 in dagent.cfg the it starts to complain again?

Hai, i have seen this yesterday also on my Debian 9 server.

Thu May  3 14:34:16 2018: [crit   ] Unable to create socket(10,1,6) port 2003: Address already in use
Thu May  3 14:34:16 2018: [crit   ] Unable to create socket(10,1,6) port 2003: Address already in use

im today working on my kopano server again, if see why/how i’ll post this here.

Im sure this is a bug.

netstat -plant | grep kopano
tcp        0      0 0.0.0.0:236             0.0.0.0:*               LISTEN      7776/kopano-server
tcp        0      0 0.0.0.0:237             0.0.0.0:*               LISTEN      7776/kopano-server
tcp6       0      0 :::143                  :::*                    LISTEN      5724/kopano-gateway
tcp6       0      0 :::8080                 :::*                    LISTEN      5377/kopano-ical
tcp6       0      0 :::8443                 :::*                    LISTEN      5377/kopano-ical
tcp6       0      0 :::993                  :::*                    LISTEN      5724/kopano-gateway
tcp6       0      0 :::995                  :::*                    LISTEN      5724/kopano-gateway
tcp6       0      0 :::110                  :::*                    LISTEN      5724/kopano-gateway

A start and status from systemd.

root@mail1:/etc/kopano# systemctl start kopano-dagent
root@mail1:/etc/kopano# systemctl status kopano-dagent
● kopano-dagent.service - Kopano Core Delivery Agent
   Loaded: loaded (/lib/systemd/system/kopano-dagent.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/kopano-dagent.service.d
           └─override.conf
   Active: inactive (dead) since Fri 2018-05-04 11:45:08 CEST; 4s ago
     Docs: man:kopano-dagent(8)
           man:kopano-dagent.cfg(5)
  Process: 13297 ExecStart=/usr/sbin/kopano-dagent -l (code=exited, status=0/SUCCESS)
 Main PID: 13297 (code=exited, status=0/SUCCESS)

May 04 11:45:08 mail1 systemd[1]: Started Kopano Core Delivery Agent.

and the log is telling different.

root@mail1:/etc/kopano# cat /var/log/kopano/dagent.log
Fri May  4 11:43:27 2018: [crit   ] Unable to create socket(10,1,6) port 2003: Address already in use
Fri May  4 11:45:08 2018: [crit   ] Unable to create socket(10,1,6) port 2003: Address already in use

and the fix is pretty simple.
i changed lmtp_port = 2003 to
lmtp_port = 0.0.0.0:2003

results in :

Fri May  4 11:49:18 2018: [=======] [13391] Starting kopano-dagent version 8.6.80 (pid 13391) (LMTP mode)

Now only this is NOT correct, so its still buggy imo.

netstat -plant | grep kopano-dagent
tcp6       0      0 :::2003                 :::*                    LISTEN      13391/kopano-dagent

I’ve set 0.0.0.0:2003 why is the listen on ipv6 ?

Please post your dagent.cfg - your problem might be related to an issue with option lmtp_listen.
++umgfoin

In dagent.conf, If you set

server_bind = 0.0.0.0
lmtp_port = 2003
Results in : Fri May 4 11:54:25 2018: [crit ] Unable to create socket(2,1,6) port 2003: Address already in use

server_bind = ::1
lmtp_port = 2003
Results in : Fri May 4 11:56:03 2018: [crit ] Unable to create socket(10,1,6) port 2003: Address already in use

server_bind = [::1]
lmtp_port = 2003
Results in : Fri May 4 11:56:37 2018: [=======] [13505] Starting kopano-dagent version 8.6.80 (pid 13505) (LMTP mode)

server_bind = 127.0.0.1
lmtp_port = 2003

Results in : Fri May 4 11:57:41 2018: [crit ] Unable to create socket(2,1,6) port 2003: Address already in use

server_bind =
lmtp_port = 2003
Results in : Fri May 4 12:03:41 2018: [crit ] Unable to create socket(10,1,6) port 2003: Address

and what is "server_bind_intf"
What do you need to set here, totaly unclear with the current text in the config.
Sorry but server_bind_intf is a joke, remove it, where is this for? limit to ipv4/ipv6.
above settings like
server_bind = 0.0.0.0 should set all adresses. ( ipv4 and ipv6 )
server_bind = [::1] should set only ipv6 localhost adresses.
server_bind = 127.0.0.1 should set only ipv4 localhost adresses.

I cant think of any use for server_bind_intf, is only more confusing imo.

so yes, imo, a bug.

forgot to mention:
dpkg -l | grep kopano-dagent
ii kopano-dagent 8.6.80.722-0+83.1 amd64 E-Mail Delivery Agent for the Kopano Core

i’ll go test the daily update now.

Hai, tested again exact same results as above.

dpkg -l | grep kopano-dagent
ii kopano-dagent 8.6.80.743-0+84.1 amd64 E-Mail Delivery Agent for the Kopano Core

Hello,
there have been recent changes to dagent interface/port configuration to match server.cfg nomenclatura.
server_bind,server_bind_intf,lmtp_port will be declared “legacy”

try:

lmtp_listen = [::1]:2003 127.0.0.1:2003
lmtp_port = ""

to listen on IPV4/6 localhost addresses.

There’s an issue with option lmtp_port - read here - already fixed, but probably not contained in current community builds, yet.

++umgfoin.

thank for notice. and yes, that works.