Hung mail notification in Jenkins Pipeline or Workflow -
i have created test workflow below:
node("master") { ws("/opt/mount1/jenkins/jobs/googleflow/workspace/${env.build_number}") { try { stage name: 'sync', concurrency: 3 echo "before sync" sh '''touch buildfile echo "this ${build_number}" >> buildfile cat buildfile''' sh "sleep 5" echo "after sync" sh "date" stage name: 'build', concurrency: 1 echo "before build" sh "date" sh '''sleep 10 cat buildfile''' echo "build 1/3" sh "sleep 5" echo "build 2/3" sh '''sleep 5 cat buildfile''' echo "build 3/3" sh "date" stage name: 'test', concurrency: 3 echo "before test" sh "date" sh '''sleep 10 cat buildfile''' sh "date" stage name: 'delete', concurrency: 1 sh '''pwd ls -al''' //deletedir() //sh '''pwd //ls -al''' } catch (err){ stage 'send notification' mail (to: 'xxxxxxx@gmail.com', subject: "test", body: "test"); } } }
i trying email notification using try-catch. have referred this blog post, when comes stage 'send notification' sits there hung.
but if use old jenkins job way, can receive emails. shows smtp setup working. below console output, when hungs
[pipeline] allocate node : start running on master in /opt/mount1/jenkins/jobs/googleflow/workspace@4 [pipeline] node { [pipeline] allocate workspace : start running in /opt/mount1/jenkins/jobs/googleflow/workspace/205 [pipeline] ws { [pipeline] stage: sync entering stage sync proceeding [pipeline] echo before sync [pipeline] sh [205] running shell script + touch buildfile + echo 'this 205' + cat buildfile 205 [pipeline] sh [205] running shell script + sleep 5 [pipeline] echo after sync [pipeline] sh [205] running shell script + date tue feb 2 22:54:52 utc 2016 [pipeline] stage: build entering stage build waiting builds [204] canceled since #206 got here [pipeline] stage: send notification entering stage send notification proceeding [pipeline] mail
any idea on how fix?
jenkins - 1.643 mailer plugin - 1.11
i had same problem , fixed upgrading mailer v 1.16.
Comments
Post a Comment