java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Builds are not triggered via Poll SCM. This error is solved when server is restart. {noformat} ERROR: Build step failed with exception java.lang.IllegalArgumentException: Null value not allowed as an environment variable: REPOVERSION at hudson.EnvVars.put(EnvVars.java:356) at hudson.model.StringParameterValue.buildEnvironment(StringParameterValue.java:56) at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:89) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:953) at hudson.plugins.gradle.Gradle.performTask(Gradle.java:127) at hudson.plugins.gradle.Gradle.perform(Gradle.java:118) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408) Build step 'Invoke Gradle script' marked build as failure ERROR: Failed to evaluate groovy script. java.lang.IllegalArgumentException: Null value not allowed as an environment variable: REPOVERSION at hudson.EnvVars.put(EnvVars.java:356) at hudson.model.StringParameterValue.buildEnvironment(StringParameterValue.java:56) at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:89) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:953) at hudson.model.AbstractBuild$getEnvironment.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at notifybuild.run(notifybuild.groovy:12) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:627) at groovy.lang.Script.evaluate(Script.java:219) at groovy.lang.Script$evaluate.callCurrent(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at Script1.run(Script1.groovy:1) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:580) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618) at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589) at org.jvnet.hudson.plugins.groovypostbuild.GroovyPostbuildRecorder.perform(GroovyPostbuildRecorder.java:276) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726) at hudson.model.Build$BuildExecution.post2(Build.java:185) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671) at hudson.model.Run.execute(Run.java:1766) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408) Build step 'Groovy Postbuild' marked build as failure {noformat} Version of Jenkins this bug is occurring {noformat} Jenkins ver. 1.625.3 {noformat} Version of groovy plugin {noformat} ver. 1.14 {noformat} Version of groovy postbuild plugin {noformat} ver. 1.8 {noformat} Groovy script {noformat} import groovyx.net.http.RESTClient import static groovyx.net.http.ContentType.* import hudson.model.* def repoversion = "X" def env = build.getEnvironment() def projectName = build.project.getName() def commit = env['GIT_COMMIT'] int CONNECTION_TIMEOUT = 30*1000; int SOCKET_TIMEOUT = 45*1000; try{ def solnet = new RESTClient( 'http://ip_adress/' ) solnet.getClient().getParams().setParameter("http.connection.timeout", new Integer(CONNECTION_TIMEOUT)) solnet.getClient().getParams().setParameter("http.socket.timeout", new Integer(SOCKET_TIMEOUT)) def resp = solnet.get( path : 'repo_get_version.php', query: ['name':projectName,'revision':commit]) if(resp.status == 200){ repoversion = resp.data.version } } catch(Exception e){ println e.getMessage() } def pa = new ParametersAction([ new StringParameterValue("REPOVERSION", repoversion) ]) // add variable to current job Thread.currentThread().executable.addAction(pa) {noformat}
    via by Andres Garcia,
  • 1.28 fails with NPEs
    via GitHub by arcivanov
    ,
  • We've been having a problem lately with some of our cloud slaves getting killed during the build - when this happens, email-ext/token-macro fails to actually transform any tokens, ending up with a useless email. Here's the stacktrace from the logs: {code} Jun 20, 2014 2:34:35 AM hudson.plugins.emailext.plugins.ContentBuilder transformText SEVERE: null java.lang.IllegalArgumentException: Node ec2-beefy-slave-406.vpc.cloudera.com seems to be offline at hudson.tools.ToolInstaller.preferredLocation(ToolInstaller.java:120) at hudson.tools.JDKInstaller.performInstallation(JDKInstaller.java:109) at hudson.tools.InstallerTranslator.getToolHome(InstallerTranslator.java:61) at hudson.tools.ToolLocationNodeProperty.getToolHome(ToolLocationNodeProperty.java:107) at hudson.tools.ToolInstallation.translateFor(ToolInstallation.java:204) at hudson.model.JDK.forNode(JDK.java:126) at hudson.model.AbstractProject.getEnvironment(AbstractProject.java:359) at hudson.model.Run.getEnvironment(Run.java:2173) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:914) at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:229) at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:71) at hudson.plugins.emailext.ExtendedEmailPublisher.setSubject(ExtendedEmailPublisher.java:585) at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:473) at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:290) at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:281) at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:233) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:757) at hudson.model.Build$BuildExecution.cleanUp(Build.java:192) at hudson.model.Run.execute(Run.java:1710) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246) {code}
    via by Andrew Bayer,
  • Unable to build MR updates
    via GitHub by hho
    ,
  • I'm trying to use the Dynamic Choice Parameter plugin to set up a parameterized build in Jenkins. The parameters should be the names of some directory's in a directory of the working directory of the job (i.e. `/var/lib/jenkins/workspace/JobName/dirToScan/`). Making the items in the drop down menu can be done in this way: `def list = ['ls', "/path/to/dirToScan/"].execute().text.tokenize()` To reach the right directory, I need the name of the job since, as opposed to when a job is executed, the directory in which the this is done is not the `/var/lib/jenkins/workspace/[Job Name]/` directory but the root dir `/`. The Dynamic Choice Parameter plugin allows the execution of a Groovy script to fill the choice parameter. Using the answer provided [here|http://stackoverflow.com/a/28745606] I was able to retrieve the job name. So my final code to build the drop-down menu in the parameterized build menu in Jenkins looks like this: {quote} def build = Thread.currentThread().toString() def regexp= ".+?/job/([^/]+)/.*" def match = build =~ regexp def jobName = match[0][1] def list = ['ls', "/var/lib/jenkins/workspace/" << jobName << "/dirToScan"].execute().text.tokenize() {quote} Clicking the Build with Parameters link in the Jenkins job opens the page with the drop-down menu (which I named Restore) and also the actual building works great! But now comes my problem: If set the job to be build periodically, the build fails with the following console output: {quote} Started by timer Building in workspace /var/lib/jenkins/workspace/JobName FATAL: Null value not allowed as an environment variable: Restore java.lang.IllegalArgumentException: Null value not allowed as an environment variable: Restore at hudson.EnvVars.put(EnvVars.java:356) at hudson.model.StringParameterValue.buildEnvironment(StringParameterValue.java:56) at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:88) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:929) at hudson.plugins.mercurial.MercurialSCM.checkout(MercurialSCM.java:533) at hudson.scm.SCM.checkout(SCM.java:484) at hudson.model.AbstractProject.checkout(AbstractProject.java:1270) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:609) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:531) at hudson.model.Run.execute(Run.java:1750) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:89) at hudson.model.Executor.run(Executor.java:240) Finished: FAILURE {quote} This does not happen if I just populate the drop-down menu in a 'normal' way, e.g.: def list = ["Option 1", "Option 2", "Option 3"] This might be a bug in the plugin, or Jenkins being unable to execute the Groovy code if it starts a job by itself. The problem only occurs with a periodic build, not if I start the build myself and it it independent of the chosen option in the drop-down menu.
    via by Chiel de Koningh,
    • java.lang.IllegalArgumentException: Null value not allowed as an environment variable: REPOVERSION at hudson.EnvVars.put(EnvVars.java:356) at hudson.model.StringParameterValue.buildEnvironment(StringParameterValue.java:56) at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:89) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:953) at hudson.plugins.gradle.Gradle.performTask(Gradle.java:127) at hudson.plugins.gradle.Gradle.perform(Gradle.java:118) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785) at hudson.model.Build$BuildExecution.build(Build.java:205) at hudson.model.Build$BuildExecution.doRun(Build.java:162) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537) at hudson.model.Run.execute(Run.java:1741) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:408)

    Users with the same issue

    Unknown visitor1 times, last one,