cozy / cozy-emails

Email Client for Cozy
GNU Affero General Public License v3.0
66 stars 41 forks source link

Error in refreshFast #583

Open ZeHiro opened 9 years ago

ZeHiro commented 9 years ago

Hi,

I constantly have this error in logs :

WARN +0000 models:mailbox 1308 + 0 < 1321 on INBOX
WARN +0008 models:mailbox refreshFast fail (Error:     WRONG STATE
    at Mailbox._refreshDeleted (/usr/local/cozy/apps/emails/build/server/models/mailbox.js:549:23)
    at /usr/local/cozy/apps/emails/build/server/models/mailbox.js:439:20
    at /usr/local/cozy/apps/emails/build/server/models/mailbox.js:528:18
    at /usr/local/cozy/apps/emails/node_modules/async/lib/async.js:157:25
    at /usr/local/cozy/apps/emails/build/server/utils/socket_handler.js:111:14
    at /usr/local/cozy/apps/emails/node_modules/cozydb/lib/model.js:34:14
    at /usr/local/cozy/apps/emails/node_modules/cozydb/lib/cozymodel.js:112:18
    at parseBody (/usr/local/cozy/apps/emails/node_modules/cozydb/node_modules/request-json-light/main.js:74:10)
    at IncomingMessage.<anonymous> (/usr/local/cozy/apps/emails/node_modules/cozydb/node_modules/request-json-light/main.js:99:14)

It seems the deep refresh does not work:

INFO +0000 models:mailbox IMAP REFRESH INBOX UID 121536:122535
EROR +30013 models:account patch conv fail { [Error: socket hang up] code: 'ECONNRESET' }

Imap provider is Free.fr

clochix commented 9 years ago

@aenario will correct me if I'm wrong.

The second error means the distant server has close the connection, so we need to re-open it. This will make the refresh take more time, but isn't really an error, we handle this case.

The first message is a symptom of a problem in our “clever” sync algorithm. It's mostly a warning, as we also handle this case, and it shouldn't lead to real errors in sync.

ZeHiro commented 9 years ago

@clochix The email apps just constantly loop over these two errors (no evolution in the number of emails), so I think there is a "desync" between the client and Imap, which is never resolved, and the "force sync" does not work.