Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Cannot login to dovecot via Roundcube after update
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Elleni
l33t
l33t


Joined: 23 May 2006
Posts: 733

PostPosted: Sat Apr 29, 2017 12:47 pm    Post subject: [solved] Cannot login to dovecot via Roundcube after update Reply with quote

In /var/log/mail.log I see an entry indicating:
Code:
dovecot[4372]: imap-login: Fatal: Dovecot version mismatch: Master is v2.2.27, imap-login is v2.2.29.1 (if you don't care, set version_ignore=yes)


How can I repair this? I tried to set version_ignore=yes in /etc/dovecot/dovecot.conf but and restarting dovecot service, but this did not help.

Filed a bug: https://bugs.gentoo.org/show_bug.cgi?id=617000


Last edited by Elleni on Sun Apr 30, 2017 5:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
Nick1
n00b
n00b


Joined: 29 Apr 2017
Posts: 1

PostPosted: Sat Apr 29, 2017 10:54 pm    Post subject: Reply with quote

It looks like a conflict between two Dovecot versions.

Did you proceed to an update recently?

I think that you should:

- ensure that you have only 1 version installed on your system

- if you just updated dovecot, then restart the running master daemon
(which is the old one) by using the "cmd /etc/rc.d/dovecot restart" because there could be incompatibilities after an update
Back to top
View user's profile Send private message
Elleni
l33t
l33t


Joined: 23 May 2006
Posts: 733

PostPosted: Sat Apr 29, 2017 11:02 pm    Post subject: Reply with quote

Yeah, system was updatet recently, and also did emerge --depclean, so I dont think, there should be two versions installed. But how can I ensure? I restarted it by /etc/init.d/dovecot restart, and I even restarted whole server. After that, I tried if it helps to set the version_ignore=yes in /etc/dovecot/dovecot.conf and restarted service again but still no luck, so I filed the bug, as I did not know how to proceed further.
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Sun Apr 30, 2017 12:05 am    Post subject: Reply with quote

Is everything in /usr/libexec/dovecot of the same date? It should all match the date of /usr/sbin/dovecot

I have "version_ignore = yes" in my config just the same. You can check if you have that set with `dovecot -n`

Also, you can compare the various modules (the one giving you a fit is "imap-login") using `doveconf -n -m imap-login`
Back to top
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1717

PostPosted: Sun Apr 30, 2017 12:10 am    Post subject: Reply with quote

Does it produce any errors in logs?
Check it's own log, grep syslog, try launching it manually from terminal with some flags for increased verbosity instead of regular service script.
I don't know dovecot (yet?), but reporting errors is a rather common practice in the blackscreen world.
It's gui artists who lost their sanity and have their applications exit without a goodbye when things go wrong.
Back to top
View user's profile Send private message
Elleni
l33t
l33t


Joined: 23 May 2006
Posts: 733

PostPosted: Sun Apr 30, 2017 7:33 am    Post subject: Reply with quote

Thanks for your replies.

The date is everywhere the same:

ls -l /usr/libexec/dovecot/
Code:

insgesamt 2404
-rwxr-xr-x 1 root root  22816 27. Apr 18:38 aggregator
-rwxr-xr-x 1 root root  22744 27. Apr 18:38 anvil
-rwxr-xr-x 1 root root 403720 27. Apr 18:38 auth
-rwxr-xr-x 1 root root  10024 27. Apr 18:38 checkpassword-reply
-rwxr-xr-x 1 root root 147600 27. Apr 18:38 config
-rwxr-xr-x 1 root root   2839 27. Apr 18:38 decode2text.sh
lrwxrwxrwx 1 root root     11 27. Apr 18:39 deliver -> dovecot-lda
-rwxr-xr-x 1 root root 105344 27. Apr 18:38 dict
-rwxr-xr-x 1 root root 121248 27. Apr 18:38 director
-rwxr-xr-x 1 root root  10360 27. Apr 18:38 dns-client
-rwxr-xr-x 1 root root 581944 27. Apr 18:38 doveadm-server
-rwxr-xr-x 1 root root  18280 27. Apr 18:38 dovecot-lda
-rwxr-xr-x 1 root root  10024 27. Apr 18:38 gdbhelper
-rwxr-xr-x 1 root root 256904 27. Apr 18:38 imap
-rwxr-xr-x 1 root root  35552 27. Apr 18:38 imap-hibernate
-rwxr-xr-x 1 root root  39344 27. Apr 18:38 imap-login
-rwxr-xr-x 1 root root  22720 27. Apr 18:38 imap-urlauth
-rwxr-xr-x 1 root root  14720 27. Apr 18:38 imap-urlauth-login
-rwxr-xr-x 1 root root  55488 27. Apr 18:38 imap-urlauth-worker
-rwxr-xr-x 1 root root  30840 27. Apr 18:38 indexer
-rwxr-xr-x 1 root root  18552 27. Apr 18:38 indexer-worker
-rwxr-xr-x 1 root root  22744 27. Apr 18:38 ipc
-rwxr-xr-x 1 root root  55552 27. Apr 18:38 lmtp
-rwxr-xr-x 1 root root  22648 27. Apr 18:38 log
-rwxr-xr-x 1 root root  10088 27. Apr 18:38 maildirlock
-rwxr-xr-x 1 root root  51968 27. Apr 18:38 pop3
-rwxr-xr-x 1 root root  27056 27. Apr 18:38 pop3-login
-rwxr-xr-x 1 root root  93416 27. Apr 18:38 quota-status
-rwxr-xr-x 1 root root  18216 27. Apr 18:38 rawlog
-rwxr-xr-x 1 root root  39264 27. Apr 18:38 replicator
-rwxr-xr-x 1 root root  14120 27. Apr 18:38 script
-rwxr-xr-x 1 root root  14120 27. Apr 18:38 script-login
-rwxr-xr-x 1 root root  18784 27. Apr 18:38 ssl-params
-rwxr-xr-x 1 root root  55680 27. Apr 18:38 stats
-rwxr-xr-x 1 root root  10248 27. Apr 18:38 tcpwrap
-rwxr-xr-x 1 root root  10072 27. Apr 18:38 xml2text


ls -l /usr/sbin/dovecot
Code:

-rwxr-xr-x 1 root root 92040 27. Apr 18:38 /usr/sbin/dovecot


dovecot -n
Code:

# 2.2.29.1 (e0b76e3): /etc/dovecot/dovecot.conf
# OS: Linux 4.8.17-hardened-r2 x86_64 Gentoo Base System release 2.3
auth_mechanisms = plain login cram-md5
listen = *
mail_location = maildir:~/.maildir
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
}
passdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
postmaster_address = postmaster@mydoma.in
protocols = imap lmtp
service auth-worker {
  user = mail
}
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    user = postfix
  }
  unix_listener auth-userdb {
    group = mail
    mode = 0600
    user = mail
  }
}
service imap-login {
  inet_listener imap {
    port = 143
  }
  inet_listener imaps {
    port = 993
    ssl = yes
  }
}
service lmtp {
  unix_listener /var/spool/postfix/private/dovecot-lmtp {
    group = postfix
    mode = 0660
    user = postfix
  }
}
service pop3-login {
  inet_listener pop3s {
    port = 0
    ssl = yes
  }
}
ssl_cert = </etc/ssl/dovecot/server.pem
ssl_key =  # hidden, use -P to show it
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
version_ignore = yes

doveconf -n -m imap-login

Code:

# 2.2.29.1 (e0b76e3): /etc/dovecot/dovecot.conf
# OS: Linux 4.8.17-hardened-r2 x86_64 Gentoo Base System release 2.3
version_ignore = yes


Concerning error logs, all I could find is in /var/log/mail.log:
Code:
dovecot[4372]: imap-login: Fatal: Dovecot version mismatch: Master is v2.2.27, imap-login is v2.2.29.1 (if you don't care, set version_ignore=yes)


I dont understand, what is meant by Master is v2.2.27 as the installed version is:

Code:
net-mail/dovecot
      Latest version available: 2.2.29.1
      Latest version installed: 2.2.29.1
      Size of files: 5'833 KiB
      Homepage:      http://www.dovecot.org/
      Description:   An IMAP and POP3 server written with security primarily in mind
      License:       LGPL-2.1 MIT


I did not find anything grep-ing dovecot and/or imap in dmesg.

I temporary set the variables auth_verbose=yes and auth_debug=yes in 10-logging.conf under /etc/dovecot/conf.d and restarted dovecot service.

Tailed mail.log reads:

Code:
Apr 30 09:38:22 hostname postfix/smtpd[17894]: connect from fqdn[ipadress]
Apr 30 09:38:22 hostname dovecot[17890]: auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-sql.conf.ext
Apr 30 09:38:22 hostname dovecot[17883]: master: Error: service(auth): command startup failed, throttling for 2 secs
Apr 30 09:38:22 hostname postfix/smtpd[17894]: fatal: no SASL authentication mechanisms
Apr 30 09:38:23 hostname postfix/master[6119]: warning: process /usr/libexec/postfix/smtpd pid 17894 exit status 1
Apr 30 09:38:23 hostname postfix/master[6119]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling
Apr 30 09:38:32 hostname dovecot[17883]: master: Warning: Killed with signal 15 (by pid=17921 uid=0 code=kill)
Apr 30 09:38:32 hostname dovecot[17951]: master: Dovecot v2.2.29.1 (e0b76e3) starting up for imap, lmtp (core dumps disabled)
Apr 30 09:38:46 hostname dovecot[17956]: auth: Debug: Loading modules from directory: /usr/lib64/dovecot/auth
Apr 30 09:38:46 hostname dovecot[17956]: auth: Debug: Module loaded: /usr/lib64/dovecot/auth/lib20_auth_var_expand_crypt.so
Apr 30 09:38:46 hostname dovecot[17956]: auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-sql.conf.ext
Apr 30 09:38:46 hostname dovecot[17951]: master: Error: service(auth): command startup failed, throttling for 2 secs
Apr 30 09:38:46 hostname dovecot[17956]: imap-login: Disconnected: Auth process broken (disconnected before auth was ready, waited 0 secs): user=<>, rip=127.0.0.1, lip=127.0.0.1, secured, session=<oOWNZV1OAot/AAAB>
Apr 30 09:40:03 hostname postfix/anvil[17897]: statistics: max connection rate 1/60s for (smtp:ipadress) at Apr 30 09:38:22
Apr 30 09:40:03 hostname postfix/anvil[17897]: statistics: max connection count 1 for (smtp:ipadress) at Apr 30 09:38:22
Apr 30 09:40:03 hostname postfix/anvil[17897]: statistics: max cache size 1 at Apr 30 09:38:22
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Sun Apr 30, 2017 10:15 am    Post subject: Reply with quote

When you do `/etc/init.d/dovecot stop`, all the doveco-related programs should stop. Make sure they do.

Code:
root@hypoid [3] 37 /root # ps aux | grep dovecot
root     15719  0.0  0.0   3880  2844 ?        Ss   Apr29   0:00 /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf
dovecot  15726  0.0  0.0   3560   692 ?        S    Apr29   0:00 dovecot/anvil
root     15727  0.0  0.0   3692  2284 ?        S    Apr29   0:00 dovecot/log
root     15729  0.0  0.0   4552  3204 ?        S    Apr29   0:00 dovecot/config
dovenull 15750  0.0  0.0   7136  5536 ?        S    Apr29   0:00 dovecot/imap-login
cboldt   15751  0.0  0.0   5984  3924 ?        S    Apr29   0:00 dovecot/imap
dovenull 20176  0.0  0.0   6472  3820 ?        S    05:41   0:00 dovecot/imap-login
cboldt   20180  0.0  0.0   5220  3824 ?        S    05:41   0:00 dovecot/imap
dovenull 20668  0.0  0.0   7136  5272 ?        S    06:01   0:00 dovecot/imap-login
cboldt   20670  0.0  0.0   5264  3484 ?        S    06:01   0:00 dovecot/imap
dovenull 20678  0.0  0.0   7136  5536 ?        S    06:01   0:00 dovecot/imap-login
cboldt   20679  0.0  0.0   6372  4076 ?        S    06:01   0:00 dovecot/imap

root@hypoid [3] 38 /root # /etc/init.d/dovecot stop
 * Stopping dovecot ...    [ok]

root@hypoid [3] 39 /root # ps aux | grep dovecot

root@hypoid [3] 40 /root # /etc/init.d/dovecot start
 * Starting dovecot ...     [ok]

root@hypoid [3] 41 /root # ps aux | grep dovecot
root     20964  0.0  0.0   3880  2736 ?        Ss   06:10   0:00 /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf
dovecot  20971  0.0  0.0   3560   692 ?        S    06:10   0:00 dovecot/anvil
root     20972  0.0  0.0   3692  2452 ?        S    06:10   0:00 dovecot/log
root     20974  0.0  0.0   4552  3160 ?        S    06:10   0:00 dovecot/config


If, after `/etc/init.d/dovecot stop` there are still dovecot-related program running, kill them, then restart dovecot. The reason there are more dovecot-related programs "after awhile" is that dovecot starts what it needs based on login attempts and requests to serve email. None of that has happened immediately after restarting the dovecot service.
Back to top
View user's profile Send private message
cboldt
l33t
l33t


Joined: 24 Aug 2005
Posts: 829

PostPosted: Sun Apr 30, 2017 10:30 am    Post subject: Reply with quote

I see a fatal error in dovecot startup ...

Code:
Apr 30 09:38:22 hostname dovecot[17890]: auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-sql.conf.ext
Apr 30 09:38:46 hostname dovecot[17956]: auth: Fatal: sql: driver not set in configuration file /etc/dovecot/dovecot-sql.conf.ext
Apr 30 09:38:46 hostname dovecot[17956]: imap-login: Disconnected: Auth process broken ...


The search for /etc/dovecot/dovecot-sql.conf.ext is driven by a setting in one of your configuration files. This was reported by 1dovecot -n` as ...

Code:
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}
Back to top
View user's profile Send private message
Elleni
l33t
l33t


Joined: 23 May 2006
Posts: 733

PostPosted: Sun Apr 30, 2017 4:02 pm    Post subject: Reply with quote

Thanks for mentioning it; I will check and compare files in /etc/dovecot with a backup and see if there is any difference. I usually make copies before updating config files with etc-update. I remember that when I executed it lately it only said merging trivial changes. Normaly I execute etc-update to see what files it would like to overwrite (and deny the overwrite), and then I copy them to have a backuped file, before I actually let etc-update run and replace the old config files with the actual ones; after that I manually put in the values from the copied files to the new ones. I will report back, what I find out.

And worst case - as it is a VPS - I will ask provider to restore to a backup taken 4 days ago, because in /var/log/messages I have found out, that the fatal imap-login message is shown on 27th april for the first time.


Last edited by Elleni on Sun Apr 30, 2017 6:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
Elleni
l33t
l33t


Joined: 23 May 2006
Posts: 733

PostPosted: Sun Apr 30, 2017 5:50 pm    Post subject: Reply with quote

After compairing and modifying dovecot-sql.conf.ext I still got errors, and as I saw differences also different files in /etc/dovecot/conf.d (ex. 10-mail.conf, 10-ssl.conf, 20-imap.conf and so on), I decided to copy over the whole dovecot folder and replace the actual /etc/dovecot with it. Now Mailserver is up and running again. When I'll have some spare time, I maybe will compare the files one by one, but for now case is solved.

Thanks for your inputs!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum