nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.8k stars 1.39k forks source link

"Syncing your mailbox" doesn't retrieve any emails after letting the app sync all night -- IMAP /always/ times out #3232

Open ck-jrd opened 7 years ago

ck-jrd commented 7 years ago
Are there any related issues?

I initially wrote about this problem at https://github.com/nylas/N1/issues/3179#issuecomment-275509034. but #3198 could be related?

What operating system are you using?

macOS 10.12

What version of N1 are you using?

1.0.15

--

Bug?

Do you have any third-party plugins installed? If so, which ones?

None

Is the issue related to a specific email provider (Gmail, Exchange, etc.)?

Only tested Gmail.

--

Since originally getting my Gmail account added, I let Nylas run overnight so it could sync all my messages. However, after 16 hours, no emails have been synced. My All Mail tab gives me 'No Messages', and I still get a 'Syncing to your mailbox...' notice.

nylas-sync

Running Nylas Mail in dev mode doesn't rise any errors or flags.

TwisterMc commented 7 years ago

My inbox has been syncing for a few minutes now and I've yet to see one message. I know it's early, but I'd expect to see at least one message come through.

Labels appeared, but no email.

jstejada commented 7 years ago

hey folks, in order to diagnose this, could you do the following:

  1. Open the Activity Window via cmd+alt+i

  2. In the Activity Window, open Dev Tools via cmd+alt+w

  3. Select the Console tab

  4. Send me a screenshot of your Console as it is

  5. Then select the Filter icon image

  6. Then Filter by Errors

    screen shot 2017-01-27 at 9 53 41 am
  7. Send me a screenshot of your Console filtered by errors

If you prefer not to share the screenshots here, feel free to send them to support@nylas.com and mention Juan

Thanks!

yannick-mamudo commented 7 years ago

@jstejada ran with and without debug flags.. there are no errors being reported but i also only see 3 requests instead of 4

jstejada commented 7 years ago

@yannick-mamudo do you see anything in the Console at all?

yannick-mamudo commented 7 years ago

screen shot 2017-01-27 at 12 34 45 nothing that looks suspicious to me

ck-jrd commented 7 years ago

My Nylas inspector looks the exact same as @yannick-mamudo's.

My Activity console (unfiltered): nylas-activity1

And filtered: nylas-activity2

jstejada commented 7 years ago

thanks!!

@yannick-mamudo , is that the Console in your Activity Window? Do you not see any other log's like in @v0wels Console?

yannick-mamudo commented 7 years ago

screen shot 2017-01-27 at 12 53 53 unfortunately no errors being reported

jweinstein commented 7 years ago

Stuck on sync on a specific month. CPU still going. No progress for hours. No errors.

EQuimper commented 7 years ago

+1

erraggy commented 7 years ago

I have my emails pulled in and displayed, but N1 is still stuck in a perpetual "Syncing your mailbox..." loop. I too do not see any errors in the console, but a tail of the log shows lines like the following spewing out every ~20 milliseconds:

{"host":"us163957","timestamp":"2017-01-28T18:32:37.030Z","payload":["ActionBridge: default Action Bridge Received: db-store-trigger"]}
{"host":"us163957","timestamp":"2017-01-28T18:32:37.297Z","payload":["ActionBridge: default Action Bridge Received: db-store-trigger"]}
{"host":"us163957","timestamp":"2017-01-28T18:32:37.416Z","payload":["ActionBridge: default Action Bridge Received: db-store-trigger"]}
{"host":"us163957","timestamp":"2017-01-28T18:32:37.433Z","payload":["ActionBridge: default Action Bridge Received: db-store-trigger"]}
{"host":"us163957","timestamp":"2017-01-28T18:32:37.446Z","payload":["ActionBridge: default Action Bridge Received: db-store-trigger"]}

I installed and setup N1 last night for 2 GApps accounts (one with Google login and the other with an enterprise login for my work) both accounts have been in the "Syncing your mailbox..." with each account showing both "All" & "Spam" as "In Progress".

In Mac's Activity Monitor, there are 2 separate "Nylas Mail Helper" processes that are each hovering (non-stop) at around 45% CPU.

Please let me know if there is anything else I can gather or look into.

erraggy commented 7 years ago

This may be the activity behind the log messages I posted above: image It is from the Delta Streaming filter in the Activity window.

averixus commented 7 years ago

I'm having this issue. Installed Nylas for the first time today and logged in with an outlook.com account. The folder names have appeared but no email has been synced at all (it's now been several hours, and I've tried adding, re-authorising, and removing the account more than once).

@jstejada There doesn't seem to be anything interesting in the console or activity log.

Full console:

screen shot 2017-01-28 at 19 15 18

Filtered:

screen shot 2017-01-28 at 19 15 30

Activity:

screen shot 2017-01-28 at 19 15 42
jweinstein commented 7 years ago

I have the problem live @grinich if useful to screen share. DM/email me.

jstejada commented 7 years ago

thanks for the info everyone! we're going to look into it.

@JayAvery that is the Console from the Activity Window right?

averixus commented 7 years ago

@jstejada oops. My keyboard shortcuts seem to be switched around so I got the wrong idea - those screenshots were the console of the main window.

Here is the console from the activity window. Unfiltered:

screen shot 2017-01-29 at 13 07 38

Filtered:

screen shot 2017-01-29 at 13 08 03
TwisterMc commented 7 years ago

Here's mine. I'm going to let it sit all day and we'll see what happens. I do have a lot of email.

nylas

jstejada commented 7 years ago

@TwisterMc can you open the Console in the Activity Window instead?

TwisterMc commented 7 years ago

oops. My bad. Sending an email with a new screenshot now.

jweinstein commented 7 years ago

At me if I can be any help, still same issue (stuck syncing on a specific month) after this morning's update.

jstejada commented 7 years ago

@jweinstein yes! can you chat via the Nylas Community or Atom slack?

jstejada commented 7 years ago

hey folks, are you seeing this exclusively with Gmail accounts?

averixus commented 7 years ago

@jstejada Mine is with an outlook.com account.

TwisterMc commented 7 years ago

@jstejada Gmail - Business account.

jstejada commented 7 years ago

Okay, thanks!

averixus commented 7 years ago

I'm now getting this error pop-up regularly. When I retry, sometimes the pop-up comes back immediately, sometimes it goes away for a while.

screen shot 2017-01-30 at 21 53 55

(I've had Nylas open for about two days, and exactly one email has synced so far.)

jstejada commented 7 years ago

hi @JayAvery, whenever you see that box again, can you click Contact Support and send us the error? Ping me whenever you do so. Are any messages syncing at all?

jstejada commented 7 years ago

Hi everyone, could you try the following:

For Gmail Accounts:

  1. In your Gmail Settings, make sure IMAP is enabled
  2. In your Gmail Settings, make sure that All Mail, Trash and Spam are "Visible on IMAP"
  3. Check that your firewall isn't imposing any restrictions connecting to the Gmail Server on port 993.
  4. Try the suggestion on this link: http://apple.stackexchange.com/questions/110570/how-to-analyze-resolve-gmail-timeouts-in-apple-mail
  5. If that doesn't work, try the suggestions on this link: https://productforums.google.com/forum/#!topic/apps/MvqLhYSu9wA

For Office365 Accounts:

  1. Check that your firewall isn't imposing any restrictions connecting to the Office365 server on port 993.
  2. Instead of adding your account via Office365, in the menu, select Nylas Mail -> Add Custom IMAP Account, and add your Office 365 account with the following settings: image

Let me know if any of these options work! cc @JayAvery @v0wels @TwisterMc @yannick-mamudo @jweinstein

erraggy commented 7 years ago

@jstejada,

Both of my accounts used in N1 are GApps accounts and I verified that access to Google's IMAP host(s) is perfectly fine.

I'm still having the pegged CPU for Nylas helpers, and the non-stop "In Progress" within "Syncing your mailbox" for both accounts.

I did happen to catch this logged to the Console of the Activity Window:

Warning: Failed prop type: Invalid prop `accountId` of type `string` supplied to `SyncbackRequestDetails`, expected `number`.
    in SyncbackRequestDetails (created by AccountCard)
    in AccountCard (created by Root)
    in div (created by Root)
    in div (created by Root)
    in Root
MessageProcessor: Could not build message Object
SequelizeDatabaseError: SQLITE_ERROR: unrecognized token: "'Your UPS Package was delivered"
    at Query.formatError (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sequelize/lib/dialects/sqlite/query.js:348:14)
    at afterExecute (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sequelize/lib/dialects/sqlite/query.js:112:29)
    at Statement.errBack (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sqlite3/lib/sqlite3.js:16:21) Object
MessageProcessor: Could not build message Object {err: e…r.DatabaseError, imapMessage: Object, desiredParts: Array[1]}
SequelizeDatabaseError: SQLITE_ERROR: unrecognized token: "'UPS Update: Package Scheduled for Delivery Today"
    at Query.formatError (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sequelize/lib/dialects/sqlite/query.js:348:14)
    at afterExecute (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sequelize/lib/dialects/sqlite/query.js:112:29)
    at Statement.errBack (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sqlite3/lib/sqlite3.js:16:21) Object {}
MessageProcessor: Could not build message Object {err: e…r.DatabaseError, imapMessage: Object, desiredParts: Array[1]}
SequelizeDatabaseError: SQLITE_ERROR: unrecognized token: "'UPS Update: Package Scheduled for Delivery Today"
    at Query.formatError (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sequelize/lib/dialects/sqlite/query.js:348:14)
    at afterExecute (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sequelize/lib/dialects/sqlite/query.js:112:29)
    at Statement.errBack (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/sqlite3/lib/sqlite3.js:16:21) Object {}

Is there anything else I can do to help?

jstejada commented 7 years ago

@erraggy thanks for the details!

it seems that we can't correctly parse some of your messages. so are you are not seeing any messages synced at all? Seeing the Syncing your mailbox... message for several hours is normal (cpu issues have been addressed in #3178)

erraggy commented 7 years ago

@jstejada YIKES! Just read that issue (#3178) and found this bit of info to be most helpful: image When I hover over the All label in the "Syncing your mailbox" section, I see that one of my accounts has 6 months left to go, while the other is a few years behind still. LOL

Looks like I'll need to just let the CPU spin for another day or so.

I highly recommend making this initial sync a separate tracked process for new users, so that they have clarity and visibility into what's going on.

Thank you for working with me to identify the cause.

jstejada commented 7 years ago

okay thanks @erraggy -- thanks for the feedback!

There are still some CPU improvements that are yet to be released. Regarding sync, unfortunately, for big mailboxes, initial sync will inevitably take a long time. It seems however, that you are not experiencing the issue described in this thread though, correct? Thanks!

erraggy commented 7 years ago

@jstejada,

Yeah, the CPU isn't pegged as much as it is working hard constantly to sync my many year emails. image

averixus commented 7 years ago

@jstejada I seem to be getting a 502 error when I click the Contact Support link! :S I put the HTML in the link through a translator and this is the error message it was trying to send:

{
  "message": "Error: User is authenticated but not connected.",
  "source": "protocol",
  "stack": "Error: Error: User is authenticated but not connected.
    at NylasError (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/src/errors.js:2:1)
    at IMAPProtocolError (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/src/imap-errors.js:15:1)
    at convertImapError (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/src/imap-errors.js:92:15)
    at Connection._imap.once.err (imap-connection.es6:176:16)
    at Connection.g (events.js:286:16)
    at emitOne (events.js:96:13)
    at Connection.emit (events.js:188:7)
    at Connection.reentry (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/node_modules/imap/lib/Connection.js:1605:12)
    at Connection._resTagged (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/node_modules/imap/lib/Connection.js:1530:22)
    at Parser.<anonymous> (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/node_modules/imap/lib/Connection.js:193:10)
    at emitOne (events.js:96:13)
    at Parser.emit (events.js:188:7)
    at Parser._resTagged (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/node_modules/imap/lib/Parser.js:175:10)
    at Parser._parse (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/node_modules/imap/lib/Parser.js:139:16)
    at Parser._tryread (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/node_modules/imap/lib/Parser.js:82:15)
    at TLSSocket.Parser._cbReadable (/Applications/Nylas Mail.app/Contents/Resources/app.asar/internal_packages/local-sync/node_modules/isomorphic-core/node_modules/imap/lib/Parser.js:53:12)
    at emitNone (events.js:86:13)
    at TLSSocket.emit (events.js:185:7)
    at emitReadable_ (_stream_readable.js:432:10)
    at emitReadable (_stream_readable.js:426:7)
    at readableAddChunk (_stream_readable.js:187:13)
    at TLSWrap.onread (net.js:543:20)
    at Socket.ondata (_stream_wrap.js:58:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at TCP.onread (net.js:543:20)"
}

I've now just tried removing my account and re-adding it as custom IMAP. Zero emails synced so far although it's only been a few minutes - I will update again later.

jstejada commented 7 years ago

thanks @JayAvery

jstejada commented 7 years ago

@JayAvery it seems that your specific issue with Office365 is being caused by some flakiness and bad error messaging from the Office365 IMAP server (see https://github.com/mscdex/node-imap/issues/523 for details)

we'll add some better handling for this type of error, which we will track in #3245 however, I don't think that fixing that error wont necessarily fix the fact that almost no email is syncing because of imap timeouts.

Did adding it as a custom imap account change anything for you? are you seeing any messages synced?

jstejada commented 7 years ago

for folks using gmail, did any of the suggestions in https://github.com/nylas/nylas-mail/issues/3232#issuecomment-276205618 work for you?

averixus commented 7 years ago

@jstejada After adding it as a custom IMAP account, I left it running overnight and I now have a total of three emails synced.

TwisterMc commented 7 years ago

For #3232 (comment) if there was an issue, wouldn't that effect other email apps as well? Like Mail.app, or Airmail? Those all work just fine. And it it use to work fine in Nylas back when it was originally free.

kobitate commented 7 years ago

@jstejada I tried the suggestions in the comment and they did not work. As @TwisterMc said, other clients are working for me as well. I'm in the same boat as him – used Nylas N1 when it was free and haven't made any account changes since then.

ck-jrd commented 7 years ago

Same boat as @TwisterMc and @TheRealGitCub. Could it have anything to do with the fact that we all used N1 in the past before Nylas Mail was released? Just spitballing.

averixus commented 7 years ago

@v0wels that wouldn't explain my situation - I installed Nylas for the first time ever a few days ago and my emails haven't synced properly since.

jstejada commented 7 years ago

okay thanks everyone, I'll keep investigating and report back!

joshuatalb commented 7 years ago

I upgraded to 1.0.18 about 20 minutes ago, added my custom IMAP account and left it to sync but nada. Still no luck fixing this issue unfortunately 😢

dougfarnes commented 7 years ago

@jstejada Thanks much! Enabling "All Mail" for IMAP in Gmail seems to have solved this for me. Maybe add a note in Nylas Mail documentation, since enabling All Mail is not the way most other email clients work. Many clients ask that you turn off All Mail in Google's IMAP settings to avoid duplicate messages in your desktop client.

jstejada commented 7 years ago

hey all! we've identified the problem and it seems that for /most/ of you, the issue is that imap connections keep timing out (which was also causing auth issues). We will release a fix for this soon. Thanks for your patience!

jweinstein commented 7 years ago

Post new update, processed 3 more years then got stuck again. Here is the error in console if helpful.

image

averixus commented 7 years ago

Synced a single email after updating today (that makes four in total), but nothing more. Same old errors in the activity console: untitled

amicablewings commented 7 years ago

I have the same issue. It timesout for IMAPConnection (Socket timed Out)

Any fixes?

ck-jrd commented 7 years ago

Same issues as above in 1.0.21.