Posts Tagged ‘error’

How to fix: Intermittent IMAP “BYE Temporary problem, please try again later” messages (courier-imap)

February 14, 2009 - 4:09 pm 2 Comments

This problem has been bugging the life out of me ever since it appeared about a month ago.

Some background:  I have a VPS with EUKHost.com that I have all my sites on.  I have about 5 email accounts spread over my various domains on this VPS.  I prefer to use IMAP, and have MS Outlook open for most of the day with it doing an automatic send/receive every 10 minutes or so.  This worked great for 10 or 11 months.

As I said, a month ago this “BYE Temporary problem, please try again later” message kept appearing.  What made it even more annoying is that Outlook displays it in a foreground message window that disturbs any application you may be using at the time the error occurs.  Oh, and it also keeps the mail accounts “offline” until you do a manual send-receive.  E-X-T-R-E-M-E-L-Y annoying when this happens every few minutes.  I ended up closing Outlook for most of the day because it just bugged me so much.

EUKHost couldn’t fix it.  Various google searches I tried before didn’t help.  Today, I finally have some free time to sit down and finally figure this one out.

First, I had to confirm that it was a server problem and not a problem with my Outlook.  Because this is an intermittent problem, this was difficult to do and partly the reason why it took me 4 weeks to do something about it.  After some research, I found out how to debug courier authentication errors.  I wasn’t 100% sure this was where my problem lay, but as I had nothing else to go on, I decided to give it a try.

How to debug courier authentication errors:

  1. Edit authdaemonrc (I found mine at /etc/authlib/authdaemonrc)
  2. Set DEBUG_LOGIN=1
  3. Restart authdaemond:
    # authdaemond stop
    # authdaemond start
  4. At this point, all debugging output goes to syslog at level ‘debug’, which is normally not shown. You will probably need to change your /etc/syslog.conf file to be able to see these messages.  Add this line to the end of /etc/syslog.conf:
    *.debug /var/log/debug
  5. Create the log file and restart syslog:
    # touch /var/log/debug
    # killall -1 syslogd
  6. Keep an eye on the log file:
    # tail -f /var/log/debug

OK, so now we’re debugging authentication errors.  I opened Outlook and just continued doing whatever I normally do until the error message appeared.  It wasn’t more than 5 minutes before it appeared.  In the log file I saw this:

...
Feb 14 15:57:34 vps authdaemond: authpipe: TEMPFAIL - no more modules will be tried
...
Feb 14 15:57:34 vps imapd: LOGIN FAILED, user=paul+fuc.it, ip=[::ffff:222.144.254.98]
Feb 14 15:57:34 vps imapd: authentication error: Input/output error

This confirmed that it was indeed an authentication problem.  The input/output error confused me for a while – was it a hardware problem?  After researching more, I found this useful bit of text within the authdaemonrc.dist file (yes, the configuration file I was editing before didn’t have any comments…)

##NAME: daemons:0
#
# The number of daemon processes that are started. authdaemon is typically
# installed where authentication modules are relatively expensive: such
# as authldap, or authmysql, so it's better to have a number of them running.
# PLEASE NOTE: Some platforms may experience a problem if there's more than
# one daemon. Specifically, SystemV derived platforms that use TLI with
# socket emulation. I'm suspicious of TLI's ability to handle multiple
# processes accepting connections on the same filesystem domain socket.
#
# You may need to increase daemons if as your system load increases. Symptoms
#
include sporadic authentication failures. If you start getting
# authentication failures, increase daemons.
However, the default of 5
#
SHOULD be sufficient. Bumping up daemon count is only a short-term
# solution. The permanent solution is to add more resources: RAM, faster
# disks, faster CPUs...

I underlined the important bits.  Sporadic authentication failures?  Check.  Default of 5?  Uhm…. mine’s set at 2.  So, I upped it to 5, restarted authdaemond and waited for Outlook.  It’s been going for a few hours now and no errors.  I hope this resolves it finally.  I also hope that this helps someone else and prevents someone from getting as fed up with it as I did.  Leave a comment if it helped you!

How to fix: locate: can not open `/var/lib/mlocate/mlocate.db’: No such file or directory

February 14, 2009 - 2:29 pm 6 Comments

In the first of my “How to fix” posts where I detail how I fix various issues I run into, this is a simple one:

[root@vps etc]# locate courier
locate: can not open `/var/lib/mlocate/mlocate.db': No such file or directory

OK, so the mlocate.db file doesn’t exist, marvellous.  How do we either find it or create it?
Answer: simply run updatedb

[root@vps etc]# updatedb

Now we can do our search:

[root@vps etc]# locate courier
/etc/profile.d/courier-imap.csh
/etc/profile.d/courier-imap.sh
/etc/rc.d/init.d/courier-authlib
/etc/rc.d/init.d/courier-imap
/etc/rc.d/rc0.d/K30courier-imap
/etc/rc.d/rc0.d/K85courier-authlib
/etc/rc.d/rc1.d/K30courier-imap
...