#606 new
Patrick

Problem with mailmate running for a period of time causes an unavailable status.

Reported by Patrick | January 23rd, 2014 @ 06:17 PM

like the title says, the program loses connection with the imap account and will not reopen it. under sources it says (unavailable)

from the failed state:

s11 logout:

Clearing connection to imap.gmail.com
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 993
Error: Error while waiting on read or write.
Error: Failed while trying to connect to “imap.gmail.com”.
Clearing connection to imap.gmail.com
Trying to connect to imap.gmail.com on port 143
Error: Error while waiting on read or write.
Error: Failed while trying to connect to “imap.gmail.com”.
repeated ~6 times

D104 capability and D0 capability are blank

Comments and changes to this ticket

  • Patrick

    Patrick January 23rd, 2014 @ 06:20 PM

    also just telneting to port 993 of imap.gmail.com brings up a correct response so the path is reachable.

  • benny

    benny January 24th, 2014 @ 12:25 PM

    Could you hold down ⌥ when clicking “Check Now” in the Software Update preferences pane to fetch the latest test version (r3962). It outputs a little bit more in the errors you describe. I would like to see that.

  • Patrick

    Patrick January 25th, 2014 @ 08:13 PM

    unfortunately I did update and had the same problem and it gave me the same outputs.

    is there a log file anywhere that I can enable or view the contents of?

    I thought I left the activity viewer open to get the results but it was not to be found.

    there is a C7 logout that just says

    S: <<< terminated reading >>>
    

    D79 logout

    Clearing connection to imap.gmail.com
    Clearing connection to imap.gmail.com
    Trying to connect to imap.gmail.com on port 993
    Error: Error while waiting on read or write.
    Error: Failed while trying to connect to “imap.gmail.com”.
    Clearing connection to imap.gmail.com
    Trying to connect to imap.gmail.com on port 143
    Error: Error while waiting on read or write.
    Error: Failed while trying to connect to “imap.gmail.com”.
    
  • Patrick

    Patrick January 25th, 2014 @ 08:18 PM

    also, I do not sleep my mac, so this is unrelated to any sleep/wake cycles

  • Patrick

    Patrick January 25th, 2014 @ 08:20 PM

    this is the only relevant entry in the console

  • benny

    benny January 28th, 2014 @ 10:24 AM

    The output above does not include what I added for r3962. Are you sure you were running this version of MailMate:

    This:

    Error: Error while waiting on read or write.
    

    Should have been something like:

    Error: Error while waiting on read or write (<some system error message>).
    

    You can use the About window in MailMate to see the revision of MailMate you are running.

    Thanks in advance.

  • Patrick

    Patrick January 30th, 2014 @ 06:30 PM

    You were correct that I wasn't running the latest... I had done the option+update thing not too long before submitting the issue but I guess something didn't work or you issued a new release.

    so onto the "new" bug... now it does not say offline; it just has the activity indicator spinning and no new emails being downloaded.

    Pressing synchronize does nothing in the activity viewer.

    Taking the account offline and then pressing synchronize shows up as "trying to terminate connection..." in the activity viewer. Nothing happens after that for at least 5 min.

    taking all accounts offline and then taking just one online does nothing. synchronize has no effect.

    Version 1.7.2 (3962)

  • benny

    benny January 30th, 2014 @ 08:56 PM

    It never works now or is this the behavior you see after a while?

    Could you restart MailMate, open the Activity Viewer as quickly as possible and then provide the log of one of these hanging connections?

  • Patrick

    Patrick January 31st, 2014 @ 05:23 PM

    It works after a restart. doesn't work after a long time running.(well, anywhere from 1hour to 8hours)

    I actually left it on overnight and they all went to the unavailable status. this is the activity log that I get now when I try to synchronize:

    Clearing connection to imap.gmail.com
    Clearing connection to imap.gmail.com
    Trying to connect to imap.gmail.com on port 993
    Error: Unknown error while waiting on read or write.
    Error: Failed while trying to connect to “imap.gmail.com”.
    Clearing connection to imap.gmail.com
    Trying to connect to imap.gmail.com on port 143
    Error: Unknown error while waiting on read or write.
    Error: Failed while trying to connect to “imap.gmail.com”.
    

    I am running OS X 10.9 build 13A603

    Attached is a connection log like you asked for. Edit: but it works for a while before after restarting so I am not sure how helpful this will be.

  • benny

    benny February 3rd, 2014 @ 12:17 PM

    Yes, it was the log when it failed to work I was interested in.

    I'm going to ask you to fetch another test version (r3990). I'd like to see output like what you provided above when it fails again. There is a small addition of an error number which I had forgotten to output in the previous test version.

    I also did some other changes and there is a small chance that one of these changes fixed the problem.

  • Maciej

    Maciej February 4th, 2014 @ 11:17 AM

    Clearing connection to mail.messagingengine.com
    Clearing connection to mail.messagingengine.com
    Trying to connect to mail.messagingengine.com on port 993
    Error: Unknown error while waiting on read or write (-1).
    Error: Failed while trying to connect to “mail.messagingengine.com”.
    

    The app is unusable right now since i have to periodically check if it is still connected :(

  • benny

    benny February 4th, 2014 @ 11:32 AM

    @Maciej: I'm sorry to hear that. I'll do what I can to resolve this. Unfortunately I made (yet another) error in the error output. I've fixed that and you can fetch a new test version (r3994). Please try that and provide the output again when it fails. Thanks in advance!

  • Patrick

    Patrick February 4th, 2014 @ 06:34 PM

    So I let it run all night and it eventually errored out as unavailable. The activity logs are attached. I will download the latest version and try it again.

    What do the s66 d0 and d50 signify?

    edit: this is build 3990

  • benny

    benny February 4th, 2014 @ 08:34 PM

    Thanks Patrick, I need it from r3994.

    IMAP requires each command to be prefixed by a so-called tag (not a MailMate tag). This tag is then used when the server has finished replying to the command such that the email client can match commands with replies. MailMate creates tags based on the type of command used (that's the letter) and a simple increasing integer. It has no other meaning than that.

  • Maciej

    Maciej February 5th, 2014 @ 06:52 AM

    Clearing connection to mail.messagingengine.com
    Trying to connect to mail.messagingengine.com on port 993
    Error: Error while waiting on read or write (Invalid argument).
    Error: Failed while trying to connect to “mail.messagingengine.com”.
    
  • benny

    benny February 5th, 2014 @ 08:52 AM

    @Maciej: Thanks for your patience. I'm ready for another round with r4001. I've tried outputting a bit more about the “Invalid argument” and I've inserted some more sanity checks. One of them might even crash MailMate, but that'll just mean I'm getting closer to the heart of the problem :-)

    @Patrick: If you send me output then it should also be from r4001.

  • Maciej

    Maciej February 6th, 2014 @ 12:12 AM

    Clearing connection to mail.messagingengine.com
    Clearing connection to mail.messagingengine.com
    Trying to connect to mail.messagingengine.com on port 993
    Error: Error while waiting on read or write (Invalid argument).
      descriptor: 124, break_read_pipe: 116, ndfs: 124, wait_on_read: 0, wait_on_write: 1, timeout: 125829120
    
    Error: Failed while trying to connect to “mail.messagingengine.com” on socket 124.
    
  • Patrick

    Patrick February 6th, 2014 @ 06:36 AM

    I have the same error as Maciej...

    Clearing connection to imap.gmail.com
    Clearing connection to imap.gmail.com
    Trying to connect to imap.gmail.com on port 993
    Error: Error while waiting on read or write (Invalid argument).
      descriptor: 23, break_read_pipe: 54, ndfs: 54, wait_on_read: 0, wait_on_write: 1, timeout: 125829120
    
    Error: Failed while trying to connect to “imap.gmail.com” on socket 23.
    

    I also have the full logs if that helps, and the lsof output for the process while it's in it's failed state. let me know if you want those.

  • benny

    benny February 6th, 2014 @ 08:38 AM

    Perfect. The timeout value is completely off. Now I just need to figure out why :-) I'll get back to you, but I'm optimistic that this is a solvable problem.

  • benny

    benny February 6th, 2014 @ 10:30 AM

    You can download r4005 now. I haven't really tested the fix, but the fix was pretty trivial (that's probably hubris).

    Explanation: Every read/write action with a server involves a timeout value in order to detect when a connection has been lost. Some connections/servers are fast and some are slow. MailMate starts out with a small timeout value and if it times out then the next attempt is going to have a larger timeout value. It is actually doubled every time, but it should only happen a few times since it'll then become a permanent error reported to the user. The problem is that MailMate did not reset this timeout value correctly when starting a new action. Given enough time and the occasional timeout error (~20 times) then the timeout value would become so large that it triggered the error reported above. At the same time it could make MailMate hang a long time for a connection before realizing the connection had been lost. Stupid bug. I'm thankful that I had some patient users helping me to track this down.

    (Note that some users can run MailMate for weeks without ever seeing this problem and some users, apparently, only need a few hours. It depends on the internet connection and the server.)

  • Maciej

    Maciej February 7th, 2014 @ 03:11 PM

    Looks like it's working fine to me! Now I can honestly recommend it to my friends. Thanks!

  • Patrick

    Patrick February 7th, 2014 @ 03:30 PM

    Thanks for the thorough explanation Benny. I appreciate that.

    It would seem that the bug is fixed. I left it on overnight and it's still working.

  • benny

    benny February 8th, 2014 @ 08:34 AM

    • State changed from “new” to “fixcommitted”

    Great, I'll close the ticket. Let me know if the problem resurfaces.

    Thanks for your help! I'm very happy that this bug was found and fixed.

  • Stuart Ashdown

    Stuart Ashdown March 9th, 2014 @ 11:32 PM

    Hi

    I'm trialling your software and there's a lot to love about it. Unfortunately I also seem to be suffering from the same problem - periodically my gmail account goes offline and the only way to bring it back online is to either shutdown and restart mailmate or manually take the account offline, then online. I leave my macbook pro running all night and I do disable wifi for 5hrs in the middle of the night, so there is a chance that it's trying to connect but of course there is no connection.

    I'm running version 4059.

    Thanks in advance for your help

  • Patrick

    Patrick March 10th, 2014 @ 02:08 AM

    Hi Stuart... I just opened a new ticket that talks about this issue. I think it has to do with the ssl now and not the poor connections.

    it's ticket #651

    http://freron.lighthouseapp.com/projects/58672/tickets/651-problem-...

    I hope he can fix it because it's really troublesome... it works fine for an indeterminate time and then stops giving me new mail.

  • benny

    benny March 10th, 2014 @ 01:33 PM

    @Stuart: I can see you are now following #651. We'll deal with the issue in that ticket (and see if it is related to Patrick's issue).

  • benny

    benny October 15th, 2014 @ 03:32 PM

    • State changed from “fixcommitted” to “fixreleased”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Referenced by

Pages