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
40 stars 32 forks source link

Triggered Jenkins Slave Jobs Fail #18

Closed HumanifyTodRichards closed 6 years ago

HumanifyTodRichards commented 8 years ago

Steps to reproduce

How can we reproduce the issue

  1. Set up a Linux (CentOS 7), Jenkins (1.642.2) master
  2. Set up a Jenkins Slave on Windows Server 2008
  3. Set up a mailbox trigger job and configure it to run on the slave. The triggered job should perform an ant build.
  4. When the build runs, the entire raw email is dumped in the Jenkins log, it appears to be at the start of the Ant build step.

    Expected behaviour

Job succeeds. I have other email trigger jobs that run successfully on the Master build server.

Actual behaviour

Fails (see log below). When the email triggered job is started using Jenkins, then it runs successfully, it only fails when triggered via email.

Server configuration

Operating system: CentOS 7 and Windows 2008 - (yes unfortunately we must use Win'08)

Jenkins Version: 1.642.2

Plugin Version: 1.022

Jenkins Job Log output:

[PollMailboxTrigger] An email matching the filter criteria was found. (log) [EnvInject] - Loading node environment variables. Building remotely on MGMT-WINBLD02 (Windows2008 SQL2005) in workspace C:\Jenkins\workspace\BUILD_AND_DEPLOY_TRUNK_DEMAND Updating http://xxxxxxxxxxxxxxxxxxxxx at revision '2016-07-02T15:07:00.498 -0600' At revision 60412

No changes for http://xxxxxxxxxxxxxxxxxxxxx since the previous build Checking for pre-build Executing pre-build step Extended Email Publisher is currently disabled in project settings [EnvInject] - Executing scripts and injecting environment variables after the SCM step. [BUILD_AND_DEPLOY_TRUNK_DEMAND] $ cmd.exe /C '"ant.bat "-Dpmt_contentType=multipart/ALTERNATIVE; boundary=047d7bae494e147c6e053697ca5a" -Dpmt_host=imap.gmail.com -Dpmt_receivedDate=2016-07-01T13:14Z "-Dpmt_replyTo=yyyyyyy yyyyyyyyy@humanify.com" -Dpmt_mail.debug.auth=false -Dpmt_sentDate=2016-07-01T13:13Z -Dpmt_recipients=xxxxxxxxxx@gmail.com -Dpmt_username=xxxxxxxxxxxx@gmail.com -Dpmt_messageNumber=1 -Dpmt_mail.imaps.port=993 "-Dpmt_headers=Delivered-To=xxxxxxxxxxxxxxxx@gmail.com, Received=by 10.55.100.144 with SMTP id y138csp428282qkb; Fri, 1 Jul 2016 12:14:02 -0700 (PDT), X-Received=by 10.28.167.136 with SMTP id q130mr1033898wme.62.1467400442477; Fri, 01 Jul 2016 12:14:02 -0700 (PDT), Return-Path=yyyyyyyyyyyy@humanify.com, Received=from mail-wm0-x234.google.com (mail-wm0-x234.google.com. [2a00:1450:400c:c09::234]) by mx.google.com with ESMTPS id kz10si2362154wjb.243.2016.07.01.12.14.02 for xxxxxxxxxxxxxxxx@gmail.com (version=TLS1_2 cipher=ECDHE-RSA-AES128-MMM-SHA256 bits=128/128); Fri, 01 Jul 2016 12:14:02 -0700 (PDT), Received-SPF=neutral (google.com: 2a00:1450:400c:c09::234 is neither permitted nor denied by domain of yyyyyyyyyy@humanify.com) client-ip=2a00:1450:400c:c09::234;, Authentication-Results=mx.google.com; dkim=pass header.i=@humanify-com.20150623.gappssmtp.com; spf=neutral (google.com: 2a00:1450:400c:c09::234 is neither permitted nor denied by domain of yyyyyyyyyyyyy@humanify.com) smtp.mailfrom=tod.richards@humanify.com, Received=by mail-wm0-x234.google.com with SMTP id a66so16879287wme.0 for xxxxxxxxxxxxxxxx@gmail.com; Fri, 01 Jul 2016 12:14:02 -0700 (PDT), DKIM-Signature=v=1; a=rsa-sha256; c=relaxed/relaxed; d=humanify-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=zYn96f/RuR5L+tFba6FUoumi55Q5uGxb7Z/57vEXes0=; b=RJWqyUQUFvanBUJlj7hRqQOGut/MgmXXXXX4KD8ozkLEOQZql1yTHPP76KV3G ceRmKYOa0sdS50WRPUNsC9eLSjb5GcK3yyLnUEG3izxZVtqPW8UvS8uTaiIGY5iYd6Zt 9lHQ87zkhtdeoKCYsQ3Z9J/SFXnHaycngqL6VYBULCxUywl349YfHV4c80SyJZtpeDq0 7ubOGtEI43iiwWlpIH90CVFwqU49KZGIF1TfN9mFJmj/hhAgp0z+BJMBd+WqntAt6O3E imlo+jBlhND+PuUg1iU3cnXZKO/iAwvN4heQd+nsAEFyLk2/C6NQ7ETmJ0b0hAvZRkmC wm2w==, X-Google-DKIM-Signature=v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zYn96f/RuR5L+tFba6FUoumXXXXXxxxxGxb7Z/57vEXes0=; b=Jh1mS5pxC0rkKEofasGA11rVs+Fa5XBlbl/7d87xSqYnp2CWo7/kQyTK19pWc5O7Ov m4vu+42jLp3AKyBo88WJSqGGRjIlkbAkpiNXgasxkMDot2X6X/e5rYaqkZRp/jkgGECz /dd6C9PNAHGJu6JVO9EzzKUxKYoOdrclWsOQuFOxpGI2abRKxE7oU2j30iYfn7U6Z5nt pDxri0Piu1ztlfkkXxxxxxxxxh09HOpeCRcVHZc4lKZlrDe6tQirBrs1dxH95lpE7E h72I4HMz24+Ox2GfBD0NWf+5CCBJs6/FWyPuAYCvaLSUmFxxFZhmy1Xi83q8an5pCJ8 /Gyw==, X-Gm-Message-State=ALyK8tLdL/GPxxxxxxxChy7y032D0gmKBc8r/ulTVVevM7SFRfUdog46ouXAbDrSjg0rtQQGIIDGAncAmJLpl6s, X-Received=by 10.194.201.73 with SMTP id jy9mr5789249wjc.150.1467400441849; Fri, 01 Jul 2016 12:14:01 -0700 (PDT), MIME-Version=1.0, Received=by 10.28.223.11 with HTTP; Fri, 1 Jul 2016 12:13:42 -0700 (PDT), From=yyyyyyyyyyyyy yyyyyyyyyyyyy@humanify.com, Date=Fri, 1 Jul 2016 13:13:42 -0600, Message-ID=CALsm6FhxmdMCxAFmUjGYUwA4thv3XxU5Ku1xPiR18grCnmqKA@mail.gmail.com, Subject=Jenkins > BUILD_AND_DEPLOY_TRUNK_DEMAND, To=xxxxxxxxxxxxxxxx@gmail.com, Content-Type=multipart/alternative; boundary=047d7bae494e147c6e053697ca5a" "-Dpmt_from=yyyyyyyyyyyyy yyyyyyyyyy@humanify.com" "-Dpmt_jobTrigger= BUILD_AND_DEPLOY_TRUNK_DEMAND" -Dpmt_storeName=imaps -Dpmt_receivedXMinutesAgo=1440 -DPOD=dce1 "-Dpmt_subjectContains=jenkins >" -Dpmt_flags="" "-Dpmt_subject=Jenkins > BUILD_AND_DEPLOY_TRUNK_DEMAND" -Dpmt_mail.imaps.host=imap.gmail.com "-Dpmt_content=

<div dir=""ltr"">POD=dce1<br clear=""all"">


--
<div class=""gmail_signature"" data-smartmail=""gmail_signature""><div dir=""ltr"">
<div dir=""ltr""><div dir=""ltr""><div dir=""ltr"">

yyyyyyyyyyyyyy<b style=""font-size:12.8px"">

<b style=""font-size:12.8px"">Humanify™

<a href=""mailto:yyyyyyyyyyy@humanify.com"" target=""_blank"">yyyyyyyyyy@humanify.com • <span style=""direction:ltr"">

POD=dce1

" -Dpmt_folder=xxxxxxxx -Dpmt_mail.debug=false -Denvironment=dce1 -Dbuild.number=13 -Dscript_db.onstaterules_db_name=OnStateRules -Dbuild.num=13 -Djob.name=BUILD_AND_DEPLOY_TRUNK_DEMAND_WIN -Drelease.number=trunk package && exit %%ERRORLEVEL%%"' The syntax of the command is incorrect. Build step 'Invoke Ant' marked build as failure Checking for post-build Performing post-build step Extended Email Publisher is currently disabled in project settings Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered Finished: FAILURE

nickgrealy commented 6 years ago

Hi @HumanifyTodRichards ,

Looking at your log output, it would appear this issue is not related to the plugin, but rather to the differences between how the Linux operating system handles command line arguments, as compared to how the Windows operating system handles command line arguments.

The problem happens when you invoke cmd.exe /C '"ant.bat "..."' - I'd start investigation here.

Please let me know if you still think this is a bug.

Kind regards, Nick