Gmail: Error fetching FLAGS

Posted on
Fri Aug 17, 2018 3:22 am
petematheson offline
Posts: 700
Joined: Sep 14, 2014
Location: Southampton, UK

Gmail: Error fetching FLAGS

Just setting up Better Email again and running into a few issues.

I have a single gmail account added, with IDLE enabled in Better Email.
It's yet to work properly - although sending test emails to the Indigo gmail account seems to trigger Indigo properly.

Yesterday all of the emails were sat in the Inbox still, after a reload of Better Email and a 'Check for new messages' then most of the messages disappeared, but still a number have been left.
Indigo shows this in the log:

Code: Select all
   Better Email Debug              Gmail: Received Message ID: <5b75ad861ae44_5b651997476117@instant.resque.ife.mail>
   Better Email Threaddebug        GmailcheckMsgs: Decoding multipart message
   Better Email Threaddebug           found type: multipart/alternative
   Better Email Threaddebug           found type: text/plain
   Better Email Threaddebug        checkMsgs: Updating states on server: [{'value': 'xxxxx@gmail.com', 'key': 'messageFrom'}, {'value': 'xxxxx@gmail.com', 'key': 'messageTo'}, {'value': 'House is Occupied', 'key': 'messageSubject'}, {'value': 'Thu, 16 Aug 2018 16:59:50 +0000', 'key': 'messageDate'}, {'value': u'Someone has entered the house\r\n', 'key': 'messageText'}, {'value': '<5b75ad861ae44_5b651997476117@instant.resque.ife.mail>', 'key': 'lastMessage'}]
   Better Email Debug              triggerCheck: Checking Triggers for Device Gmail (544905975)
   Better Email Debug                 Checking Trigger Erica Life360 Status - Away Better Email (9514783), stringMatch
   Better Email Debug                    Checking Device State messageSubject for string: Erica left Home
   Better Email Debug                    No Match for Trigger Erica Life360 Status - Away Better Email (9514783)
   Better Email Debug                 Checking Trigger Pete Life360 Status - Away Better Email (110649153), stringMatch
   Better Email Debug                    Checking Device State messageSubject for string: Pete left Home
   Better Email Debug                    No Match for Trigger Pete Life360 Status - Away Better Email (110649153)
   Better Email Debug                 Checking Trigger Pete Life360 Status - Home Better Email (983647615), stringMatch
   Better Email Debug                    Checking Device State messageSubject for string: Pete is Home
   Better Email Debug                    No Match for Trigger Pete Life360 Status - Home Better Email (983647615)
   Better Email Debug                 Checking Trigger Location - Life365 Home Better Email (988781995), stringMatch
   Better Email Debug                    Checking Device State messageSubject for string: House is Occupied
   Better Email Debug                    Executing Trigger Location - Life365 Home Better Email (988781995)
   Trigger                         Location - Life365 Home Better Email
   Pushover Debug                 
   Pushover Debug                  House is occupied
   Pushover Debug                 
   Pushover Debug                 
   Better Email Debug                 Checking Trigger Erica Life360 Status - Home Better Email (1029207339), stringMatch
   Better Email Debug                    Checking Device State messageSubject for string: Erica is Home
   Better Email Debug                    No Match for Trigger Erica Life360 Status - Home Better Email (1029207339)
   Better Email Debug                 Checking Trigger Pete 360 Status - Work Better Email (1582027824), stringMatch
   Better Email Debug                    Checking Device State messageSubject for string: Pete is at Work
   Better Email Debug                    No Match for Trigger Pete 360 Status - Work Better Email (1582027824)
   Better Email Debug                 Checking Trigger Location - Life360 Away Better Email (1701680297), stringMatch
   Better Email Debug                    Checking Device State messageSubject for string: House is empty
   Better Email Debug                    No Match for Trigger Location - Life360 Away Better Email (1701680297)
   Better Email Debug              Gmail: Deleting message # 9
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 10: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 11: argument of type 'NoneType' is not iterable
   Trigger                         Sonos - Start music when entering Kitchen
   Sonos                           ZonePlayer: Sonos Kitchen, Play
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 12: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 13: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 14: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 15: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 16: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 17: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Error              Gmail: Error fetching FLAGS for Message # 18: argument of type 'NoneType' is not iterable
   Better Email Debug              Gmail: IDLE Event Received
   Better Email Debug              Gmail: checkMsgs complete

Posted on
Fri Aug 17, 2018 3:24 am
petematheson offline
Posts: 700
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Gmail: Error fetching FLAGS

OK, and weirdly - if I keep doing 'Check for new messages' then the Inbox eventually clears down and emails get processed.
So it seems to hit a bad email and then stop processing anymore until it's manually told to check for new emails?

Posted on
Fri Aug 17, 2018 3:26 am
petematheson offline
Posts: 700
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Gmail: Error fetching FLAGS

Restarting the plugin gives me this FYI, and in Indigo it's showing the serverStatus as 'Failure'

Code: Select all
 
   Better Email                    Starting Better Email
   Better Email Threaddebug        Gmail: Device Version is up to date
   Better Email Debug              Gmail: Starting device (imapAccount)
   Better Email Debug              Gmail: Creating IMAP Server
   Better Email Debug              Gmail: Using IMAP IDLE
   Better Email Debug              Gmail: Doing connect using encryptionType = SSL
   Better Email Debug              Gmail: Doing login()
   Better Email Debug              Gmail: Doing select("INBOX")
   Better Email Threaddebug        Gmail: Mailbox list:
   Better Email Threaddebug        Gmail:    Mailbox: (\HasNoChildren) "/" "INBOX"
   Better Email Threaddebug        Gmail:    Mailbox: (\HasChildren \Noselect) "/" "[Gmail]"
   Better Email Threaddebug        Gmail:    Mailbox: (\All \HasNoChildren) "/" "[Gmail]/All Mail"
   Better Email Threaddebug        Gmail:    Mailbox: (\HasNoChildren \Trash) "/" "[Gmail]/Bin"
   Better Email Threaddebug        Gmail:    Mailbox: (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
   Better Email Threaddebug        Gmail:    Mailbox: (\HasNoChildren \Important) "/" "[Gmail]/Important"
   Better Email Threaddebug        Gmail:    Mailbox: (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
   Better Email Threaddebug        Gmail:    Mailbox: (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
   Better Email Threaddebug        Gmail:    Mailbox: (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
   Better Email Debug              Gmail: idleIMAPThread() called
   Better Email Debug              Adding Trigger Erica Life360 Status - Away Better Email (9514783)
   Better Email Debug              Adding Trigger Erica Life360 Status - Home Better Email (1029207339)
   Better Email Debug              Adding Trigger Location - Life360 Away Better Email (1701680297)
   Better Email Debug              Adding Trigger Location - Life365 Home Better Email (988781995)
   Better Email Debug              Adding Trigger Pete 360 Status - Work Better Email (1582027824)
   Better Email Debug              Adding Trigger Pete Life360 Status - Away Better Email (110649153)
   Better Email Debug              Adding Trigger Pete Life360 Status - Home Better Email (983647615)

Posted on
Fri Aug 17, 2018 7:00 am
FlyingDiver offline
Posts: 2399
Joined: Jun 07, 2014
Location: Cape Coral, FL

Re: Gmail: Error fetching FLAGS

Please confirm which version of the plugin you're using.

How many emails were in the INBOX when you started? How many are normally there? Do you have the plugin set to delete processed emails? Or move them?

When you got the error on messages 10-18, did you look at those messages using a real email client? Were there actual messages to be processed? It looks to me like the Gmail server was giving bad data at that point.

Was this a brand new install of the plugin, or was this previously working? What changed since it last worked properly.

Oh, and don't focus on the server status. There's still some places in the code where it doesn't get updated properly. More important is if it's actually processing emails and executing triggers properly.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Aug 17, 2018 7:58 am
petematheson offline
Posts: 700
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Gmail: Error fetching FLAGS

Version 7.2.3
Zero in the inbox (I manually cleared it out)
There is normally nothing in it, as every email should be processed and then deleted by Indigo / Better Email Plugin. (I've switched off the Indigo email now).

Yes there were emails to be processed.

I installed an old version of Better email around a year ago or so but had issues and lack of time so switched back to Indigo. I've just upgraded to the latest version and started using the plugin and came up with these issues - so never previously working.

At the moment I just have a few IFTTT rules set up to track my Life360 location, which then pings an email to Gmail to say 'Pete is Home' or 'Pete has Left home' etc.. so there's not a complicated HTML email to be processed or anything.

Posted on
Fri Aug 17, 2018 7:59 am
petematheson offline
Posts: 700
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Gmail: Error fetching FLAGS

Interestingly, I've enabled the option to process all emails each time and it seems to be behaving itself so far... is there any reason why you would want to switch this off? Since my inbox should be kept to 0 emails.

Posted on
Fri Aug 17, 2018 8:04 am
FlyingDiver offline
Posts: 2399
Joined: Jun 07, 2014
Location: Cape Coral, FL

Re: Gmail: Error fetching FLAGS

My gut is telling me this is some sort of Gmail server hiccup. I think the error is caused by Gmail returning Null for the fetch flags command. Maybe that's something Gmail does a lot, I don't know. I don't use Gmail much at all, and not at all for the plugin. Gmail has a lot of quirks in it's IMAP implementation.

You can certainly use the process all checkbox. What that does is skip looking for the flag the plugin sets for each email as it's processed, if it's not deleted. Prevents processing the same email multiple times.

I'm adding some code to the plugin to deal with the null flags issue. No one has ever reported this before, so I'm at a loss why it would start now.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Aug 17, 2018 1:52 pm
petematheson offline
Posts: 700
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Gmail: Error fetching FLAGS

Well all day today it's behaved since enabling the 'check all emails' box.

Happy to help troubleshoot if need be but for now it seems fixed :)

Posted on
Fri Aug 17, 2018 1:53 pm
FlyingDiver offline
Posts: 2399
Joined: Jun 07, 2014
Location: Cape Coral, FL

Re: Gmail: Error fetching FLAGS

petematheson wrote:
Well all day today it's behaved since enabling the 'check all emails' box.

Happy to help troubleshoot if need be but for now it seems fixed :)


It's not fixed, you're just not seeing it because you're no longer checking the flags. :)

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 0 guests