How to identify exactly where exception occurred in Jenkins pipeline?

2020-07-30 Thread Gajanan Mahajan
In Jenkins pipeline build, sometimes I've seen null pointer or other exceptions like - java.lang.NullPointerException: Cannot invoke method trim() on null object Generally if we run Java program through IDE or command line, if an exception occurs we see at which line number the exception

Re: Jenkins hang on startup after "Listed all plugins"

2020-07-30 Thread Randall Becker
In case anyone is curious, I identified two sources of this issue. 1) JGit is throwing exceptions because nanosecond resolution is set to UNDEFINED and any time you do math (add a value) with that value in Java long, you get an Arithmetic Overflow. This seems to have left some threads in an

Re: cannot get build causes

2020-07-30 Thread 'Gavin Davies' via Jenkins Users
Try nesting that in a script block pipeline { agent any stages { stage('example') { steps { * script {* def causes = currentBuild.getBuildCauses() echo "Causes are ${causes}" * }* } } } }

Re: cannot get build causes

2020-07-30 Thread Gianluca
Hi, that is a confusing error in my point of view that you will learn to interpret :-) The pipeline you wrote is a declarative one and the usage of "def ... " is something you can do only in scripted pipelines ... hence, what the error really means is: "You forgot to open a script block".