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.

  • 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,
  • 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,
  • 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
    ,
    • java.lang.IllegalArgumentException: Null value not allowed as an environment variable: VARIABLE_NAME at hudson.EnvVars.put(EnvVars.java:356) at hudson.model.StringParameterValue.buildEnvironment(StringParameterValue.java:56) at hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:85) at hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:883) at hudson.plugins.parameterizedtrigger.AbstractBuildParameters.getEnvironment(AbstractBuildParameters.java:47) at org.jenkinsci.plugins.jobgenerator.parameterizedtrigger.PredefinedGeneratorParameters.getAction(PredefinedGeneratorParameters.java:59) at org.jenkinsci.plugins.jobgenerator.GeneratorRun$GeneratorImpl.gatherDownstreamGenerators(GeneratorRun.java:493) at org.jenkinsci.plugins.jobgenerator.GeneratorRun$GeneratorImpl.doRun(GeneratorRun.java:299) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:523) at hudson.model.Run.execute(Run.java:1688) at org.jenkinsci.plugins.jobgenerator.GeneratorRun.run(GeneratorRun.java:284) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:231) at hudson.model.OneOffExecutor.run(OneOffExecutor.java:43)

    Users with the same issue

    Unknown visitor1 times, last one,