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

Jenkins JIRA | Sankara Subramanian Hariharakumar | 3 years ago
  1. 0

    Hi Team, Recently, We have been upgraded the Jenkins from 1.466 to 1.509.2 version. Also we have been updated all the available plugins including Maven plugin. All the Maven jobs after upgradation of Jenkins gets failed with the below error log(full log) Started by timer [EnvInject] - Loading node environment variables. Building remotely on <slavename> in workspace /home/hudson/slave3/workspace/event-driven-app FATAL: Null value not allowed as an environment variable: M2_HOME java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME at hudson.EnvVars.put(EnvVars.java:172) at hudson.tasks.Maven$MavenInstallation.buildEnvVars(Maven.java:474) at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:172) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:783) at hudson.model.AbstractProject.checkout(AbstractProject.java:1367) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:674) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:579) at hudson.model.Run.execute(Run.java:1575) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) But after changing the version of Maven to any of the other version by saving it and resaved the correct maven version(2.2.1) configuration in the job the error is getting resolved and build gets succeeded. Kindly advise on the error/fix for the same

    Jenkins JIRA | 3 years ago | Sankara Subramanian Hariharakumar
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME
  2. 0

    Hi Team, Recently, We have been upgraded the Jenkins from 1.466 to 1.509.2 version. Also we have been updated all the available plugins including Maven plugin. All the Maven jobs after upgradation of Jenkins gets failed with the below error log(full log) Started by timer [EnvInject] - Loading node environment variables. Building remotely on <slavename> in workspace /home/hudson/slave3/workspace/event-driven-app FATAL: Null value not allowed as an environment variable: M2_HOME java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME at hudson.EnvVars.put(EnvVars.java:172) at hudson.tasks.Maven$MavenInstallation.buildEnvVars(Maven.java:474) at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:172) at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:783) at hudson.model.AbstractProject.checkout(AbstractProject.java:1367) at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:674) at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:579) at hudson.model.Run.execute(Run.java:1575) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:237) But after changing the version of Maven to any of the other version by saving it and resaved the correct maven version(2.2.1) configuration in the job the error is getting resolved and build gets succeeded. Kindly advise on the error/fix for the same

    Jenkins JIRA | 3 years ago | Sankara Subramanian Hariharakumar
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME
  3. 0

    My job stopped to poll changes from SVN some time ago - it all runs properly when started manually or by timer, but it won't poll when a change occurs in repository. I have tried tweaking with Maven installations, cloning the job etc. Other jobs using Git do not have this problem. SVN polling shows: ERROR: Failed to record SCM polling for hudson.maven.MavenModuleSet@eafaabe[scmTest] java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME at hudson.EnvVars.put(EnvVars.java:172) at hudson.tasks.Maven$MavenInstallation.buildEnvVars(Maven.java:492) at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:173) at hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1230) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject._poll(AbstractProject.java:1523) at hudson.model.AbstractProject.poll(AbstractProject.java:1448) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) When I get into job configuration in Maven build section I get "ERROR" below Root POM line. I am attaching the exact ERROR message as a separate file.

    Jenkins JIRA | 3 years ago | Pawel Gronkiewicz
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    A user in a cloud setup in which there was one Maven installation defined, with no static installation directory but a plugin offering a location for cloud slaves, ran Subversion polling on a job and got this error: {code:none} java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME at hudson.EnvVars.put(EnvVars.java:172) at hudson.tasks.Maven$MavenInstallation.buildEnvVars(Maven.java:489) at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:172) at hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1230) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject._poll(AbstractProject.java:1521) at hudson.model.AbstractProject.poll(AbstractProject.java:1446) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) {code}

    Jenkins JIRA | 3 years ago | Jesse Glick
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME
  6. 0

    My job stopped to poll changes from SVN some time ago - it all runs properly when started manually or by timer, but it won't poll when a change occurs in repository. I have tried tweaking with Maven installations, cloning the job etc. Other jobs using Git do not have this problem. SVN polling shows: ERROR: Failed to record SCM polling for hudson.maven.MavenModuleSet@eafaabe[scmTest] java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME at hudson.EnvVars.put(EnvVars.java:172) at hudson.tasks.Maven$MavenInstallation.buildEnvVars(Maven.java:492) at hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:173) at hudson.scm.SubversionSCM.compareRemoteRevisionWith(SubversionSCM.java:1230) at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356) at hudson.scm.SCM.poll(SCM.java:373) at hudson.model.AbstractProject._poll(AbstractProject.java:1523) at hudson.model.AbstractProject.poll(AbstractProject.java:1448) at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:439) at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:468) at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722) When I get into job configuration in Maven build section I get "ERROR" below Root POM line. I am attaching the exact ERROR message as a separate file.

    Jenkins JIRA | 3 years ago | Pawel Gronkiewicz
    java.lang.IllegalArgumentException: Null value not allowed as an environment variable: M2_HOME

    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: M2_HOME

      at hudson.EnvVars.put()
    2. Hudson
      Maven$MavenInstallation.buildEnvVars
      1. hudson.EnvVars.put(EnvVars.java:172)
      2. hudson.tasks.Maven$MavenInstallation.buildEnvVars(Maven.java:474)
      2 frames
    3. Hudson Maven Embedder
      MavenModuleSetBuild.getEnvironment
      1. hudson.maven.MavenModuleSetBuild.getEnvironment(MavenModuleSetBuild.java:172)
      1 frame
    4. Hudson
      AbstractBuild$AbstractBuildExecution.defaultCheckout
      1. hudson.scm.SubversionSCM.checkout(SubversionSCM.java:783)
      2. hudson.model.AbstractProject.checkout(AbstractProject.java:1367)
      3. hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:674)
      3 frames
    5. jenkins.scm
      SCMCheckoutStrategy.checkout
      1. jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
      1 frame
    6. Hudson
      Run.execute
      1. hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:579)
      2. hudson.model.Run.execute(Run.java:1575)
      2 frames
    7. Hudson Maven Embedder
      MavenModuleSetBuild.run
      1. hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
      1 frame
    8. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:88)
      2. hudson.model.Executor.run(Executor.java:237)
      2 frames