Jenkins pipeline build failing even though all steps/stages pass

4,289 views
Skip to first unread message

Raj Sahae

unread,
Dec 28, 2016, 2:59:13 AM12/28/16
to Jenkins Users
Hi all,

I have a pipeline that I consider to be pretty basic. Nothing complicated in terms of the logic. Here is a gist (https://gist.github.com/rajsahae/961350d0d4ea14b6b5246767ce2ab5af)
 where I have anonymized the jenkinsfile but other than the specific names being changed, this file is exactly what I am running.

The jenkins job running this jenkinsfile always fails. Even though all the scripts and steps pass. The console output does not show any reason for the job to fail. It simply gets to the end and reports failure.

I would greatly appreciate some guidance on this as I have been struggling with this particular hurdle for several days now.

Thanks,
Raj

David Karr

unread,
Dec 28, 2016, 6:52:52 PM12/28/16
to jenkins...@googlegroups.com
I'd say we would need to see all of the console output, even though
you say it reports failure.
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/a83d0374-dbbf-4cf0-8b6c-e150b02ea723%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Raj Sahae

unread,
Dec 28, 2016, 7:38:07 PM12/28/16
to Jenkins Users
Hi David,

Thanks for your reply. I can certainly attempt to post the output but I will have to go through and sanitize it a bit. That might take some time. Will try to post back here ASAP with something for you to look at.

Raj Sahae

unread,
Dec 28, 2016, 7:52:09 PM12/28/16
to Jenkins Users
Hi David,

I'm looking through the output and there is no way for me to fully sanitize this without deleting large swaths of output at which point I can't guarantee that you would find the output complete enough.
Are there any questions or analysis of the output that I could communicate to you via this thread that would allow you to come to some conclusion about what may be going on?

At the very least I can grep for "fail" and "error" and show you that there are no meaningful failure or error lines in the console output?


On Wednesday, December 28, 2016 at 3:52:52 PM UTC-8, David Karr wrote:

Raj Sahae

unread,
Dec 28, 2016, 7:57:40 PM12/28/16
to Jenkins Users
Hi David,

Here is a gist of the grepped failure output. I had to remove two segments of the output but I looked over them, very carefully, for any sort of failure indication and there was none.


The rest of the output, you can see, is largely some unit test reporting where it show 0 failures and 0 expected failures, but otherwise there are no error/failure indications.
The command I used to produce this output was "grep -i -e fail -e error output.txt" where output.txt was a copy/paste of the full console output from my jenkins job.

Thanks,
Raj

jer...@bodycad.com

unread,
Jan 3, 2017, 9:30:11 AM1/3/17
to Jenkins Users
Take care a ill formated script part make the build as failing. use some print line to make sure you reach the end of the script. Many script error are way too silent into JenkinsFile.

Daniel Beland

unread,
Jan 3, 2017, 3:22:07 PM1/3/17
to Jenkins Users

I had a similar problem today and sadly my conclusion is it can be anything.

In my case the culprit was the archiveArtifacts that failed because it couldn't find anything to archive.
It silently marked the build as failed without any output in the console or the build pipeline steps page.

Since the build was going on a bit after that it took me some time to find it.

My advice is to comment out as much as you can, running a build without publishers and make sure it succeeds.
Then add publishers one at a time until you find the cause, assuming one of them is the culprit.

Raj Sahae

unread,
Jan 3, 2017, 8:06:00 PM1/3/17
to Jenkins Users
Hi Daniel,

You were right, it was an archiveArtifacts step that was failing without any output whatsoever.

Thanks,

Raj
Reply all
Reply to author
Forward
0 new messages