[Dovecot] --log-error and the mysterious "not starting" problem
I've finally upgraded to 1.0.rc21. If I run "dovecot --log-error", then dovecot fails to start. The following appears in the log:
Feb 5 10:54:00 taurus1 dovecot: Dovecot v1.0.rc21 starting up Feb 5 10:54:00 taurus1 dovecot: This is Dovecot's error log
Without --log-error, it will start up fine from command-line.
Dovecot still fails to start, as near as I can tell, in the specific condition that it is being started from a non-interactive shell and there is a mail_plugin set in "protocol imap". mail plugins set for pop or lda do not cause this problem. The failure to start appears in only two instances that I can see: on boot, or by a monitoring script if dovecot crashes, or, since I haven't seen dovecot die, when I manually stop it to see if the monitoring program will restart it.
With the above problem, if the init script has --log-error when I try to make the monitoring program restart dovecot, then nothing still gets logged.
-- Marshal Newrock, Ideal Solution LLC http://www.idealso.com
On 5.2.2007, at 18.07, Marshal Newrock wrote:
I've finally upgraded to 1.0.rc21. If I run "dovecot --log-error",
then dovecot fails to start. The following appears in the log:Feb 5 10:54:00 taurus1 dovecot: Dovecot v1.0.rc21 starting up Feb 5 10:54:00 taurus1 dovecot: This is Dovecot's error log
Without --log-error, it will start up fine from command-line.
Yes, that's exactly what it's supposed to do. I didn't think it could
have been understood any other way :) The reason for --log-error's
existence is that some people just can't seem to find the error logs,
but once they do there's really no need to find them again.
Dovecot still fails to start, as near as I can tell, in the specific condition that it is being started from a non-interactive shell and there is a mail_plugin set in "protocol imap". mail plugins set for pop or lda do not cause this problem. The failure to start appears in only two instances that I can see: on boot, or by a monitoring script if dovecot crashes, or, since I haven't seen dovecot die, when I manually stop it to see if the monitoring program will restart it.
By "fails to start" what exactly do you mean? It does one of the
following:
- log an error message
- exit with non-zero exit code
- crash
What does strace -f -o log dovecot show?
On Mon, 5 Feb 2007 19:48:39 +0200 Timo Sirainen tss@iki.fi wrote:
On 5.2.2007, at 18.07, Marshal Newrock wrote:
I've finally upgraded to 1.0.rc21. If I run "dovecot --log-error", then dovecot fails to start. The following appears in the log:
Feb 5 10:54:00 taurus1 dovecot: Dovecot v1.0.rc21 starting up Feb 5 10:54:00 taurus1 dovecot: This is Dovecot's error log
Without --log-error, it will start up fine from command-line.
Yes, that's exactly what it's supposed to do. I didn't think it could have been understood any other way :) The reason for --log-error's existence is that some people just can't seem to find the error logs, but once they do there's really no need to find them again.
Ah, I guess I hadn't understood that part. :p
Dovecot still fails to start, as near as I can tell, in the specific condition that it is being started from a non-interactive shell and there is a mail_plugin set in "protocol imap". mail plugins set for pop or lda do not cause this problem. The failure to start appears in only two instances that I can see: on boot, or by a monitoring script if dovecot crashes, or, since I haven't seen dovecot die, when I manually stop it to see if the monitoring program will restart it.
By "fails to start" what exactly do you mean? It does one of the
following:
- log an error message
- exit with non-zero exit code
- crash
There are no error messages logged. I'm not sure how to tell if it exits with a non-zero exit code. For that, I'd need another program which will run in the background and then try to start dovecot, and report the error code. I'm not sure offhand how I'd do that.
What does strace -f -o log dovecot show?
I set monit to start dovecot with "/usr/bin/strace -f -s 255 -o /root/dovecot-startup.log /usr /sbin/dovecot -c /etc/dovecot/dovecot-test.conf"
/etc/dovecot/dovecot-test.conf is mostly a copy of the standard dovecot.conf file, but with the mail executables set back to the default, and the quota plugin enabled for imap. I did this to keep the test configuration from being copied to other machines.
Output of strace is attached.
-- Marshal Newrock, Ideal Solution LLC http://www.idealso.com
One last bit of info. There's an easy workaround for this problem (if anyone else sees it):
Use "screen -D -m" to start Dovecot. Add this to the init script or wherever necessary.
-- Marshal Newrock, Ideal Solution LLC http://www.idealso.com
On Mon, 2007-02-05 at 11:07 -0500, Marshal Newrock wrote:
Dovecot still fails to start, as near as I can tell, in the specific condition that it is being started from a non-interactive shell and there is a mail_plugin set in "protocol imap". mail plugins set for pop or lda do not cause this problem. The failure to start appears in only two instances that I can see: on boot, or by a monitoring script if dovecot crashes, or, since I haven't seen dovecot die, when I manually stop it to see if the monitoring program will restart it.
It wrote the error message to stderr, but I guess it wasn't shown in the screen or logged?
Anyway, fix here: http://dovecot.org/list/dovecot-cvs/2007-February/007637.html
Another workaround would be to set imap_capability manually so Dovecot doesn't need to run the dump-capability process (it checks if plugins added more capabilities).
On Mon, 12 Feb 2007 20:15:01 +0200 Timo Sirainen tss@iki.fi wrote:
On Mon, 2007-02-05 at 11:07 -0500, Marshal Newrock wrote:
Dovecot still fails to start, as near as I can tell, in the specific condition that it is being started from a non-interactive shell and there is a mail_plugin set in "protocol imap". mail plugins set for pop or lda do not cause this problem. The failure to start appears in only two instances that I can see: on boot, or by a monitoring script if dovecot crashes, or, since I haven't seen dovecot die, when I manually stop it to see if the monitoring program will restart it.
It wrote the error message to stderr, but I guess it wasn't shown in the screen or logged?
Anyway, fix here: http://dovecot.org/list/dovecot-cvs/2007-February/007637.html
Another workaround would be to set imap_capability manually so Dovecot doesn't need to run the dump-capability process (it checks if plugins added more capabilities).
This make sense. I had recently also tried upgrading to rc22 to see if it fixed another problem, and at that point, dovecot always crashed when trying to start up at "dump-capability". As soon as I have time later today, I'll send the complete output of trying to start rc22, along with testing to verify exactly when it crashes, and try setting imap_capability manually.
-- Marshal Newrock, Ideal Solution LLC http://www.idealso.com
On Mon, 12 Feb 2007 13:26:27 -0500 Marshal Newrock marshal@idealso.com wrote:
It wrote the error message to stderr, but I guess it wasn't shown in the screen or logged?
Anyway, fix here: http://dovecot.org/list/dovecot-cvs/2007-February/007637.html
Another workaround would be to set imap_capability manually so Dovecot doesn't need to run the dump-capability process (it checks if plugins added more capabilities).
This make sense. I had recently also tried upgrading to rc22 to see if it fixed another problem, and at that point, dovecot always crashed when trying to start up at "dump-capability". As soon as I have time later today, I'll send the complete output of trying to start rc22, along with testing to verify exactly when it crashes, and try setting imap_capability manually.
With dovecot-1.0.rc22, compiled with the Gentoo "debug" USE flag set, any attempt to start dovecot with an imap mail_plugin set, but imap_capability not set, results in the following:
- Starting dovecot ... Panic: Leaked socket fd 3: 207.179.118.5:60169 -> 207.179.118.2:3306 Error: Raw backtrace: [0x80b457a] -> [0x80b444c] -> [0x80b4786] -> [0x8063997] -> /lib/libc.so.6(__libc_start_main+0xd8) [0xb7eb0878] -> [0x80567a1] Error: imap dump-capability process killed with signal 6
If any more info is needed, just tell me what to do.
If imap_capability is set, then it starts without a problem, both from command-line and as a background process from monit.
With http://dovecot.org/list/dovecot-cvs/2007-February/007637.html applied, it goes back to the behavior described previously, but with imap_capability set, it starts without a problem.
Thank you. The workaround is sufficient for me. I'll help with testing as I can.
-- Marshal Newrock, Ideal Solution LLC http://www.idealso.com
On Mon, 2007-02-12 at 15:14 -0500, Marshal Newrock wrote:
With dovecot-1.0.rc22, compiled with the Gentoo "debug" USE flag set, any attempt to start dovecot with an imap mail_plugin set, but imap_capability not set, results in the following:
- Starting dovecot ... Panic: Leaked socket fd 3: 207.179.118.5:60169 -> 207.179.118.2:3306
What is this socket? It creates a MySQL connection at startup for some purpose. Do you use nss_mysql or something?
I just tried this with dovecot-1.0.rc23. After I stopped dovecot, monit successfully restarted it without resorting to any "screen" trickery. I am optimistic. :)
-- Marshal Newrock, Ideal Solution LLC http://www.idealso.com
participants (2)
-
Marshal Newrock
-
Timo Sirainen