Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException while apparently fetching inbox categories #6

Open
Zeklandia opened this issue Mar 27, 2018 · 3 comments
Open

Comments

@Zeklandia
Copy link

My mail-importer runs are now stuck on one specific piece of mail which causes the following output:

For <1255033550.1235275168730.JavaMail.SYSTEM@rc-v3conta015> got:
  message id: 11f9c233866addb7

{MEDIA_COMPLETE] Progress: 100
  "id" : "11f010d1316a5c12"
}

{MEDIA_COMPLETE] Progress: 100
  "id" : "11f010f2a3c7984d"
}

{MEDIA_COMPLETE] Progress: 100
  "id" : "11f010f2a1b7b7a7"
}

{MEDIA_COMPLETE] Progress: 100
  "id" : "11f010f2f228602d"
}

{MEDIA_COMPLETE] Progress: 100
  "id" : "11f5e544cf682d10"
}

{MEDIA_COMPLETE] Progress: 100
  "id" : "11f5eb6cfbe92765"
}
For message 11eff470d2933775, got labels: CATEGORY_PERSONAL
For message 11f9c233866addb7, got labels: IMPORTANT, CATEGORY_UPDATES
For message 162658c42c8b8c96, got labels: CATEGORY_UPDATES
For message 11f5eb75579e0d41, got labels: CATEGORY_PERSONAL
For message 11f15c83b419501a, got labels: CATEGORY_UPDATES
For message 162658bc7737bec4, got labels: CATEGORY_UPDATES
For message 162658de11dfd901, got labels: CATEGORY_UPDATES
For message 11d8aaa4d9548aa7, got labels: CATEGORY_UPDATES
For message 11ea8a506f749639, got labels: CATEGORY_UPDATES
For message 11f15c188984fea7, got labels: CATEGORY_UPDATES
For message 1174a843540f3c2b, got labels: CATEGORY_PERSONAL
For message 11f5e71c01c485af, got labels: CATEGORY_UPDATES
For message 162658ba3c441702, got labels: CATEGORY_UPDATES
For message 116a80ac6c7040d7, got labels: CATEGORY_PERSONAL
For message 162658c28350473d, got labels: CATEGORY_UPDATES
For message 11f01f6fd33822ea, got labels: IMPORTANT, CATEGORY_UPDATES
For message 162658c5230d63cf, got labels: CATEGORY_UPDATES
For message 11f32d0ec4dd5149, got labels: IMPORTANT, CATEGORY_PERSONAL
For message 11eae5dd6a5e976b, got labels: CATEGORY_UPDATES
For message 162658bcfe0b102e, got labels: CATEGORY_UPDATES
For message 116683f48143041a, got labels: CATEGORY_UPDATES
For message 162658b85b5176f2, got labels: CATEGORY_UPDATES
For message 11f5eb6d64922a4e, got labels: CATEGORY_UPDATES
For message 11f50eeb8da70c9a, got labels: CATEGORY_PERSONAL
For message 11f006ef64257dbf, got labels: CATEGORY_UPDATES
For message 11eff470d35a2e1b, got labels: CATEGORY_PERSONAL
For message 116afb91a764d6b1, got labels: IMPORTANT, CATEGORY_UPDATES
For message 162658baf66f9115, got labels: CATEGORY_UPDATES
For message 11ea51fe6e9895db, got labels: CATEGORY_UPDATES
For message 116cc34c394ada9c, got labels: CATEGORY_PERSONAL
For message 162658bb6891fd85, got labels: CATEGORY_UPDATES
For message 162658624717564b, got labels: CATEGORY_UPDATES
For message 162658b895e56e4f, got labels: CATEGORY_UPDATES
For message 162658decb5ab72a, got labels: CATEGORY_UPDATES
For message 116bb5bafdb405a8, got labels: CATEGORY_UPDATES
For message 11f010f2a3c7984d, got labels: CATEGORY_UPDATES
For message 11f5e544cf682d10, got labels: CATEGORY_UPDATES
For message 11f25f2204d9ab04, got labels: CATEGORY_UPDATES
For message 1173739d3e63783b, got labels: CATEGORY_PERSONAL
For message 116a46bb7b9aeb9f, got labels: CATEGORY_UPDATES
For message 11f33540edb1e109, got labels: CATEGORY_PERSONAL
For message 116a63c60e4183da, got labels: CATEGORY_PERSONAL
For message 11ea5206610cede3, got labels: CATEGORY_UPDATES
For message 11f5eb6cfbe92765, got labels: CATEGORY_UPDATES
For message 162658dd3fb94e6f, got labels: CATEGORY_UPDATES
For message 16265865063f5cbf, got labels: CATEGORY_UPDATES
For message 116666340f80c6d4, got labels: CATEGORY_UPDATES
For message 116bb5c236cf11e6, got labels: CATEGORY_UPDATES
For message 116bdea4c92634a7, got labels: CATEGORY_UPDATES
For message 11f5164d759ffe81, got labels: CATEGORY_PERSONAL
For message 11f9bbff279449d3, got labels: CATEGORY_PERSONAL
For message 1626585cf73ae673, got labels: CATEGORY_UPDATES
For message 11d93d23beffc53e, got labels: CATEGORY_PERSONAL
For message 162658b944115e92, got labels: CATEGORY_UPDATES
For message 11f010f2a1b7b7a7, got labels: CATEGORY_UPDATES
For message 1173bdd276aad775, got labels: IMPORTANT, CATEGORY_UPDATES
For message 1626585a09f1e1ee, got labels: CATEGORY_UPDATES
For message 116a86d943a728b1, got labels: CATEGORY_PERSONAL
For message 116ced31a39a28b2, got labels: CATEGORY_PERSONAL
For message 11d93ae186ab465c, got labels: CATEGORY_PERSONAL
For message 1173791c7b0b524f, got labels: CATEGORY_PERSONAL
For message 116afbbec08e1de9, got labels: CATEGORY_UPDATES
For message 1626585b89dcc1dc, got labels: CATEGORY_UPDATES
For message 11f61129bdbdf954, got labels: CATEGORY_UPDATES
For message 11f5eb6a9d88ba60, got labels: CATEGORY_UPDATES
For message 11f96f4694e719fc, got labels: IMPORTANT, CATEGORY_UPDATES
For message 11f010d1316a5c12, got labels: CATEGORY_UPDATES
For message 162658be8eb58592, got labels: CATEGORY_UPDATES
For message 11eae42a1f93d6fc, got labels: CATEGORY_UPDATES
For message 162658c305680dd9, got labels: CATEGORY_UPDATES
For message 11eff470ce29a3b3, got labels: CATEGORY_PERSONAL
For message 1626585beb912e12, got labels: CATEGORY_UPDATES
For message 11e6a897ccafb741, got labels: CATEGORY_UPDATES
For message 11f04ba10f74dfb2, got labels: CATEGORY_PERSONAL
For message 11d8c334ff5a3f48, got labels: IMPORTANT, CATEGORY_UPDATES
For message 162658bdab673eeb, got labels: CATEGORY_UPDATES
For message 162658b619aade87, got labels: CATEGORY_UPDATES
For message 162658c088c27044, got labels: CATEGORY_UPDATES
For message 11e8902fcfb1f008, got labels: CATEGORY_UPDATES
For message 1626586cc35c51aa, got labels: CATEGORY_UPDATES
For message 116f20d9f3fbe234, got labels: CATEGORY_UPDATES
For message 11effd48aa9be645, got labels: CATEGORY_PERSONAL
For message 11f1eda07977428b, got labels: CATEGORY_UPDATES
For message 11f010f2f228602d, got labels: CATEGORY_UPDATES
For message 1626585f71a6f89a, got labels: CATEGORY_UPDATES
For message 11f03cef390405ca, got labels: IMPORTANT, CATEGORY_PERSONAL
For message 162658b798d600c2, got labels: CATEGORY_UPDATES
For message 11f18cc301b3fa69, got labels: CATEGORY_PERSONAL
For message 162658618f14d387, got labels: CATEGORY_UPDATES
For message 162658c1ca9ea89c, got labels: CATEGORY_UPDATES
For message 1626586401d46859, got labels: CATEGORY_UPDATES
For message 11f3f51a04cfde77, got labels: CATEGORY_UPDATES
For message 11d9248fdb8c63bd, got labels: CATEGORY_PERSONAL
For message 162658b9ad9c5c93, got labels: CATEGORY_UPDATES
For message 116ae9a67499498d, got labels: CATEGORY_UPDATES
For message 11f5e8be6ecafaf9, got labels: IMPORTANT, CATEGORY_UPDATES
For message 116c9b71547c0acb, got labels: CATEGORY_UPDATES
For message 1626585ac96c3706, got labels: CATEGORY_UPDATES
For message 116cf7ddb2163677, got labels: CATEGORY_UPDATES
For message 11f1fd98414f9a5c, got labels: CATEGORY_UPDATES
Exception in thread "main" java.lang.NullPointerException
        at to.lean.tools.gmail.importer.gmail.Mailbox.lambda$syncLocalLabelsToGmail$3(Mailbox.java:288)
        at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
        at java.util.HashMap$KeySpliterator.forEachRemaining(Unknown Source)
        at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
        at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source)
        at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
        at java.util.stream.ReferencePipeline.collect(Unknown Source)
        at to.lean.tools.gmail.importer.gmail.Mailbox.syncLocalLabelsToGmail(Mailbox.java:289)
        at to.lean.tools.gmail.importer.gmail.GmailSyncer.sync(GmailSyncer.java:82)
        at to.lean.tools.gmail.importer.Importer.importMail(Importer.java:116)
        at to.lean.tools.gmail.importer.Importer.main(Importer.java:82)
@Zeklandia
Copy link
Author

Additionally, I had to set up a while loop to run mail importer because I'm trying to import tens of thousands of emails and it crashes after every 10 or so, but I unfortunately don't have that output because Windows doesn't store more than 9999 console lines even in 2018.

@iflan
Copy link
Member

iflan commented Mar 27, 2018

The failure is here:

        List<String> labelIdsToAdd = labelNamesToAdd.stream()
            .map(labelName -> labelsByName.get(labelName).getId())  // <-- NPE
            .collect(toList());

This means that labelsByName is probably missing labelName. Can you print labelNamesToAdd just before this line? It could be that something is malformed.

BTW, in my experience, most mailboxes have some mail that will just refuse to import. I manually edit the offending messages to get the import to work.

@Zeklandia
Copy link
Author

Here's what it says is the offending label name: [pop.aol-1.com\Archives\2008, UNREAD]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants