java.lang.IllegalArgumentException: Null value not allowed as an environment variable: REPOVERSION

Jenkins JIRA | Andres Garcia | 5 months ago
  1. 0

    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}

    Jenkins JIRA | 5 months ago | Andres Garcia
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: REPOVERSION
  2. 0

    Jenkins fails on periodic build with Dynamic Choice Parameter Groovy script

    Stack Overflow | 2 years ago
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: Restore
  3. 0

    1.28 fails with NPEs

    GitHub | 1 year ago | arcivanov
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: ghprbAuthorRepoGitUrl
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Jenkins bails when gitlabDescription is null

    GitHub | 1 year ago | mattiasb
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: gitlabDescription
  6. 0

    When one uses Predefined Generator Parameters to trigger a parameterized build, this exception is raised where VARIABLE_NAME is the name of a defined Generator Parameter: 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)

    Jenkins JIRA | 3 years ago | Sylvain Benner
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: VARIABLE_NAME

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalArgumentException

      Null value not allowed as an environment variable: REPOVERSION

      at hudson.EnvVars.put()
    2. Hudson
      AbstractBuild.getEnvironment
      1. hudson.EnvVars.put(EnvVars.java:356)
      2. hudson.model.StringParameterValue.buildEnvironment(StringParameterValue.java:56)
      3. hudson.model.ParametersAction.buildEnvVars(ParametersAction.java:89)
      4. hudson.model.AbstractBuild.getEnvironment(AbstractBuild.java:953)
      4 frames
    3. hudson.plugins.gradle
      Gradle.perform
      1. hudson.plugins.gradle.Gradle.performTask(Gradle.java:127)
      2. hudson.plugins.gradle.Gradle.perform(Gradle.java:118)
      2 frames
    4. Hudson
      Executor.run
      1. hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      2. hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
      3. hudson.model.Build$BuildExecution.build(Build.java:205)
      4. hudson.model.Build$BuildExecution.doRun(Build.java:162)
      5. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
      6. hudson.model.Run.execute(Run.java:1741)
      7. hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      8. hudson.model.ResourceController.execute(ResourceController.java:98)
      9. hudson.model.Executor.run(Executor.java:408)
      9 frames