jenkinsci / poll-mailbox-trigger-plugin

A Jenkins plugin, to poll an email inbox, and trigger jobs based on new emails.
https://plugins.jenkins.io/poll-mailbox-trigger-plugin/
MIT License
41 stars 32 forks source link

Poll Mailbox Trigger, polls but job is not started #53

Open VkyHive opened 5 years ago

VkyHive commented 5 years ago

Poll MailBox Trigger - Test connection shows success, but the jenkins job is not getting triggered.

Your checklist for this issue Jenkins version - Jenkins ver. 2.170

Plugin version - JavaMail version 1.5.0

OS - 10.14.3

Description Please describe your issue here.

Polling started on 10-Jun-2019 12:21:00 Polling for the job AndroidExecution Looking nodes where the poll can be run. Looking for a candidate node to run the poll. Looking for a node with no predefined label. Trying to poll with the last built on node.

Polling on master. Connecting to the mailbox... DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle]

DEBUG: mail.imap.fetchsize: 16384

DEBUG: mail.imap.statuscachetimeout: 1000

DEBUG: mail.imap.appendbuffersize: -1

DEBUG: mail.imap.minidletime: 10

DEBUG: trying to connect to host "imap.gmail.com", port 993, isSSL true

OK Gimap ready for requests from 195.89.75.189 j5mb23065923wrs A0 CAPABILITY

CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER AUTH=XOAUTH A0 OK Thats all she wrote! j5mb23065923wrs DEBUG IMAP: AUTH: XOAUTH2

DEBUG IMAP: AUTH: PLAIN

DEBUG IMAP: AUTH: PLAIN-CLIENTTOKEN

DEBUG IMAP: AUTH: OAUTHBEARER

DEBUG IMAP: AUTH: XOAUTH

DEBUG: protocolConnect login, host=imap.gmail.com, user=iosxhive@gmail.com, password=

A1 AUTHENTICATE PLAIN

AGlvc3hoaXZlQGdtYWlsLmNvbQBIaXZlMTIzNA==

CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584 A1 OK iosxhive@gmail.com authenticated (Success) A2 CAPABILITY

CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584 A2 OK Success [Poll Mailbox Trigger] - Connected! Found properties:

[attachments:IGNORE] [folder:INBOX] [host:imap.gmail.com] [mail.debug:true] [mail.debug.auth:true] [mail.imaps.host:imap.gmail.com] [mail.imaps.port:993] [password:***] [receivedXMinutesAgo:1440] [storeName:imaps] [subjectContains:jenkins >] [username:iosxhive@gmail.com] Connected to mailbox. Searching for messages where: [flag is unread] [subject contains 'jenkins >'] [received date is greater than '2019/06/09 12:21:02 PM'] ... Searching folder... DEBUG: connection available -- size: 1 A3 EXAMINE INBOX

FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing) OK [PERMANENTFLAGS ()] Flags permitted. OK [UIDVALIDITY 1] UIDs valid. 1671 EXISTS 0 RECENT OK [UIDNEXT 41328] Predicted next UID. OK [HIGHESTMODSEQ 2136476] A3 OK [READ-ONLY] INBOX selected. (Success) A4 SEARCH NOT (SEEN) SUBJECT "jenkins >" SINCE 9-Jun-2019 ALL

SEARCH 1659 A4 OK SEARCH completed (Success) A5 FETCH 1659 (ENVELOPE INTERNALDATE RFC822.SIZE)

1659 FETCH (RFC822.SIZE 14977 INTERNALDATE "10-Jun-2019 10:58:30 +0000" ENVELOPE ("Mon, 10 Jun 2019 10:58:29 +0000" "jenkins start job" ((“” NIL “” “.com")) ((“, ” NIL “” " hivehome.com")) (("" NIL "" "")) (("i@gmail.com" NIL "****" "gmail.com")) NIL NIL NIL "19C0EE53-A8CC-4C0C-AC75-00738AE92605@hivehome.com")) A5 OK Success

Found matching email(s) : 1

jenkins start job (2019/06/10 11:58:30 AM) A6 FETCH 1659 (FLAGS) 1659 FETCH (FLAGS ()) A6 OK Success

A7 FETCH 1659 (BODY.PEEK[HEADER])

1659 FETCH (BODY[HEADER] {6736} Delivered-To: iosxhive@gmail.co m Received: by 2002:a6b:310b:0:0:0:0:0 with SMTP id j11csp3574477ioa; Mon, 10 Jun 2019 03:58:30 -0700 (PDT) X-Google-Smtp-Sour ce: APXvYqy4d1teP3fcfUdYWU43G3eJQeXcCzrm8UwOL/hYsuwd0p3P/Vvz8LAnFRuZixH19KGhZVni X-Received: by 2002:a17:906:1286:: with SMTP id k6mr22101882ejb.183.1560164310564; Mon, 10 Jun 2019 03:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560164310; cv=none; d=google.com; s=arc-20160816; b=rP1KyOqNT4qOLLT6MFfduj/PmJ1GWe0uGndhU0AToWIGCdRdHzIXlSgx90KkXtk+WC /Xkm2fNTg+tT2uLbXV+gcKESIY6j9vPSxiM+ZZYr8IpZBo5wv1IuB1ISFxJnL3xIw7LJ oNYRfpwO0aY+MCFVQiAxyWLZgcgOvy8acdLUXbofVJ95l1AIUQqViVJpcxj6F8vXJLWW Aj0ZzUvudA8LU4CIfOdx8w+N95FA8dv5oKB4q3l/8x4a2lmB/wSclM16Oe8gVZimUbrQ NPpf3hdsS9BiM958LLVUnaZhfGlQJdP+mFez9UOlSgPcCFdhyftGBRT2SdSLmawOchwY tc5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-l anguage:accept-language:message-id:date :thread-index:thread-topic:subject:to:from:dkim-signature; bh=qgL7Fy9V9zqQxC+Y7x+GjjIQkZe2LUZ2vYUh3tsHcWE=; b=vVDaOLGpPC5r81nOv4SL78pKs26kMIQrfCppIVE6n1Xi3qSTMgJ2K1RsrPOZsdz7FW lNs7yNoGKtn40RQ7d6FvjW0X6YweutX5qmf45LrfRLIbPOkeO30KKFcSNAY3rQBfgtOt cqPtq+W+88mM45ol01wlszL27xKDEsFnQItaKuho30XWKTFkJADLaDk4yIvBNWVTZnlo /x+kjMU8D7QA+yHKQzq4VrXm+dTLP8eKqg9jwHF5u7Cfky2+KcIis3a00cL5fcZv9NSk VDK3QZirUhDGBzvvxa/7BCIVBGHDJpESh07GxxoZepoJxKvTSbNu6KNq4BTNks4T9CNo BDXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@centricaplc.onmicrosoft.com header.s=selector2-centricaplc-onmicrosoft-com header.b=UOMRMyBB; spf=pass (google.com: domain of @.com designates 104.47.10.50 as permitted sender) smtp.mailfrom=@ Return-Path: <@.com> Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03lp2050.outbound.protection.outlook.com. [104.47.10.50]) by mx.google.com with ESMTPS id m10si3665707edl.5.2019.06.10.03.58.30 for iosxhive@gmail.com (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jun 2019 03:58:30 -0700 (PDT) Received-SPF: pass (google.com: domain of @.com designates 104.47.10.50 as permitted sender) client-ip=104.47.10.50; Authentication-Results: mx.google.com; dkim=pass header.i=@centricaplc.onmicrosoft.com header.s=selector2-centricaplc-onmicrosoft-com header.b=UOMRMyBB; spf=pass (google.com: domain of vignesh.parameswari@hivehome.com designates 104.47.10.50 as permitted sender) smtp.mailfrom=vignesh.parameswari@hivehome.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=centricaplc.onmicrosoft.com; s=selector2-centricaplc-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qgL7Fy9V9zqQxC+Y7x+GjjIQkZe2LUZ2vYUh3tsHcWE=; b=UOMRMyBBSJKiLlc1TcLLA3B2Hnjs726NkiIsvqGFIAcJetPYXW5LtjUyzgNdBuKYOUJUmQ1a9gI/41HrEz2sH6+35y0r6ZwB6Sn9hdloK4jF63TqAy9V6hnXCGBfZEWTgP1AIYK/EuIgc8Y83w6hHGn9JhIydopnc7L+6FlMAeA= Received: from VI1P191MB0320.EURP191.PROD.OUTLOOK.COM (52.134.22.19) by VI1P191MB0173.EURP191.PROD.OUTLOOK.COM (10.172.13.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_25 6_GCM_SHA384) id 15.20.1965.12; Mon, 10 Jun 2019 10:58:29 +0000 Received: from VI1P191MB0320.EURP191.PROD.OUTLOOK.COM ([fe80::e416:1de1:d359:379e]) by VI1P191MB0320.EURP191.PROD.OUTLOOK.COM ([fe80::e416:1de1:d359:379e%5]) with mapi id 15.20.1965.017; Mon, 10 Jun 2019 10:58:29 +0000 From: "" @.com> To: “@gmail.com" ***@gmail.com Subject: jenkins start job Thread-Topic: jenkins start job Thread-Index: AQHVH3tvg++FlZ9+XUGr9h6G9N+gvw== Date: Mon, 10 Jun 2019 10:58:29 +0000 Message-ID: 19C0EE53-A8CC-4C0C-AC75-00738AE92605@hivehome.com Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authen tication-results: spf=none (sender IP is ) smtp.mailfrom=@.com; x-originating-ip: [195.89.75.182] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ab1482c2-85ba-4b28-daf2-08d6ed929226 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:VI1P191MB0173; x-ms-traffictypediagnostic: VI1P191MB0173: x-microsoft-antispam-prvs: VI1P191MB01730C24AE2133C77E6D5ABF9A130@VI1P191MB0173.EURP191.PROD.OUTLOOK.COM x-ms-oob-tlc-oobclassifiers: OLM:3173; x-forefront-prvs: 0064B3273C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(376002)(366004)(39860400002)(396003)(136003)(199004)(189003)(40134004)(5660300002)(68736007)(316002)(14454004)(76116006)(256004)(14444005)(5024004)(82746002)(73956011)(86362001)(53936002)(91956017)(83716004)(71190400001)(7736002)(2906002)(71200400001)(6916009)(2351001)(7116003)(186003)(6486002)(66946007)(3846002)(476003)(54896002)(6306002)(6512007)(478600001)(2501003)(2616005)(486006)(8936002)(8676002)(6436002)(5640700003)(1361003)(33656002)(99286004)(1730700003)(3480700005)(1411001)(64756008)(6116002)(26005)(81156014)(6506007)(102836004)(66476007)(81166006)(66556008)(66446008)(3 6756003)(66066001)(25786009)(966005);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1P191MB0173;H:VI1P191MB0320.EURP191.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: hivehome.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Vivm/NRg4wwZda7eoGCcrqWZS/Qi/QAL/mvZOO66zxV5JmzRXUg5p5kyP8VCL3otRuuiPLCHDxHDoxKO5zSeH4iLy+aC8vLtgdtOYV4gp1KvGC+GtB6Fn80oLgjnPyY6n5W70coDYJZO2wDEXGZa43t8CDkl4JLjLh8KFVWsthNQG4UNttT8eGEZBW/ADZZFsL7wf4LLbbIyJq1h6gSswfDVD6tw5YLMhHlGkyiOv+5BIboqhMuGROBThQVF9wUEcXv9E2sY3llzQvHAvWmPLyWIbLKJbzxx6xdBUHZV3bm3QCTwi9qSxEsBLoFsYiu/Wkm3GKW3VmFCrAtdNDpGesqIoW4VqDsVJEqQSiNXKJBg0QjHav9RFEDnotjUJZhwVm3DKMlleRmIe7nfgjguUk9gwJ1P2Y6fqh/40933lg4= Content-Type: multipart/alternative; boundary="000_19C0EE53A8CC4C0CAC7500738AE92605hivehomecom" MIME-Version: 1.0 X-OriginatorOrg: hivehome.com X-MS-Exchange-CrossTenant-Network-Message-Id: ab1482c2-85ba-4b28-daf2-08d6ed929226 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jun 2019 10:58:29.1412 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a603898f-7de2-45ba-b67d-d35fb519b2cf X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: vignesh.parameswari@hivehome. com X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1P191MB0173 ) A7 OK Success

A8 FETCH 1659 (BODYSTRUCTURE)

1659 FETCH (BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "utf-8") NIL NIL "BASE64" 2808 57 NIL NIL NIL)("TEXT" "HTML" ("CHARSET" "utf-8") "94A7175B9A146E488A6E8AC7DC321FB2@EURP191.PROD.OUTLOOK.COM" NIL "BASE64" 4850 97 NIL NIL NIL) "ALTERNATIVE" ("BOUNDARY" "000_19C0EE53A8CC4C0CAC7500738AE92605hivehomecom") NIL NIL)) [ERROR] - java.lang.RuntimeException: java.lang.NullPointerException at org.jenkinsci.plugins.pollmailboxtrigger.mail.utils.Stringify.stringify(Stringify.java:330) at org.jenkinsci.plugins.pollmailboxtrigger.mail.utils.MailWrapperUtils$MessagesWrapper.getMessageProperties(MailWrapperUtils.java:107) at org.jenkinsci.plugins.pollmailboxtrigger.PollMailboxTrigger.checkForEmails(PollMailboxTrigger.java:299) at org.jenkinsci.plugins.pollmailboxtrigger.PollMailboxTrigger.checkIfModified(PollMailboxTrigger.java:458) at org.jenkinsci.lib.xtrigger.AbstractTrigger$Runner.run(AbstractTrigger.java:198) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NullPointerException at javax.mail.internet.ParameterList.set(ParameterList.java:533) at com.sun.mail.imap.protocol.BODYSTRUCTURE.parseParameters(BODYSTRUCTURE.java:390) at com.sun.mail.imap.protocol.BODYSTRUCTURE.(BODYSTRUCTURE.java:224) at com.sun.mail.imap.protocol.BODYSTRUCTURE.(BODYSTRUCTURE.java:109) at com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:158) at com.sun.mail.imap.protocol.FetchResponse.(FetchResponse.java:67) at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:136) at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:267) at com.sun.mail.iap.Protocol.command(Protocol.java:312) at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1453) at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1445) at com.sun.mail.imap.protocol.IMAPProtocol.fetchBodyStructure(IMAPProtocol.java:1145) at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1285) at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:623) at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1446) at org.jenkinsci.plugins.pollmailboxtrigger.mail.utils.Stringify.stringify(Stringify.java:335) at org.jenkinsci.plugins.pollmailboxtrigger.mail.utils.Stringify.stringify(Stringify.java:328) ... 7 more

A9 CLOSE

A8 OK Success

A9 OK Returned to authenticated state. (Success)

DEBUG: added an Authenticated connection -- size: 1

A10 LOGOUT

BYE LOGOUT Requested A10 OK 73 good day (Success) DEBUG: IMAPStore connection dead

DEBUG: IMAPStore cleanup, force false

DEBUG: IMAPStore cleanup done

Polling complete. Took 2.5 sec. No changes.

Any pointers would be helpful. Thanks.

VkyHive commented 5 years ago

Any pointers on this, please?

nickgrealy commented 5 years ago

Hi @VkyHive ,

I'm not currently supporting this project. However, I can see that the issue is happening here:

Caused by: java.lang.NullPointerException
at javax.mail.internet.ParameterList.set(ParameterList.java:533)
at com.sun.mail.imap.protocol.BODYSTRUCTURE.parseParameters(BODYSTRUCTURE.java:390)
at com.sun.mail.imap.protocol.BODYSTRUCTURE.(BODYSTRUCTURE.java:224)
at com.sun.mail.imap.protocol.BODYSTRUCTURE.(BODYSTRUCTURE.java:109)
at com.sun.mail.imap.protocol.FetchResponse.parse(FetchResponse.java:158)
at com.sun.mail.imap.protocol.FetchResponse.(FetchResponse.java:67)
at com.sun.mail.imap.protocol.IMAPResponse.readResponse(IMAPResponse.java:136)
at com.sun.mail.imap.protocol.IMAPProtocol.readResponse(IMAPProtocol.java:267)
at com.sun.mail.iap.Protocol.command(Protocol.java:312)
at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1453)
at com.sun.mail.imap.protocol.IMAPProtocol.fetch(IMAPProtocol.java:1445)
at com.sun.mail.imap.protocol.IMAPProtocol.fetchBodyStructure(IMAPProtocol.java:1145)
at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1285)
at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:623)
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1446)
at org.jenkinsci.plugins.pollmailboxtrigger.mail.utils.Stringify.stringify(Stringify.java:335)
at org.jenkinsci.plugins.pollmailboxtrigger.mail.utils.Stringify.stringify(Stringify.java:328)
... 7 more

The error is thrown here -> javax.mail.internet.ParameterList.set(ParameterList.java:533), which is internal to the javax.mail library (sounds like a bug in the library).

When I google NullPointerException javax.mail.internet.ParameterList.set(ParameterList.java:533), I get the following stackoverflow question (and answers).

Most of the answers point to conflicting javax.mail classes on the (Jenkins) classpath (have you installed a new Jenkins mail related plugin recently?). Please try the answers there, and post back here if you find a solution.

Good luck!

VkyHive commented 5 years ago

Thanks for the reply @nickgrealy I have tried setting it up in another machine. It worked like charm. I have cleaned up all Jenkins and started the instance using war again in a problematic machine (Used same war that worked on another machine). Have same Java version (1.8.0_211) in both the machines. I didn't bring in any project here, just tried checking poll mailbox trigger is working fine with dummy project. I get the same error. I have no clue where would be the difference in the class path either since I didn't configure anything separately.

If you get some insights, please do drop the message. Thanks